| 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_STORAGE_MONITOR_MAC_H_ | 5 #ifndef CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_MAC_H_ |
| 6 #define CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_MAC_H_ | 6 #define CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_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/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "chrome/browser/storage_monitor/storage_monitor.h" | 13 #include "chrome/browser/storage_monitor/storage_monitor.h" |
| 14 | 14 |
| 15 namespace chrome { | |
| 16 | |
| 17 class ImageCaptureDeviceManager; | 15 class ImageCaptureDeviceManager; |
| 18 | 16 |
| 19 // This class posts notifications to listeners when a new disk | 17 // This class posts notifications to listeners when a new disk |
| 20 // is attached, removed, or changed. | 18 // is attached, removed, or changed. |
| 21 class StorageMonitorMac : public StorageMonitor, | 19 class StorageMonitorMac : public StorageMonitor, |
| 22 public base::SupportsWeakPtr<StorageMonitorMac> { | 20 public base::SupportsWeakPtr<StorageMonitorMac> { |
| 23 public: | 21 public: |
| 24 enum UpdateType { | 22 enum UpdateType { |
| 25 UPDATE_DEVICE_ADDED, | 23 UPDATE_DEVICE_ADDED, |
| 26 UPDATE_DEVICE_CHANGED, | 24 UPDATE_DEVICE_CHANGED, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 StorageInfo* info) const; | 57 StorageInfo* info) const; |
| 60 | 58 |
| 61 base::ScopedCFTypeRef<DASessionRef> session_; | 59 base::ScopedCFTypeRef<DASessionRef> session_; |
| 62 // Maps disk bsd names to disk info objects. This map tracks all mountable | 60 // Maps disk bsd names to disk info objects. This map tracks all mountable |
| 63 // devices on the system, though only notifications for removable devices are | 61 // devices on the system, though only notifications for removable devices are |
| 64 // posted. | 62 // posted. |
| 65 std::map<std::string, StorageInfo> disk_info_map_; | 63 std::map<std::string, StorageInfo> disk_info_map_; |
| 66 | 64 |
| 67 int pending_disk_updates_; | 65 int pending_disk_updates_; |
| 68 | 66 |
| 69 scoped_ptr<chrome::ImageCaptureDeviceManager> image_capture_device_manager_; | 67 scoped_ptr<ImageCaptureDeviceManager> image_capture_device_manager_; |
| 70 | 68 |
| 71 DISALLOW_COPY_AND_ASSIGN(StorageMonitorMac); | 69 DISALLOW_COPY_AND_ASSIGN(StorageMonitorMac); |
| 72 }; | 70 }; |
| 73 | 71 |
| 74 } // namespace chrome | |
| 75 | |
| 76 #endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_MAC_H_ | 72 #endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_MAC_H_ |
| OLD | NEW |