Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: chrome/browser/media_galleries/media_galleries_preferences.cc

Issue 1102733002: Remove most occurences of PrefRegistrySyncable::UNSYNCABLE_PREF (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prefs-add-reg-funcs
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "chrome/browser/media_galleries/media_galleries_preferences.h" 5 #include "chrome/browser/media_galleries/media_galleries_preferences.h"
6 6
7 #include "base/base_paths_posix.h" 7 #include "base/base_paths_posix.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/i18n/time_formatting.h" 9 #include "base/i18n/time_formatting.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after
1308 // static 1308 // static
1309 bool MediaGalleriesPreferences::APIHasBeenUsed(Profile* profile) { 1309 bool MediaGalleriesPreferences::APIHasBeenUsed(Profile* profile) {
1310 MediaGalleryPrefId current_id = 1310 MediaGalleryPrefId current_id =
1311 profile->GetPrefs()->GetUint64(prefs::kMediaGalleriesUniqueId); 1311 profile->GetPrefs()->GetUint64(prefs::kMediaGalleriesUniqueId);
1312 return current_id != kInvalidMediaGalleryPrefId + 1; 1312 return current_id != kInvalidMediaGalleryPrefId + 1;
1313 } 1313 }
1314 1314
1315 // static 1315 // static
1316 void MediaGalleriesPreferences::RegisterProfilePrefs( 1316 void MediaGalleriesPreferences::RegisterProfilePrefs(
1317 user_prefs::PrefRegistrySyncable* registry) { 1317 user_prefs::PrefRegistrySyncable* registry) {
1318 registry->RegisterListPref(prefs::kMediaGalleriesRememberedGalleries, 1318 registry->RegisterListPref(prefs::kMediaGalleriesRememberedGalleries);
1319 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 1319 registry->RegisterUint64Pref(prefs::kMediaGalleriesUniqueId,
1320 registry->RegisterUint64Pref( 1320 kInvalidMediaGalleryPrefId + 1);
1321 prefs::kMediaGalleriesUniqueId, 1321 registry->RegisterInt64Pref(prefs::kMediaGalleriesLastScanTime,
1322 kInvalidMediaGalleryPrefId + 1, 1322 base::Time().ToInternalValue());
1323 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
1324 registry->RegisterInt64Pref(
1325 prefs::kMediaGalleriesLastScanTime,
1326 base::Time().ToInternalValue(),
1327 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
1328 } 1323 }
1329 1324
1330 bool MediaGalleriesPreferences::SetGalleryPermissionInPrefs( 1325 bool MediaGalleriesPreferences::SetGalleryPermissionInPrefs(
1331 const std::string& extension_id, 1326 const std::string& extension_id,
1332 MediaGalleryPrefId gallery_id, 1327 MediaGalleryPrefId gallery_id,
1333 bool has_access) { 1328 bool has_access) {
1334 DCHECK(IsInitialized()); 1329 DCHECK(IsInitialized());
1335 ExtensionPrefs::ScopedListUpdate update(GetExtensionPrefs(), 1330 ExtensionPrefs::ScopedListUpdate update(GetExtensionPrefs(),
1336 extension_id, 1331 extension_id,
1337 kMediaGalleriesPermissions); 1332 kMediaGalleriesPermissions);
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1443 if (extension_prefs_for_testing_) 1438 if (extension_prefs_for_testing_)
1444 return extension_prefs_for_testing_; 1439 return extension_prefs_for_testing_;
1445 return extensions::ExtensionPrefs::Get(profile_); 1440 return extensions::ExtensionPrefs::Get(profile_);
1446 } 1441 }
1447 1442
1448 void MediaGalleriesPreferences::SetExtensionPrefsForTesting( 1443 void MediaGalleriesPreferences::SetExtensionPrefsForTesting(
1449 extensions::ExtensionPrefs* extension_prefs) { 1444 extensions::ExtensionPrefs* extension_prefs) {
1450 DCHECK(IsInitialized()); 1445 DCHECK(IsInitialized());
1451 extension_prefs_for_testing_ = extension_prefs; 1446 extension_prefs_for_testing_ = extension_prefs;
1452 } 1447 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698