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 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_GALLERY_WATCH_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_GALLERY_WATCH_MANAGER_H_ |
6 #define CHROME_BROWSER_MEDIA_GALLERIES_GALLERY_WATCH_MANAGER_H_ | 6 #define CHROME_BROWSER_MEDIA_GALLERIES_GALLERY_WATCH_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 const base::FilePath& path, | 118 const base::FilePath& path, |
119 const ResultCallback& callback, | 119 const ResultCallback& callback, |
120 bool success); | 120 bool success); |
121 | 121 |
122 // Called by FilePathWatcher on the UI thread on a change event for |path|. | 122 // Called by FilePathWatcher on the UI thread on a change event for |path|. |
123 void OnFilePathChanged(const base::FilePath& path, bool error); | 123 void OnFilePathChanged(const base::FilePath& path, bool error); |
124 | 124 |
125 // MediaGalleriesPreferences::GalleryChangeObserver implementation. | 125 // MediaGalleriesPreferences::GalleryChangeObserver implementation. |
126 virtual void OnPermissionRemoved(MediaGalleriesPreferences* pref, | 126 virtual void OnPermissionRemoved(MediaGalleriesPreferences* pref, |
127 const std::string& extension_id, | 127 const std::string& extension_id, |
128 MediaGalleryPrefId pref_id) OVERRIDE; | 128 MediaGalleryPrefId pref_id) override; |
129 virtual void OnGalleryRemoved(MediaGalleriesPreferences* pref, | 129 virtual void OnGalleryRemoved(MediaGalleriesPreferences* pref, |
130 MediaGalleryPrefId pref_id) OVERRIDE; | 130 MediaGalleryPrefId pref_id) override; |
131 | 131 |
132 // storage_monitor::RemovableStorageObserver implementation. | 132 // storage_monitor::RemovableStorageObserver implementation. |
133 virtual void OnRemovableStorageDetached( | 133 virtual void OnRemovableStorageDetached( |
134 const storage_monitor::StorageInfo& info) OVERRIDE; | 134 const storage_monitor::StorageInfo& info) override; |
135 | 135 |
136 // True if the we are already observing the storage monitor. | 136 // True if the we are already observing the storage monitor. |
137 bool storage_monitor_observed_; | 137 bool storage_monitor_observed_; |
138 | 138 |
139 // MediaGalleriesPreferences we are currently observing. | 139 // MediaGalleriesPreferences we are currently observing. |
140 std::set<MediaGalleriesPreferences*> observed_preferences_; | 140 std::set<MediaGalleriesPreferences*> observed_preferences_; |
141 | 141 |
142 // All registered watches, keyed by WatchOwner. | 142 // All registered watches, keyed by WatchOwner. |
143 WatchesMap watches_; | 143 WatchesMap watches_; |
144 | 144 |
145 // Reverse mapping of watched paths to the set of owning WatchOwners. | 145 // Reverse mapping of watched paths to the set of owning WatchOwners. |
146 WatchedPaths watched_paths_; | 146 WatchedPaths watched_paths_; |
147 | 147 |
148 // Things that want to hear about gallery changes. | 148 // Things that want to hear about gallery changes. |
149 ObserverMap observers_; | 149 ObserverMap observers_; |
150 | 150 |
151 // Helper that does the watches on the FILE thread. | 151 // Helper that does the watches on the FILE thread. |
152 scoped_ptr<FileWatchManager> watch_manager_; | 152 scoped_ptr<FileWatchManager> watch_manager_; |
153 | 153 |
154 base::WeakPtrFactory<GalleryWatchManager> weak_factory_; | 154 base::WeakPtrFactory<GalleryWatchManager> weak_factory_; |
155 | 155 |
156 DISALLOW_COPY_AND_ASSIGN(GalleryWatchManager); | 156 DISALLOW_COPY_AND_ASSIGN(GalleryWatchManager); |
157 }; | 157 }; |
158 | 158 |
159 #endif // CHROME_BROWSER_MEDIA_GALLERIES_GALLERY_WATCH_MANAGER_H_ | 159 #endif // CHROME_BROWSER_MEDIA_GALLERIES_GALLERY_WATCH_MANAGER_H_ |
OLD | NEW |