| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 const extensions::Extension& extension); | 266 const extensions::Extension& extension); |
| 267 | 267 |
| 268 // Returns true if the permission changed. Returns false if there was | 268 // Returns true if the permission changed. Returns false if there was |
| 269 // no change. | 269 // no change. |
| 270 bool SetGalleryPermissionForExtension(const extensions::Extension& extension, | 270 bool SetGalleryPermissionForExtension(const extensions::Extension& extension, |
| 271 MediaGalleryPrefId pref_id, | 271 MediaGalleryPrefId pref_id, |
| 272 bool has_permission); | 272 bool has_permission); |
| 273 | 273 |
| 274 const MediaGalleriesPrefInfoMap& known_galleries() const; | 274 const MediaGalleriesPrefInfoMap& known_galleries() const; |
| 275 | 275 |
| 276 // These keep track of when we last successfully completed a media scan. | |
| 277 // This is used to provide cached results when appropriate. | |
| 278 base::Time GetLastScanCompletionTime() const; | |
| 279 void SetLastScanCompletionTime(const base::Time& time); | |
| 280 | |
| 281 // KeyedService implementation: | 276 // KeyedService implementation: |
| 282 void Shutdown() override; | 277 void Shutdown() override; |
| 283 | 278 |
| 284 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 279 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 285 | 280 |
| 286 // Returns true if the media gallery preferences system has ever been used | 281 // Returns true if the media gallery preferences system has ever been used |
| 287 // for this profile. To be exact, it checks if a gallery has ever been added | 282 // for this profile. To be exact, it checks if a gallery has ever been added |
| 288 // (including defaults). | 283 // (including defaults). |
| 289 static bool APIHasBeenUsed(Profile* profile); | 284 static bool APIHasBeenUsed(Profile* profile); |
| 290 | 285 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 DeviceIdPrefIdsMap device_map_; | 392 DeviceIdPrefIdsMap device_map_; |
| 398 | 393 |
| 399 base::ObserverList<GalleryChangeObserver> gallery_change_observers_; | 394 base::ObserverList<GalleryChangeObserver> gallery_change_observers_; |
| 400 | 395 |
| 401 base::WeakPtrFactory<MediaGalleriesPreferences> weak_factory_; | 396 base::WeakPtrFactory<MediaGalleriesPreferences> weak_factory_; |
| 402 | 397 |
| 403 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesPreferences); | 398 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesPreferences); |
| 404 }; | 399 }; |
| 405 | 400 |
| 406 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_PREFERENCES_H_ | 401 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_PREFERENCES_H_ |
| OLD | NEW |