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

Unified Diff: chrome/browser/ui/browser_ui_prefs.cc

Issue 14622003: components: Move PrefRegistrySyncable into user_prefs namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/browser_ui_prefs.cc
diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_ui_prefs.cc
index 353a1cbef4841bd250841a6728eb1a0a7cb0dfb6..ddefee5ab2cacdbf8fdd32d38b6865848f70fc0a 100644
--- a/chrome/browser/ui/browser_ui_prefs.cc
+++ b/chrome/browser/ui/browser_ui_prefs.cc
@@ -20,16 +20,19 @@ void RegisterBrowserPrefs(PrefRegistrySimple* registry) {
first_run::FIRST_RUN_BUBBLE_DONT_SHOW);
}
-void RegisterBrowserUserPrefs(PrefRegistrySyncable* registry) {
- registry->RegisterBooleanPref(prefs::kHomePageChanged,
- false,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kHomePageIsNewTabPage,
- true,
- PrefRegistrySyncable::SYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kShowHomeButton,
- false,
- PrefRegistrySyncable::SYNCABLE_PREF);
+void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
+ registry->RegisterBooleanPref(
+ prefs::kHomePageChanged,
+ false,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kHomePageIsNewTabPage,
+ true,
+ user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kShowHomeButton,
+ false,
+ user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
#if defined(OS_MACOSX)
// This really belongs in platform code, but there's no good place to
// initialize it between the time when the AppController is created
@@ -39,123 +42,160 @@ void RegisterBrowserUserPrefs(PrefRegistrySyncable* registry) {
// late: we need the pref to be already initialized. Doing it here also saves
// us from having to hard-code pref registration in the several unit tests
// that use this preference.
- registry->RegisterBooleanPref(prefs::kShowUpdatePromotionInfoBar,
- true,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kShowUpdatePromotionInfoBar,
+ true,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
#endif
- registry->RegisterBooleanPref(prefs::kDeleteBrowsingHistory,
- true,
- PrefRegistrySyncable::SYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kDeleteDownloadHistory,
- true,
- PrefRegistrySyncable::SYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kDeleteCache,
- true,
- PrefRegistrySyncable::SYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kDeleteCookies,
- true,
- PrefRegistrySyncable::SYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kDeletePasswords,
- false,
- PrefRegistrySyncable::SYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kDeleteFormData,
- false,
- PrefRegistrySyncable::SYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kDeleteHostedAppsData,
- false,
- PrefRegistrySyncable::SYNCABLE_PREF);
- registry->RegisterIntegerPref(prefs::kDeleteTimePeriod,
- 0,
- PrefRegistrySyncable::SYNCABLE_PREF);
- registry->RegisterInt64Pref(prefs::kLastClearBrowsingDataTime,
- 0,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kCheckDefaultBrowser,
- true,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kDeleteBrowsingHistory,
+ true,
+ user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kDeleteDownloadHistory,
+ true,
+ user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kDeleteCache,
+ true,
+ user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kDeleteCookies,
+ true,
+ user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kDeletePasswords,
+ false,
+ user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kDeleteFormData,
+ false,
+ user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kDeleteHostedAppsData,
+ false,
+ user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
+ registry->RegisterIntegerPref(
+ prefs::kDeleteTimePeriod,
+ 0,
+ user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
+ registry->RegisterInt64Pref(
+ prefs::kLastClearBrowsingDataTime,
+ 0,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kCheckDefaultBrowser,
+ true,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
#if defined(OS_WIN)
// As with Mac-spacific code above, it should be in a platform-specific
// section somewhere, but there is no good place for it.
- registry->RegisterBooleanPref(prefs::kSuppressSwitchToMetroModeOnSetDefault,
- false,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kSuppressSwitchToMetroModeOnSetDefault,
+ false,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
#endif
- registry->RegisterBooleanPref(prefs::kShowOmniboxSearchHint,
- true,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kWebAppCreateOnDesktop,
- true,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kWebAppCreateInAppsMenu,
- true,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kWebAppCreateInQuickLaunchBar,
- true,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kEnableTranslate,
- true,
- PrefRegistrySyncable::SYNCABLE_PREF);
- registry->RegisterStringPref(prefs::kCloudPrintEmail,
- std::string(),
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kCloudPrintProxyEnabled,
- true,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kCloudPrintSubmitEnabled,
- true,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kDevToolsDisabled,
- false,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterIntegerPref(prefs::kDevToolsHSplitLocation,
- -1,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterIntegerPref(prefs::kDevToolsVSplitLocation,
- -1,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterDictionaryPref(prefs::kBrowserWindowPlacement,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterDictionaryPref(prefs::kPreferencesWindowPlacement,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kImportBookmarks,
- true,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kImportHistory,
- true,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kImportHomepage,
- true,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kImportSearchEngine,
- true,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kImportSavedPasswords,
- true,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kEnableDoNotTrack,
- false,
- PrefRegistrySyncable::SYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kShowOmniboxSearchHint,
+ true,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kWebAppCreateOnDesktop,
+ true,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kWebAppCreateInAppsMenu,
+ true,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kWebAppCreateInQuickLaunchBar,
+ true,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kEnableTranslate,
+ true,
+ user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
+ registry->RegisterStringPref(
+ prefs::kCloudPrintEmail,
+ std::string(),
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kCloudPrintProxyEnabled,
+ true,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kCloudPrintSubmitEnabled,
+ true,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kDevToolsDisabled,
+ false,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterIntegerPref(
+ prefs::kDevToolsHSplitLocation,
+ -1,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterIntegerPref(
+ prefs::kDevToolsVSplitLocation,
+ -1,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterDictionaryPref(
+ prefs::kBrowserWindowPlacement,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterDictionaryPref(
+ prefs::kPreferencesWindowPlacement,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kImportBookmarks,
+ true,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kImportHistory,
+ true,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kImportHomepage,
+ true,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kImportSearchEngine,
+ true,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kImportSavedPasswords,
+ true,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kEnableDoNotTrack,
+ false,
+ user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
// Dictionaries to keep track of default tasks in the file browser.
- registry->RegisterDictionaryPref(prefs::kDefaultTasksByMimeType,
- PrefRegistrySyncable::SYNCABLE_PREF);
- registry->RegisterDictionaryPref(prefs::kDefaultTasksBySuffix,
- PrefRegistrySyncable::SYNCABLE_PREF);
+ registry->RegisterDictionaryPref(
+ prefs::kDefaultTasksByMimeType,
+ user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
+ registry->RegisterDictionaryPref(
+ prefs::kDefaultTasksBySuffix,
+ user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
// We need to register the type of these preferences in order to query
// them even though they're only typically controlled via policy.
- registry->RegisterBooleanPref(prefs::kPluginsAllowOutdated,
- false,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kPluginsAlwaysAuthorize,
- false,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kClearPluginLSODataEnabled,
- true,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kHideWebStoreIcon,
- false,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kPluginsAllowOutdated,
+ false,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kPluginsAlwaysAuthorize,
+ false,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kClearPluginLSODataEnabled,
+ true,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kHideWebStoreIcon,
+ false,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
}
void RegisterAppPrefs(const std::string& app_name, Profile* profile) {
@@ -169,10 +209,11 @@ void RegisterAppPrefs(const std::string& app_name, Profile* profile) {
PrefService* prefs = profile->GetPrefs();
if (!prefs->FindPreference(window_pref.c_str())) {
// TODO(joi): Do all registration up front.
- scoped_refptr<PrefRegistrySyncable> registry(
- static_cast<PrefRegistrySyncable*>(prefs->DeprecatedGetPrefRegistry()));
- registry->RegisterDictionaryPref(window_pref.c_str(),
- PrefRegistrySyncable::UNSYNCABLE_PREF);
+ scoped_refptr<user_prefs::PrefRegistrySyncable> registry(
+ static_cast<user_prefs::PrefRegistrySyncable*>(
+ prefs->DeprecatedGetPrefRegistry()));
+ registry->RegisterDictionaryPref(
+ window_pref.c_str(), user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
}
}
« no previous file with comments | « chrome/browser/ui/browser_ui_prefs.h ('k') | chrome/browser/ui/cocoa/extensions/browser_actions_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698