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_MEDIA_GALLERIES_MEDIA_GALLERIES_PREFERENCES_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_PREFERENCES_H_ |
6 #define CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_PREFERENCES_H_ | 6 #define CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_PREFERENCES_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 typedef std::map<MediaGalleryPrefId, MediaGalleryPrefInfo> | 108 typedef std::map<MediaGalleryPrefId, MediaGalleryPrefInfo> |
109 MediaGalleriesPrefInfoMap; | 109 MediaGalleriesPrefInfoMap; |
110 typedef std::set<MediaGalleryPrefId> MediaGalleryPrefIdSet; | 110 typedef std::set<MediaGalleryPrefId> MediaGalleryPrefIdSet; |
111 | 111 |
112 // A class to manage the media gallery preferences. There is one instance per | 112 // A class to manage the media gallery preferences. There is one instance per |
113 // user profile. | 113 // user profile. |
114 class MediaGalleriesPreferences : public ProfileKeyedService, | 114 class MediaGalleriesPreferences : public ProfileKeyedService, |
115 public RemovableStorageObserver { | 115 public RemovableStorageObserver { |
116 public: | 116 public: |
117 class GalleryChangeObserver { | 117 class GalleryChangeObserver { |
118 public: | 118 public: |
119 // |extension_id| specifies the extension affected by this change. | 119 // |extension_id| specifies the extension affected by this change. |
120 // It is empty if the gallery change affects all extensions. | 120 // It is empty if the gallery change affects all extensions. |
121 virtual void OnGalleryChanged(MediaGalleriesPreferences* pref, | 121 virtual void OnGalleryChanged(MediaGalleriesPreferences* pref, |
122 const std::string& extension_id) {} | 122 const std::string& extension_id) {} |
123 | 123 |
124 protected: | 124 protected: |
125 virtual ~GalleryChangeObserver(); | 125 virtual ~GalleryChangeObserver(); |
| 126 }; |
| 127 |
| 128 class Vendor { |
| 129 public: |
| 130 virtual MediaGalleriesPreferences* GetPreferences(Profile* profile) = 0; |
126 }; | 131 }; |
127 | 132 |
128 explicit MediaGalleriesPreferences(Profile* profile); | 133 explicit MediaGalleriesPreferences(Profile* profile); |
129 virtual ~MediaGalleriesPreferences(); | 134 virtual ~MediaGalleriesPreferences(); |
130 | 135 |
131 void AddGalleryChangeObserver(GalleryChangeObserver* observer); | 136 void AddGalleryChangeObserver(GalleryChangeObserver* observer); |
132 void RemoveGalleryChangeObserver(GalleryChangeObserver* observer); | 137 void RemoveGalleryChangeObserver(GalleryChangeObserver* observer); |
133 | 138 |
134 // RemovableStorageObserver implementation. | 139 // RemovableStorageObserver implementation. |
135 virtual void OnRemovableStorageAttached(const StorageInfo& info) OVERRIDE; | 140 virtual void OnRemovableStorageAttached(const StorageInfo& info) OVERRIDE; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 DeviceIdPrefIdsMap device_map_; | 251 DeviceIdPrefIdsMap device_map_; |
247 | 252 |
248 ObserverList<GalleryChangeObserver> gallery_change_observers_; | 253 ObserverList<GalleryChangeObserver> gallery_change_observers_; |
249 | 254 |
250 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesPreferences); | 255 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesPreferences); |
251 }; | 256 }; |
252 | 257 |
253 } // namespace chrome | 258 } // namespace chrome |
254 | 259 |
255 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_PREFERENCES_H_ | 260 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_PREFERENCES_H_ |
OLD | NEW |