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