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_H_ | 5 #ifndef CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_H_ |
6 #define CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_H_ | 6 #define CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/observer_list_threadsafe.h" | 10 #include "base/observer_list_threadsafe.h" |
11 #include "base/string16.h" | 11 #include "base/string16.h" |
12 #include "base/synchronization/lock.h" | 12 #include "base/synchronization/lock.h" |
13 #include "chrome/browser/storage_monitor/storage_info.h" | 13 #include "chrome/browser/storage_monitor/storage_info.h" |
14 | 14 |
15 class ChromeBrowserMainPartsLinux; | 15 class ChromeBrowserMainPartsLinux; |
16 class ChromeBrowserMainPartsMac; | 16 class ChromeBrowserMainPartsMac; |
17 class MediaGalleriesPrivateApiTest; | 17 class MediaGalleriesPrivateApiTest; |
18 class MediaGalleriesPrivateEjectApiTest; | 18 class MediaGalleriesPrivateEjectApiTest; |
19 | 19 |
20 namespace chrome { | 20 namespace chrome { |
21 | 21 |
22 class MediaFileSystemRegistryTest; | 22 class MediaFileSystemRegistryTest; |
23 class RemovableStorageObserver; | 23 class RemovableStorageObserver; |
24 class TransientDeviceIds; | 24 class TransientDeviceIds; |
25 | 25 |
26 // Base class for platform-specific instances watching for removable storage | 26 // Base class for platform-specific instances watching for removable storage |
27 // attachments/detachments. | 27 // attachments/detachments. |
| 28 // Lifecycle contracts: This class is created by ChromeBrowserMain |
| 29 // implementations before the profile is initialized, so listeners can be |
| 30 // created during profile construction. The platform-specific initialization, |
| 31 // which can lead to calling registered listeners with notifications of |
| 32 // attached volumes, will happen after profile construction. |
28 class StorageMonitor { | 33 class StorageMonitor { |
29 public: | 34 public: |
30 // This interface is provided to generators of storage notifications. | 35 // This interface is provided to generators of storage notifications. |
31 class Receiver { | 36 class Receiver { |
32 public: | 37 public: |
33 virtual ~Receiver(); | 38 virtual ~Receiver(); |
34 | 39 |
35 virtual void ProcessAttach(const StorageInfo& info) = 0; | 40 virtual void ProcessAttach(const StorageInfo& info) = 0; |
36 virtual void ProcessDetach(const std::string& id) = 0; | 41 virtual void ProcessDetach(const std::string& id) = 0; |
37 }; | 42 }; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 130 |
126 // Map of all the attached removable storage devices. | 131 // Map of all the attached removable storage devices. |
127 RemovableStorageMap storage_map_; | 132 RemovableStorageMap storage_map_; |
128 | 133 |
129 scoped_ptr<TransientDeviceIds> transient_device_ids_; | 134 scoped_ptr<TransientDeviceIds> transient_device_ids_; |
130 }; | 135 }; |
131 | 136 |
132 } // namespace chrome | 137 } // namespace chrome |
133 | 138 |
134 #endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_H_ | 139 #endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_H_ |
OLD | NEW |