| 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 200 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 201 | 201 |
| 202 // Returns true if the media gallery preferences system has ever been used | 202 // Returns true if the media gallery preferences system has ever been used |
| 203 // for this profile. To be exact, it checks if a gallery has ever been added | 203 // for this profile. To be exact, it checks if a gallery has ever been added |
| 204 // (including defaults). | 204 // (including defaults). |
| 205 static bool APIHasBeenUsed(Profile* profile); | 205 static bool APIHasBeenUsed(Profile* profile); |
| 206 | 206 |
| 207 private: | 207 private: |
| 208 friend class MediaGalleriesPreferencesTest; | 208 friend class MediaGalleriesPreferencesTest; |
| 209 friend class MediaGalleriesPermissionsTest; | 209 friend class MediaGalleriesPermissionsTest; |
| 210 friend class MediaGalleriesPlatformAppBrowserTest; |
| 210 | 211 |
| 211 typedef std::map<std::string /*device id*/, MediaGalleryPrefIdSet> | 212 typedef std::map<std::string /*device id*/, MediaGalleryPrefIdSet> |
| 212 DeviceIdPrefIdsMap; | 213 DeviceIdPrefIdsMap; |
| 213 | 214 |
| 214 // Populates the default galleries if this is a fresh profile. | 215 // Populates the default galleries if this is a fresh profile. |
| 215 void AddDefaultGalleriesIfFreshProfile(); | 216 void AddDefaultGalleriesIfFreshProfile(); |
| 216 | 217 |
| 217 // This is a hack - Some devices (iTunes, Picasa) are singletons in that only | 218 // This is a hack - Some devices (iTunes, Picasa) are singletons in that only |
| 218 // one instance of that type is supported at a time. As such, the device id | 219 // one instance of that type is supported at a time. As such, the device id |
| 219 // should just be "itunes:" or "picasa:" but that would mean finding the | 220 // should just be "itunes:" or "picasa:" but that would mean finding the |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 // A mapping from device id to the set of gallery pref ids on that device. | 297 // A mapping from device id to the set of gallery pref ids on that device. |
| 297 // All pref ids in |device_map_| are also in |known_galleries_|. | 298 // All pref ids in |device_map_| are also in |known_galleries_|. |
| 298 DeviceIdPrefIdsMap device_map_; | 299 DeviceIdPrefIdsMap device_map_; |
| 299 | 300 |
| 300 ObserverList<GalleryChangeObserver> gallery_change_observers_; | 301 ObserverList<GalleryChangeObserver> gallery_change_observers_; |
| 301 | 302 |
| 302 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesPreferences); | 303 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesPreferences); |
| 303 }; | 304 }; |
| 304 | 305 |
| 305 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_PREFERENCES_H_ | 306 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_PREFERENCES_H_ |
| OLD | NEW |