Ben Chan | 6e72692 | 2011-06-28 15:54:32 -0700 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "cros-disks/device-event.h" |
| 6 | |
| 7 | namespace cros_disks { |
| 8 | |
Ben Chan | 89cf29e | 2011-08-10 13:11:05 -0700 | [diff] [blame^] | 9 | bool DeviceEvent::operator==(const DeviceEvent& event) const { |
| 10 | return event.event_type == event_type && event.device_path == device_path; |
| 11 | } |
| 12 | |
Ben Chan | 6e72692 | 2011-06-28 15:54:32 -0700 | [diff] [blame] | 13 | bool DeviceEvent::IsDiskEvent() const { |
| 14 | switch (event_type) { |
| 15 | case kDiskAdded: |
| 16 | case kDiskAddedAfterRemoved: |
| 17 | case kDiskChanged: |
| 18 | case kDiskRemoved: |
| 19 | return true; |
| 20 | default: |
| 21 | return false; |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | } // namespace cros_disks |