| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // StorageMonitorCros listens for mount point changes and notifies listeners | 5 // StorageMonitorCros listens for mount point changes and notifies listeners |
| 6 // about the addition and deletion of media devices. This class lives on the | 6 // about the addition and deletion of media devices. This class lives on the |
| 7 // UI thread. | 7 // UI thread. |
| 8 | 8 |
| 9 #ifndef COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_CHROMEOS_H_ | 9 #ifndef COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_CHROMEOS_H_ |
| 10 #define COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_CHROMEOS_H_ | 10 #define COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_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 <memory> | 17 #include <memory> |
| 18 #include <string> | 18 #include <string> |
| 19 | 19 |
| 20 #include "base/compiler_specific.h" | 20 #include "base/compiler_specific.h" |
| 21 #include "base/macros.h" | 21 #include "base/macros.h" |
| 22 #include "base/memory/weak_ptr.h" | 22 #include "base/memory/weak_ptr.h" |
| 23 #include "build/build_config.h" | 23 #include "build/build_config.h" |
| 24 #include "chromeos/disks/disk_mount_manager.h" | 24 #include "chromeos/disks/disk_mount_manager.h" |
| 25 #include "components/storage_monitor/storage_monitor.h" | 25 #include "components/storage_monitor/storage_monitor.h" |
| 26 | 26 |
| 27 namespace storage_monitor { | 27 namespace storage_monitor { |
| 28 | 28 |
| 29 class MediaTransferProtocolDeviceObserverLinux; | 29 class MediaTransferProtocolDeviceObserverChromeOS; |
| 30 | 30 |
| 31 class StorageMonitorCros : public StorageMonitor, | 31 class StorageMonitorCros : public StorageMonitor, |
| 32 public chromeos::disks::DiskMountManager::Observer { | 32 public chromeos::disks::DiskMountManager::Observer { |
| 33 public: | 33 public: |
| 34 // Should only be called by browser start up code. | 34 // Should only be called by browser start up code. |
| 35 // Use StorageMonitor::GetInstance() instead. | 35 // Use StorageMonitor::GetInstance() instead. |
| 36 StorageMonitorCros(); | 36 StorageMonitorCros(); |
| 37 ~StorageMonitorCros() override; | 37 ~StorageMonitorCros() override; |
| 38 | 38 |
| 39 // Sets up disk listeners and issues notifications for any discovered | 39 // Sets up disk listeners and issues notifications for any discovered |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // a DCIM folder. | 79 // a DCIM folder. |
| 80 void AddMountedPath( | 80 void AddMountedPath( |
| 81 const chromeos::disks::DiskMountManager::MountPointInfo& mount_info, | 81 const chromeos::disks::DiskMountManager::MountPointInfo& mount_info, |
| 82 bool has_dcim); | 82 bool has_dcim); |
| 83 | 83 |
| 84 // Mapping of relevant mount points and their corresponding mount devices. | 84 // Mapping of relevant mount points and their corresponding mount devices. |
| 85 MountMap mount_map_; | 85 MountMap mount_map_; |
| 86 | 86 |
| 87 std::unique_ptr<device::MediaTransferProtocolManager> | 87 std::unique_ptr<device::MediaTransferProtocolManager> |
| 88 media_transfer_protocol_manager_; | 88 media_transfer_protocol_manager_; |
| 89 std::unique_ptr<MediaTransferProtocolDeviceObserverLinux> | 89 std::unique_ptr<MediaTransferProtocolDeviceObserverChromeOS> |
| 90 media_transfer_protocol_device_observer_; | 90 media_transfer_protocol_device_observer_; |
| 91 | 91 |
| 92 base::WeakPtrFactory<StorageMonitorCros> weak_ptr_factory_; | 92 base::WeakPtrFactory<StorageMonitorCros> weak_ptr_factory_; |
| 93 | 93 |
| 94 DISALLOW_COPY_AND_ASSIGN(StorageMonitorCros); | 94 DISALLOW_COPY_AND_ASSIGN(StorageMonitorCros); |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 } // namespace storage_monitor | 97 } // namespace storage_monitor |
| 98 | 98 |
| 99 #endif // COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_CHROMEOS_H_ | 99 #endif // COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_CHROMEOS_H_ |
| OLD | NEW |