| 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> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
| 16 #include "base/string16.h" | 16 #include "base/string16.h" |
| 17 #include "base/time.h" | 17 #include "base/time.h" |
| 18 #include "chrome/browser/profiles/profile_keyed_service.h" | 18 #include "chrome/browser/profiles/profile_keyed_service.h" |
| 19 #include "chrome/browser/storage_monitor/removable_storage_observer.h" | 19 #include "chrome/browser/storage_monitor/removable_storage_observer.h" |
| 20 | 20 |
| 21 class PrefRegistrySyncable; | |
| 22 class Profile; | 21 class Profile; |
| 23 | 22 |
| 24 namespace base { | 23 namespace base { |
| 25 class DictionaryValue; | 24 class DictionaryValue; |
| 26 } | 25 } |
| 27 | 26 |
| 28 namespace extensions { | 27 namespace extensions { |
| 29 class Extension; | 28 class Extension; |
| 30 class ExtensionPrefs; | 29 class ExtensionPrefs; |
| 31 } | 30 } |
| 32 | 31 |
| 32 namespace user_prefs { |
| 33 class PrefRegistrySyncable; |
| 34 } |
| 35 |
| 33 namespace chrome { | 36 namespace chrome { |
| 34 | 37 |
| 35 typedef uint64 MediaGalleryPrefId; | 38 typedef uint64 MediaGalleryPrefId; |
| 36 const MediaGalleryPrefId kInvalidMediaGalleryPrefId = 0; | 39 const MediaGalleryPrefId kInvalidMediaGalleryPrefId = 0; |
| 37 | 40 |
| 38 struct MediaGalleryPermission { | 41 struct MediaGalleryPermission { |
| 39 MediaGalleryPrefId pref_id; | 42 MediaGalleryPrefId pref_id; |
| 40 bool has_permission; | 43 bool has_permission; |
| 41 }; | 44 }; |
| 42 | 45 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 MediaGalleryPrefId pref_id, | 186 MediaGalleryPrefId pref_id, |
| 184 bool has_permission); | 187 bool has_permission); |
| 185 | 188 |
| 186 const MediaGalleriesPrefInfoMap& known_galleries() const { | 189 const MediaGalleriesPrefInfoMap& known_galleries() const { |
| 187 return known_galleries_; | 190 return known_galleries_; |
| 188 } | 191 } |
| 189 | 192 |
| 190 // ProfileKeyedService implementation: | 193 // ProfileKeyedService implementation: |
| 191 virtual void Shutdown() OVERRIDE; | 194 virtual void Shutdown() OVERRIDE; |
| 192 | 195 |
| 193 static void RegisterUserPrefs(PrefRegistrySyncable* registry); | 196 static void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry); |
| 194 | 197 |
| 195 // Returns true if the media gallery preferences system has ever been used | 198 // Returns true if the media gallery preferences system has ever been used |
| 196 // for this profile. To be exact, it checks if a gallery has ever been added | 199 // for this profile. To be exact, it checks if a gallery has ever been added |
| 197 // (including defaults). | 200 // (including defaults). |
| 198 static bool APIHasBeenUsed(Profile* profile); | 201 static bool APIHasBeenUsed(Profile* profile); |
| 199 | 202 |
| 200 private: | 203 private: |
| 201 friend class MediaGalleriesPreferencesTest; | 204 friend class MediaGalleriesPreferencesTest; |
| 202 | 205 |
| 203 typedef std::map<std::string /*device id*/, MediaGalleryPrefIdSet> | 206 typedef std::map<std::string /*device id*/, MediaGalleryPrefIdSet> |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 DeviceIdPrefIdsMap device_map_; | 246 DeviceIdPrefIdsMap device_map_; |
| 244 | 247 |
| 245 ObserverList<GalleryChangeObserver> gallery_change_observers_; | 248 ObserverList<GalleryChangeObserver> gallery_change_observers_; |
| 246 | 249 |
| 247 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesPreferences); | 250 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesPreferences); |
| 248 }; | 251 }; |
| 249 | 252 |
| 250 } // namespace chrome | 253 } // namespace chrome |
| 251 | 254 |
| 252 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_PREFERENCES_H_ | 255 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_PREFERENCES_H_ |
| OLD | NEW |