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

Unified Diff: chrome/browser/ui/prefs/prefs_tab_helper.cc

Issue 9015012: Get rid of trivial IncognitoUserPrefStore and PerTabUserPrefStore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved overlay prefs registration code to prefs_tab_helper Created 8 years, 12 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/chrome_browser.gypi » ('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 47ea5d8c69251ac7cf155a695f53d2b282a50f52..02a1ed72309e2101a2edc374af028d45438293a0 100644
--- a/chrome/browser/ui/prefs/prefs_tab_helper.cc
+++ b/chrome/browser/ui/prefs/prefs_tab_helper.cc
@@ -8,6 +8,7 @@
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/prefs/overlay_user_pref_store.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_preferences_util.h"
@@ -366,6 +367,70 @@ PrefsTabHelper::~PrefsTabHelper() {
}
// static
+void PrefsTabHelper::InitIncognitoUserPrefStore(
+ OverlayUserPrefStore* pref_store) {
+ // List of keys that cannot be changed in the user prefs file by the incognito
+ // profile. All preferences that store information about the browsing history
+ // or behavior of the user should have this property.
+ pref_store->RegisterOverlayPref(prefs::kBrowserWindowPlacement);
+}
+
+// static
+void PrefsTabHelper::InitPerTabUserPrefStore(
+ OverlayUserPrefStore* pref_store) {
+ // List of keys that have per-tab and per-profile (Global) counterpart.
+ // Setting a per-profile preference affects all tabs sharing the profile,
+ // unless a tab has specified its own per-tab property value. Changing a
+ // per-profile preference on a per-tab pref store delegates to underlay
Peter Kasting 2012/01/05 17:23:43 Nit: "underlay" -> "the underlying"
mnaganov (inactive) 2012/01/05 17:31:30 Done.
+ // per-profile pref store.
+ pref_store->RegisterOverlayPref(
+ prefs::kWebKitJavascriptEnabled,
+ prefs::kWebKitGlobalJavascriptEnabled);
+ pref_store->RegisterOverlayPref(
+ prefs::kWebKitJavascriptCanOpenWindowsAutomatically,
+ prefs::kWebKitGlobalJavascriptCanOpenWindowsAutomatically);
+ pref_store->RegisterOverlayPref(
+ prefs::kWebKitLoadsImagesAutomatically,
+ prefs::kWebKitGlobalLoadsImagesAutomatically);
+ pref_store->RegisterOverlayPref(
+ prefs::kWebKitPluginsEnabled,
+ prefs::kWebKitGlobalPluginsEnabled);
+ pref_store->RegisterOverlayPref(
+ prefs::kDefaultCharset,
+ prefs::kGlobalDefaultCharset);
+ pref_store->RegisterOverlayPref(
+ prefs::kWebKitStandardFontFamily,
+ prefs::kWebKitGlobalStandardFontFamily);
+ pref_store->RegisterOverlayPref(
+ prefs::kWebKitFixedFontFamily,
+ prefs::kWebKitGlobalFixedFontFamily);
+ pref_store->RegisterOverlayPref(
+ prefs::kWebKitSerifFontFamily,
+ prefs::kWebKitGlobalSerifFontFamily);
+ pref_store->RegisterOverlayPref(
+ prefs::kWebKitSansSerifFontFamily,
+ prefs::kWebKitGlobalSansSerifFontFamily);
+ pref_store->RegisterOverlayPref(
+ prefs::kWebKitCursiveFontFamily,
+ prefs::kWebKitGlobalCursiveFontFamily);
+ pref_store->RegisterOverlayPref(
+ prefs::kWebKitFantasyFontFamily,
+ prefs::kWebKitGlobalFantasyFontFamily);
+ pref_store->RegisterOverlayPref(
+ prefs::kWebKitDefaultFontSize,
+ prefs::kWebKitGlobalDefaultFontSize);
+ pref_store->RegisterOverlayPref(
+ prefs::kWebKitDefaultFixedFontSize,
+ prefs::kWebKitGlobalDefaultFixedFontSize);
+ pref_store->RegisterOverlayPref(
+ prefs::kWebKitMinimumFontSize,
+ prefs::kWebKitGlobalMinimumFontSize);
+ pref_store->RegisterOverlayPref(
+ prefs::kWebKitMinimumLogicalFontSize,
+ prefs::kWebKitGlobalMinimumLogicalFontSize);
+}
+
+// static
void PrefsTabHelper::RegisterUserPrefs(PrefService* prefs) {
WebPreferences pref_defaults;
prefs->RegisterBooleanPref(prefs::kWebKitGlobalJavascriptEnabled,
« no previous file with comments | « chrome/browser/ui/prefs/prefs_tab_helper.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698