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

Unified Diff: chrome/browser/ui/prefs/prefs_tab_helper.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
« no previous file with comments | « chrome/browser/ui/prefs/prefs_tab_helper.h ('k') | chrome/browser/ui/startup/autolaunch_prompt.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/prefs/prefs_tab_helper.cc
diff --git a/chrome/browser/ui/prefs/prefs_tab_helper.cc b/chrome/browser/ui/prefs/prefs_tab_helper.cc
index ce05b8f14ec00a38a33a494d5b1b5b26cbebd33e..00727578d413d7f278cf10e2beceb69c6dffd01c 100644
--- a/chrome/browser/ui/prefs/prefs_tab_helper.cc
+++ b/chrome/browser/ui/prefs/prefs_tab_helper.cc
@@ -41,59 +41,75 @@ DEFINE_WEB_CONTENTS_USER_DATA_KEY(PrefsTabHelper);
namespace {
// Registers prefs only used for migration.
-void RegisterPrefsToMigrate(PrefRegistrySyncable* prefs) {
- prefs->RegisterLocalizedStringPref(prefs::kWebKitOldStandardFontFamily,
- IDS_STANDARD_FONT_FAMILY,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- prefs->RegisterLocalizedStringPref(prefs::kWebKitOldFixedFontFamily,
- IDS_FIXED_FONT_FAMILY,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- prefs->RegisterLocalizedStringPref(prefs::kWebKitOldSerifFontFamily,
- IDS_SERIF_FONT_FAMILY,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- prefs->RegisterLocalizedStringPref(prefs::kWebKitOldSansSerifFontFamily,
- IDS_SANS_SERIF_FONT_FAMILY,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- prefs->RegisterLocalizedStringPref(prefs::kWebKitOldCursiveFontFamily,
- IDS_CURSIVE_FONT_FAMILY,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- prefs->RegisterLocalizedStringPref(prefs::kWebKitOldFantasyFontFamily,
- IDS_FANTASY_FONT_FAMILY,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- prefs->RegisterLocalizedStringPref(prefs::kGlobalDefaultCharset,
- IDS_DEFAULT_ENCODING,
- PrefRegistrySyncable::SYNCABLE_PREF);
- prefs->RegisterLocalizedIntegerPref(prefs::kWebKitGlobalDefaultFontSize,
- IDS_DEFAULT_FONT_SIZE,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- prefs->RegisterLocalizedIntegerPref(prefs::kWebKitGlobalDefaultFixedFontSize,
- IDS_DEFAULT_FIXED_FONT_SIZE,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- prefs->RegisterLocalizedIntegerPref(prefs::kWebKitGlobalMinimumFontSize,
- IDS_MINIMUM_FONT_SIZE,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
+void RegisterPrefsToMigrate(user_prefs::PrefRegistrySyncable* prefs) {
+ prefs->RegisterLocalizedStringPref(
+ prefs::kWebKitOldStandardFontFamily,
+ IDS_STANDARD_FONT_FAMILY,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ prefs->RegisterLocalizedStringPref(
+ prefs::kWebKitOldFixedFontFamily,
+ IDS_FIXED_FONT_FAMILY,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ prefs->RegisterLocalizedStringPref(
+ prefs::kWebKitOldSerifFontFamily,
+ IDS_SERIF_FONT_FAMILY,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ prefs->RegisterLocalizedStringPref(
+ prefs::kWebKitOldSansSerifFontFamily,
+ IDS_SANS_SERIF_FONT_FAMILY,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ prefs->RegisterLocalizedStringPref(
+ prefs::kWebKitOldCursiveFontFamily,
+ IDS_CURSIVE_FONT_FAMILY,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ prefs->RegisterLocalizedStringPref(
+ prefs::kWebKitOldFantasyFontFamily,
+ IDS_FANTASY_FONT_FAMILY,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ prefs->RegisterLocalizedStringPref(
+ prefs::kGlobalDefaultCharset,
+ IDS_DEFAULT_ENCODING,
+ user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
+ prefs->RegisterLocalizedIntegerPref(
+ prefs::kWebKitGlobalDefaultFontSize,
+ IDS_DEFAULT_FONT_SIZE,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ prefs->RegisterLocalizedIntegerPref(
+ prefs::kWebKitGlobalDefaultFixedFontSize,
+ IDS_DEFAULT_FIXED_FONT_SIZE,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ prefs->RegisterLocalizedIntegerPref(
+ prefs::kWebKitGlobalMinimumFontSize,
+ IDS_MINIMUM_FONT_SIZE,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
prefs->RegisterLocalizedIntegerPref(
prefs::kWebKitGlobalMinimumLogicalFontSize,
IDS_MINIMUM_LOGICAL_FONT_SIZE,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- prefs->RegisterLocalizedStringPref(prefs::kWebKitGlobalStandardFontFamily,
- IDS_STANDARD_FONT_FAMILY,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- prefs->RegisterLocalizedStringPref(prefs::kWebKitGlobalFixedFontFamily,
- IDS_FIXED_FONT_FAMILY,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- prefs->RegisterLocalizedStringPref(prefs::kWebKitGlobalSerifFontFamily,
- IDS_SERIF_FONT_FAMILY,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- prefs->RegisterLocalizedStringPref(prefs::kWebKitGlobalSansSerifFontFamily,
- IDS_SANS_SERIF_FONT_FAMILY,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- prefs->RegisterLocalizedStringPref(prefs::kWebKitGlobalCursiveFontFamily,
- IDS_CURSIVE_FONT_FAMILY,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- prefs->RegisterLocalizedStringPref(prefs::kWebKitGlobalFantasyFontFamily,
- IDS_FANTASY_FONT_FAMILY,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ prefs->RegisterLocalizedStringPref(
+ prefs::kWebKitGlobalStandardFontFamily,
+ IDS_STANDARD_FONT_FAMILY,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ prefs->RegisterLocalizedStringPref(
+ prefs::kWebKitGlobalFixedFontFamily,
+ IDS_FIXED_FONT_FAMILY,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ prefs->RegisterLocalizedStringPref(
+ prefs::kWebKitGlobalSerifFontFamily,
+ IDS_SERIF_FONT_FAMILY,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ prefs->RegisterLocalizedStringPref(
+ prefs::kWebKitGlobalSansSerifFontFamily,
+ IDS_SANS_SERIF_FONT_FAMILY,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ prefs->RegisterLocalizedStringPref(
+ prefs::kWebKitGlobalCursiveFontFamily,
+ IDS_CURSIVE_FONT_FAMILY,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ prefs->RegisterLocalizedStringPref(
+ prefs::kWebKitGlobalFantasyFontFamily,
+ IDS_FANTASY_FONT_FAMILY,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
}
// The list of prefs we want to observe.
@@ -125,7 +141,7 @@ const int kPrefsToObserveLength = arraysize(kPrefsToObserve);
// "fonts.serif.Arab", "fonts.serif.Hang", etc. are registered.
// |fonts_with_defaults| contains all |pref_names| already registered since they
// have a specified default value.
-void RegisterFontFamilyPrefs(PrefRegistrySyncable* registry,
+void RegisterFontFamilyPrefs(user_prefs::PrefRegistrySyncable* registry,
const std::set<std::string>& fonts_with_defaults) {
// Expand the font concatenated with script name so this stays at RO memory
@@ -151,7 +167,9 @@ ALL_FONT_SCRIPTS(WEBKIT_WEBPREFS_FONTS_STANDARD)
// We haven't already set a default value for this font preference, so set
// an empty string as the default.
registry->RegisterStringPref(
- pref_name, std::string(), PrefRegistrySyncable::UNSYNCABLE_PREF);
+ pref_name,
+ std::string(),
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
}
}
}
@@ -477,72 +495,91 @@ void PrefsTabHelper::InitIncognitoUserPrefStore(
}
// static
-void PrefsTabHelper::RegisterUserPrefs(PrefRegistrySyncable* registry) {
+void PrefsTabHelper::RegisterUserPrefs(
+ user_prefs::PrefRegistrySyncable* registry) {
WebPreferences pref_defaults;
- registry->RegisterBooleanPref(prefs::kWebKitJavascriptEnabled,
- pref_defaults.javascript_enabled,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kWebKitWebSecurityEnabled,
- pref_defaults.web_security_enabled,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kWebKitJavascriptEnabled,
+ pref_defaults.javascript_enabled,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kWebKitWebSecurityEnabled,
+ pref_defaults.web_security_enabled,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kWebKitJavascriptCanOpenWindowsAutomatically,
true,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kWebKitLoadsImagesAutomatically,
- pref_defaults.loads_images_automatically,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kWebKitPluginsEnabled,
- pref_defaults.plugins_enabled,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kWebKitDomPasteEnabled,
- pref_defaults.dom_paste_enabled,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kWebKitShrinksStandaloneImagesToFit,
- pref_defaults.shrinks_standalone_images_to_fit,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterDictionaryPref(prefs::kWebKitInspectorSettings,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kWebKitTextAreasAreResizable,
- pref_defaults.text_areas_are_resizable,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kWebKitJavaEnabled,
- pref_defaults.java_enabled,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kWebkitTabsToLinks,
- pref_defaults.tabs_to_links,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kWebKitAllowRunningInsecureContent,
- false,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kWebKitAllowDisplayingInsecureContent,
- true,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kEnableReferrers,
- true,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kWebKitLoadsImagesAutomatically,
+ pref_defaults.loads_images_automatically,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kWebKitPluginsEnabled,
+ pref_defaults.plugins_enabled,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kWebKitDomPasteEnabled,
+ pref_defaults.dom_paste_enabled,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kWebKitShrinksStandaloneImagesToFit,
+ pref_defaults.shrinks_standalone_images_to_fit,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterDictionaryPref(
+ prefs::kWebKitInspectorSettings,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kWebKitTextAreasAreResizable,
+ pref_defaults.text_areas_are_resizable,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kWebKitJavaEnabled,
+ pref_defaults.java_enabled,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kWebkitTabsToLinks,
+ pref_defaults.tabs_to_links,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kWebKitAllowRunningInsecureContent,
+ false,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kWebKitAllowDisplayingInsecureContent,
+ true,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kEnableReferrers,
+ true,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
#if defined(OS_ANDROID)
- registry->RegisterDoublePref(prefs::kWebKitFontScaleFactor,
- pref_defaults.font_scale_factor,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kWebKitForceEnableZoom,
- pref_defaults.force_enable_zoom,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterDoublePref(
+ prefs::kWebKitFontScaleFactor,
+ pref_defaults.font_scale_factor,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterBooleanPref(
+ prefs::kWebKitForceEnableZoom,
+ pref_defaults.force_enable_zoom,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
#endif
#if !defined(OS_MACOSX)
- registry->RegisterLocalizedStringPref(prefs::kAcceptLanguages,
- IDS_ACCEPT_LANGUAGES,
- PrefRegistrySyncable::SYNCABLE_PREF);
+ registry->RegisterLocalizedStringPref(
+ prefs::kAcceptLanguages,
+ IDS_ACCEPT_LANGUAGES,
+ user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
#else
// Not used in OSX.
- registry->RegisterLocalizedStringPref(prefs::kAcceptLanguages,
- IDS_ACCEPT_LANGUAGES,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterLocalizedStringPref(
+ prefs::kAcceptLanguages,
+ IDS_ACCEPT_LANGUAGES,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
#endif
- registry->RegisterLocalizedStringPref(prefs::kDefaultCharset,
- IDS_DEFAULT_ENCODING,
- PrefRegistrySyncable::SYNCABLE_PREF);
+ registry->RegisterLocalizedStringPref(
+ prefs::kDefaultCharset,
+ IDS_DEFAULT_ENCODING,
+ user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
// Register font prefs that have defaults.
std::set<std::string> fonts_with_defaults;
@@ -567,7 +604,7 @@ void PrefsTabHelper::RegisterUserPrefs(PrefRegistrySyncable* registry) {
registry->RegisterLocalizedStringPref(
pref.pref_name,
pref.resource_id,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
fonts_with_defaults.insert(pref.pref_name);
}
}
@@ -575,28 +612,34 @@ void PrefsTabHelper::RegisterUserPrefs(PrefRegistrySyncable* registry) {
// Register font prefs that don't have defaults.
RegisterFontFamilyPrefs(registry, fonts_with_defaults);
- registry->RegisterLocalizedIntegerPref(prefs::kWebKitDefaultFontSize,
- IDS_DEFAULT_FONT_SIZE,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterLocalizedIntegerPref(prefs::kWebKitDefaultFixedFontSize,
- IDS_DEFAULT_FIXED_FONT_SIZE,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterLocalizedIntegerPref(prefs::kWebKitMinimumFontSize,
- IDS_MINIMUM_FONT_SIZE,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterLocalizedIntegerPref(
+ prefs::kWebKitDefaultFontSize,
+ IDS_DEFAULT_FONT_SIZE,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterLocalizedIntegerPref(
+ prefs::kWebKitDefaultFixedFontSize,
+ IDS_DEFAULT_FIXED_FONT_SIZE,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterLocalizedIntegerPref(
+ prefs::kWebKitMinimumFontSize,
+ IDS_MINIMUM_FONT_SIZE,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterLocalizedIntegerPref(
prefs::kWebKitMinimumLogicalFontSize,
IDS_MINIMUM_LOGICAL_FONT_SIZE,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterLocalizedBooleanPref(prefs::kWebKitUsesUniversalDetector,
- IDS_USES_UNIVERSAL_DETECTOR,
- PrefRegistrySyncable::SYNCABLE_PREF);
- registry->RegisterLocalizedStringPref(prefs::kStaticEncodings,
- IDS_STATIC_ENCODING_LIST,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterStringPref(prefs::kRecentlySelectedEncoding,
- std::string(),
- PrefRegistrySyncable::UNSYNCABLE_PREF);
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterLocalizedBooleanPref(
+ prefs::kWebKitUsesUniversalDetector,
+ IDS_USES_UNIVERSAL_DETECTOR,
+ user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
+ registry->RegisterLocalizedStringPref(
+ prefs::kStaticEncodings,
+ IDS_STATIC_ENCODING_LIST,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterStringPref(
+ prefs::kRecentlySelectedEncoding,
+ std::string(),
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
RegisterPrefsToMigrate(registry);
}
« no previous file with comments | « chrome/browser/ui/prefs/prefs_tab_helper.h ('k') | chrome/browser/ui/startup/autolaunch_prompt.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698