| 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 listeners about the addition and deletion of media | 6 // and notifies listeners about the addition and deletion of media |
| 7 // devices. | 7 // devices. |
| 8 | 8 |
| 9 #ifndef CHROME_BROWSER_STORAGE_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_CHROMEOS_H
_ | 9 #ifndef CHROME_BROWSER_STORAGE_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_CHROMEOS_H
_ |
| 10 #define CHROME_BROWSER_STORAGE_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_CHROMEOS_H
_ | 10 #define CHROME_BROWSER_STORAGE_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 "chrome/browser/storage_monitor/removable_storage_notifications.h" | 22 #include "chrome/browser/storage_monitor/removable_storage_notifications.h" |
| 23 #include "chromeos/disks/disk_mount_manager.h" | 23 #include "chromeos/disks/disk_mount_manager.h" |
| 24 | 24 |
| 25 namespace chrome { |
| 26 class MediaTransferProtocolDeviceObserverLinux; |
| 27 } |
| 28 |
| 25 namespace chromeos { | 29 namespace chromeos { |
| 26 | 30 |
| 27 class RemovableDeviceNotificationsCros | 31 class RemovableDeviceNotificationsCros |
| 28 : public chrome::RemovableStorageNotifications, | 32 : public chrome::RemovableStorageNotifications, |
| 29 public base::RefCountedThreadSafe<RemovableDeviceNotificationsCros>, | 33 public base::RefCountedThreadSafe<RemovableDeviceNotificationsCros>, |
| 30 public disks::DiskMountManager::Observer { | 34 public disks::DiskMountManager::Observer { |
| 31 public: | 35 public: |
| 32 // Should only be called by browser start up code. Use GetInstance() instead. | 36 // Should only be called by browser start up code. Use GetInstance() instead. |
| 33 RemovableDeviceNotificationsCros(); | 37 RemovableDeviceNotificationsCros(); |
| 34 | 38 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // device attach notification. |has_dcim| is true if the attached device has | 88 // device attach notification. |has_dcim| is true if the attached device has |
| 85 // a DCIM folder. | 89 // a DCIM folder. |
| 86 void AddMountedPathOnUIThread( | 90 void AddMountedPathOnUIThread( |
| 87 const disks::DiskMountManager::MountPointInfo& mount_info, | 91 const disks::DiskMountManager::MountPointInfo& mount_info, |
| 88 bool has_dcim); | 92 bool has_dcim); |
| 89 | 93 |
| 90 // Mapping of relevant mount points and their corresponding mount devices. | 94 // Mapping of relevant mount points and their corresponding mount devices. |
| 91 // Only accessed on the UI thread. | 95 // Only accessed on the UI thread. |
| 92 MountMap mount_map_; | 96 MountMap mount_map_; |
| 93 | 97 |
| 98 scoped_ptr<chrome::MediaTransferProtocolDeviceObserverLinux> |
| 99 media_transfer_protocol_device_observer_; |
| 100 |
| 94 DISALLOW_COPY_AND_ASSIGN(RemovableDeviceNotificationsCros); | 101 DISALLOW_COPY_AND_ASSIGN(RemovableDeviceNotificationsCros); |
| 95 }; | 102 }; |
| 96 | 103 |
| 97 } // namespace chromeos | 104 } // namespace chromeos |
| 98 | 105 |
| 99 #endif // CHROME_BROWSER_STORAGE_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_CHROMEO
S_H_ | 106 #endif // CHROME_BROWSER_STORAGE_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_CHROMEO
S_H_ |
| OLD | NEW |