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 | 13 |
14 class ChromeBrowserMainPartsLinux; | 14 class ChromeBrowserMainPartsLinux; |
15 class ChromeBrowserMainPartsMac; | 15 class ChromeBrowserMainPartsMac; |
16 class MediaGalleriesPrivateApiTest; | 16 class MediaGalleriesPrivateApiTest; |
17 class MediaGalleriesPrivateEjectApiTest; | 17 class MediaGalleriesPrivateEjectApiTest; |
18 | 18 |
19 namespace chrome { | 19 namespace chrome { |
20 | 20 |
21 class MediaFileSystemRegistryTest; | 21 class MediaFileSystemRegistryTest; |
22 class RemovableStorageObserver; | 22 class RemovableStorageObserver; |
23 class TransientDeviceIds; | 23 class TransientDeviceIds; |
24 | 24 |
25 // Base class for platform-specific instances watching for removable storage | 25 // Base class for platform-specific instances watching for removable storage |
26 // attachments/detachments. | 26 // attachments/detachments. |
| 27 // Lifecycle contracts: This class is created by ChromeBrowserMain |
| 28 // implementations before the profile is initialized, so listeners can be |
| 29 // created during profile construction. The platform-specific initialization, |
| 30 // which can lead to calling registered listeners with notifications of |
| 31 // attached volumes, will happen after profile construction. |
27 class StorageMonitor { | 32 class StorageMonitor { |
28 public: | 33 public: |
29 struct StorageInfo { | 34 struct StorageInfo { |
30 StorageInfo(); | 35 StorageInfo(); |
31 StorageInfo(const std::string& id, | 36 StorageInfo(const std::string& id, |
32 const string16& device_name, | 37 const string16& device_name, |
33 const base::FilePath::StringType& device_location); | 38 const base::FilePath::StringType& device_location); |
34 ~StorageInfo(); | 39 ~StorageInfo(); |
35 | 40 |
36 // Unique device id - persists between device attachments. | 41 // Unique device id - persists between device attachments. |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 | 165 |
161 // Map of all the attached removable storage devices. | 166 // Map of all the attached removable storage devices. |
162 RemovableStorageMap storage_map_; | 167 RemovableStorageMap storage_map_; |
163 | 168 |
164 scoped_ptr<TransientDeviceIds> transient_device_ids_; | 169 scoped_ptr<TransientDeviceIds> transient_device_ids_; |
165 }; | 170 }; |
166 | 171 |
167 } // namespace chrome | 172 } // namespace chrome |
168 | 173 |
169 #endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_H_ | 174 #endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_H_ |
OLD | NEW |