OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // chromeos::RemovableDeviceNotificationsCros listens for mount point changes | 5 // chromeos::RemovableDeviceNotificationsCros listens for mount point changes |
6 // and notifies the SystemMonitor about the addition and deletion of media | 6 // and notifies the SystemMonitor about the addition and deletion of media |
7 // devices. | 7 // devices. |
8 | 8 |
9 #ifndef CHROME_BROWSER_SYSTEM_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_CHROMEOS_H_ | 9 #ifndef CHROME_BROWSER_SYSTEM_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_CHROMEOS_H_ |
10 #define CHROME_BROWSER_SYSTEM_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_CHROMEOS_H_ | 10 #define CHROME_BROWSER_SYSTEM_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_CHROMEOS_H_ |
11 | 11 |
12 #if !defined(OS_CHROMEOS) | 12 #if !defined(OS_CHROMEOS) |
13 #error "Should only be used on ChromeOS." | 13 #error "Should only be used on ChromeOS." |
14 #endif | 14 #endif |
15 | 15 |
16 #include <map> | 16 #include <map> |
17 #include <string> | 17 #include <string> |
18 | 18 |
19 #include "base/basictypes.h" | 19 #include "base/basictypes.h" |
20 #include "base/compiler_specific.h" | 20 #include "base/compiler_specific.h" |
21 #include "base/memory/ref_counted.h" | 21 #include "base/memory/ref_counted.h" |
22 #include "base/system_monitor/system_monitor.h" | 22 #include "base/system_monitor/system_monitor.h" |
23 #include "chromeos/disks/disk_mount_manager.h" | 23 #include "chromeos/disks/disk_mount_manager.h" |
24 | 24 |
25 namespace chromeos { | 25 namespace chromeos { |
26 | 26 |
| 27 class RemovableDeviceNotificationsCros; |
| 28 typedef RemovableDeviceNotificationsCros RemovableDeviceNotifications; |
| 29 |
27 class RemovableDeviceNotificationsCros | 30 class RemovableDeviceNotificationsCros |
28 : public base::RefCountedThreadSafe<RemovableDeviceNotificationsCros>, | 31 : public base::RefCountedThreadSafe<RemovableDeviceNotificationsCros>, |
29 public disks::DiskMountManager::Observer { | 32 public disks::DiskMountManager::Observer { |
30 public: | 33 public: |
31 RemovableDeviceNotificationsCros(); | 34 RemovableDeviceNotificationsCros(); |
32 | 35 |
33 virtual void DiskChanged(disks::DiskMountManagerEventType event, | 36 virtual void DiskChanged(disks::DiskMountManagerEventType event, |
34 const disks::DiskMountManager::Disk* disk) OVERRIDE; | 37 const disks::DiskMountManager::Disk* disk) OVERRIDE; |
35 virtual void DeviceChanged(disks::DiskMountManagerEventType event, | 38 virtual void DeviceChanged(disks::DiskMountManagerEventType event, |
36 const std::string& device_path) OVERRIDE; | 39 const std::string& device_path) OVERRIDE; |
(...skipping 30 matching lines...) Expand all Loading... |
67 // Mapping of relevant mount points and their corresponding mount devices. | 70 // Mapping of relevant mount points and their corresponding mount devices. |
68 // Only accessed on the UI thread. | 71 // Only accessed on the UI thread. |
69 MountMap mount_map_; | 72 MountMap mount_map_; |
70 | 73 |
71 DISALLOW_COPY_AND_ASSIGN(RemovableDeviceNotificationsCros); | 74 DISALLOW_COPY_AND_ASSIGN(RemovableDeviceNotificationsCros); |
72 }; | 75 }; |
73 | 76 |
74 } // namespace chromeos | 77 } // namespace chromeos |
75 | 78 |
76 #endif // CHROME_BROWSER_SYSTEM_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_CHROMEOS
_H_ | 79 #endif // CHROME_BROWSER_SYSTEM_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_CHROMEOS
_H_ |
OLD | NEW |