| 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 #include "chrome/browser/media_galleries/media_galleries_preferences.h" | 5 #include "chrome/browser/media_galleries/media_galleries_preferences.h" |
| 6 | 6 |
| 7 #include "base/i18n/time_formatting.h" | 7 #include "base/i18n/time_formatting.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 } | 820 } |
| 821 | 821 |
| 822 // static | 822 // static |
| 823 bool MediaGalleriesPreferences::APIHasBeenUsed(Profile* profile) { | 823 bool MediaGalleriesPreferences::APIHasBeenUsed(Profile* profile) { |
| 824 MediaGalleryPrefId current_id = | 824 MediaGalleryPrefId current_id = |
| 825 profile->GetPrefs()->GetUint64(prefs::kMediaGalleriesUniqueId); | 825 profile->GetPrefs()->GetUint64(prefs::kMediaGalleriesUniqueId); |
| 826 return current_id != kInvalidMediaGalleryPrefId + 1; | 826 return current_id != kInvalidMediaGalleryPrefId + 1; |
| 827 } | 827 } |
| 828 | 828 |
| 829 // static | 829 // static |
| 830 void MediaGalleriesPreferences::RegisterUserPrefs( | 830 void MediaGalleriesPreferences::RegisterProfilePrefs( |
| 831 user_prefs::PrefRegistrySyncable* registry) { | 831 user_prefs::PrefRegistrySyncable* registry) { |
| 832 registry->RegisterListPref(prefs::kMediaGalleriesRememberedGalleries, | 832 registry->RegisterListPref(prefs::kMediaGalleriesRememberedGalleries, |
| 833 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 833 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 834 registry->RegisterUint64Pref( | 834 registry->RegisterUint64Pref( |
| 835 prefs::kMediaGalleriesUniqueId, | 835 prefs::kMediaGalleriesUniqueId, |
| 836 kInvalidMediaGalleryPrefId + 1, | 836 kInvalidMediaGalleryPrefId + 1, |
| 837 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 837 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 838 } | 838 } |
| 839 | 839 |
| 840 void MediaGalleriesPreferences::SetGalleryPermissionInPrefs( | 840 void MediaGalleriesPreferences::SetGalleryPermissionInPrefs( |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 943 return extension_prefs_for_testing_; | 943 return extension_prefs_for_testing_; |
| 944 return extensions::ExtensionPrefs::Get(profile_); | 944 return extensions::ExtensionPrefs::Get(profile_); |
| 945 } | 945 } |
| 946 | 946 |
| 947 void MediaGalleriesPreferences::SetExtensionPrefsForTesting( | 947 void MediaGalleriesPreferences::SetExtensionPrefsForTesting( |
| 948 extensions::ExtensionPrefs* extension_prefs) { | 948 extensions::ExtensionPrefs* extension_prefs) { |
| 949 extension_prefs_for_testing_ = extension_prefs; | 949 extension_prefs_for_testing_ = extension_prefs; |
| 950 } | 950 } |
| 951 | 951 |
| 952 } // namespace chrome | 952 } // namespace chrome |
| OLD | NEW |