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 #ifndef CHROME_BROWSER_STORAGE_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_MAC_H_ | 5 #ifndef CHROME_BROWSER_STORAGE_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_MAC_H_ |
6 #define CHROME_BROWSER_STORAGE_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_MAC_H_ | 6 #define CHROME_BROWSER_STORAGE_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_MAC_H_ |
7 | 7 |
8 #include <DiskArbitration/DiskArbitration.h> | 8 #include <DiskArbitration/DiskArbitration.h> |
9 #include <map> | 9 #include <map> |
10 | 10 |
11 #include "base/mac/scoped_cftyperef.h" | 11 #include "base/mac/scoped_cftyperef.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "chrome/browser/storage_monitor/disk_info_mac.h" | 13 #include "chrome/browser/storage_monitor/disk_info_mac.h" |
14 #include "chrome/browser/storage_monitor/storage_monitor.h" | 14 #include "chrome/browser/storage_monitor/storage_monitor.h" |
15 | 15 |
16 namespace chrome { | 16 namespace chrome { |
17 | 17 |
| 18 class ImageCaptureDeviceManager; |
| 19 |
18 // This class posts notifications to listeners when a new disk | 20 // This class posts notifications to listeners when a new disk |
19 // is attached, removed, or changed. | 21 // is attached, removed, or changed. |
20 class RemovableDeviceNotificationsMac | 22 class RemovableDeviceNotificationsMac |
21 : public StorageMonitor, | 23 : public StorageMonitor, |
22 public base::RefCountedThreadSafe<RemovableDeviceNotificationsMac> { | 24 public base::RefCountedThreadSafe<RemovableDeviceNotificationsMac> { |
23 public: | 25 public: |
24 enum UpdateType { | 26 enum UpdateType { |
25 UPDATE_DEVICE_ADDED, | 27 UPDATE_DEVICE_ADDED, |
26 UPDATE_DEVICE_CHANGED, | 28 UPDATE_DEVICE_CHANGED, |
27 UPDATE_DEVICE_REMOVED, | 29 UPDATE_DEVICE_REMOVED, |
(...skipping 26 matching lines...) Expand all Loading... |
54 bool ShouldPostNotificationForDisk(const DiskInfoMac& info) const; | 56 bool ShouldPostNotificationForDisk(const DiskInfoMac& info) const; |
55 bool FindDiskWithMountPoint(const base::FilePath& mount_point, | 57 bool FindDiskWithMountPoint(const base::FilePath& mount_point, |
56 DiskInfoMac* info) const; | 58 DiskInfoMac* info) const; |
57 | 59 |
58 base::mac::ScopedCFTypeRef<DASessionRef> session_; | 60 base::mac::ScopedCFTypeRef<DASessionRef> session_; |
59 // Maps disk bsd names to disk info objects. This map tracks all mountable | 61 // Maps disk bsd names to disk info objects. This map tracks all mountable |
60 // devices on the system though only notifications for removable devices are | 62 // devices on the system though only notifications for removable devices are |
61 // posted. | 63 // posted. |
62 std::map<std::string, DiskInfoMac> disk_info_map_; | 64 std::map<std::string, DiskInfoMac> disk_info_map_; |
63 | 65 |
| 66 scoped_ptr<chrome::ImageCaptureDeviceManager> image_capture_device_manager_; |
| 67 |
64 DISALLOW_COPY_AND_ASSIGN(RemovableDeviceNotificationsMac); | 68 DISALLOW_COPY_AND_ASSIGN(RemovableDeviceNotificationsMac); |
65 }; | 69 }; |
66 | 70 |
67 } // namespace chrome | 71 } // namespace chrome |
68 | 72 |
69 #endif // CHROME_BROWSER_STORAGE_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_MAC_H_ | 73 #endif // CHROME_BROWSER_STORAGE_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_MAC_H_ |
OLD | NEW |