| 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_ |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 class RemovableDeviceNotificationsCros | 39 class RemovableDeviceNotificationsCros |
| 40 : public base::RefCountedThreadSafe<RemovableDeviceNotificationsCros>, | 40 : public base::RefCountedThreadSafe<RemovableDeviceNotificationsCros>, |
| 41 public disks::DiskMountManager::Observer { | 41 public disks::DiskMountManager::Observer { |
| 42 public: | 42 public: |
| 43 // Should only be called by browser start up code. Use GetInstance() instead. | 43 // Should only be called by browser start up code. Use GetInstance() instead. |
| 44 RemovableDeviceNotificationsCros(); | 44 RemovableDeviceNotificationsCros(); |
| 45 | 45 |
| 46 static RemovableDeviceNotificationsCros* GetInstance(); | 46 static RemovableDeviceNotificationsCros* GetInstance(); |
| 47 | 47 |
| 48 virtual void DiskChanged(disks::DiskMountManagerEventType event, | 48 virtual void OnDiskEvent(disks::DiskMountManager::DiskEvent event, |
| 49 const disks::DiskMountManager::Disk* disk) OVERRIDE; | 49 const disks::DiskMountManager::Disk* disk) OVERRIDE; |
| 50 virtual void DeviceChanged(disks::DiskMountManagerEventType event, | 50 virtual void OnDeviceEvent(disks::DiskMountManager::DeviceEvent event, |
| 51 const std::string& device_path) OVERRIDE; | 51 const std::string& device_path) OVERRIDE; |
| 52 virtual void MountCompleted( | 52 virtual void OnMountEvent( |
| 53 disks::DiskMountManager::MountEvent event_type, | 53 disks::DiskMountManager::MountEvent event, |
| 54 MountError error_code, | 54 MountError error_code, |
| 55 const disks::DiskMountManager::MountPointInfo& mount_info) OVERRIDE; | 55 const disks::DiskMountManager::MountPointInfo& mount_info) OVERRIDE; |
| 56 virtual void OnFormatEvent(disks::DiskMountManager::FormatEvent event, |
| 57 FormatError error_code, |
| 58 const std::string& device_path) OVERRIDE; |
| 56 | 59 |
| 57 // Finds the device that contains |path| and populates |device_info|. | 60 // Finds the device that contains |path| and populates |device_info|. |
| 58 // Returns false if unable to find the device. | 61 // Returns false if unable to find the device. |
| 59 bool GetDeviceInfoForPath( | 62 bool GetDeviceInfoForPath( |
| 60 const FilePath& path, | 63 const FilePath& path, |
| 61 base::SystemMonitor::RemovableStorageInfo* device_info) const; | 64 base::SystemMonitor::RemovableStorageInfo* device_info) const; |
| 62 | 65 |
| 63 private: | 66 private: |
| 64 friend class base::RefCountedThreadSafe<RemovableDeviceNotificationsCros>; | 67 friend class base::RefCountedThreadSafe<RemovableDeviceNotificationsCros>; |
| 65 | 68 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 89 // Mapping of relevant mount points and their corresponding mount devices. | 92 // Mapping of relevant mount points and their corresponding mount devices. |
| 90 // Only accessed on the UI thread. | 93 // Only accessed on the UI thread. |
| 91 MountMap mount_map_; | 94 MountMap mount_map_; |
| 92 | 95 |
| 93 DISALLOW_COPY_AND_ASSIGN(RemovableDeviceNotificationsCros); | 96 DISALLOW_COPY_AND_ASSIGN(RemovableDeviceNotificationsCros); |
| 94 }; | 97 }; |
| 95 | 98 |
| 96 } // namespace chromeos | 99 } // namespace chromeos |
| 97 | 100 |
| 98 #endif // CHROME_BROWSER_SYSTEM_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_CHROMEOS
_H_ | 101 #endif // CHROME_BROWSER_SYSTEM_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_CHROMEOS
_H_ |
| OLD | NEW |