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

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

Issue 373323003: Cache the current WebPreferences on RenderViewHostImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix. Created 6 years, 5 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/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 0079bf9171b3817074b91aa566c0d259aaa4055e..a1d110b209528cd53630eac92e10c443e365ab87 100644
--- a/chrome/browser/ui/prefs/prefs_tab_helper.cc
+++ b/chrome/browser/ui/prefs/prefs_tab_helper.cc
@@ -57,6 +57,7 @@ const char* kPrefsToObserve[] = {
prefs::kWebKitFontScaleFactor,
prefs::kWebKitForceEnableZoom,
prefs::kWebKitPasswordEchoEnabled,
+ prefs::kWebKitPasswordEchoEnabled,
jam 2014/07/21 17:40:33 this is the same as above. did you mean to add som
chrishtr 2014/07/21 18:16:07 No, it's a dup. Fixed.
#endif
prefs::kWebKitJavascriptEnabled,
prefs::kWebKitJavaEnabled,
@@ -65,7 +66,18 @@ const char* kPrefsToObserve[] = {
prefs::kWebKitMinimumLogicalFontSize,
prefs::kWebKitPluginsEnabled,
prefs::kWebkitTabsToLinks,
- prefs::kWebKitUsesUniversalDetector
+ prefs::kWebKitUsesUniversalDetector,
+ prefs::kWebKitJavascriptCanOpenWindowsAutomatically,
+ prefs::kWebKitDomPasteEnabled,
+ prefs::kWebKitShrinksStandaloneImagesToFit,
+ prefs::kWebKitInspectorSettings,
+ prefs::kWebkitTabsToLinks,
+ prefs::kWebKitWebSecurityEnabled,
+ prefs::kDisable3DAPIs,
+ prefs::kWebKitUsesUniversalDetector,
+ prefs::kWebKitTextAreasAreResizable,
+ prefs::kEnableHyperlinkAuditing,
jam 2014/07/21 17:40:33 nit: it would be helpful to sort this list
chrishtr 2014/07/21 18:16:07 Done.
+
};
const int kPrefsToObserveLength = arraysize(kPrefsToObserve);
@@ -331,7 +343,6 @@ PrefsTabHelper::PrefsTabHelper(WebContents* contents)
pref_change_registrar_.Add(pref_name, webkit_callback);
}
-#if !defined(OS_ANDROID)
RegisterFontFamilyMapObserver(&pref_change_registrar_,
prefs::kWebKitStandardFontFamilyMap,
webkit_callback);
@@ -353,7 +364,6 @@ PrefsTabHelper::PrefsTabHelper(WebContents* contents)
RegisterFontFamilyMapObserver(&pref_change_registrar_,
prefs::kWebKitPictographFontFamilyMap,
webkit_callback);
-#endif // !defined(OS_ANDROID)
}
renderer_preferences_util::UpdateFromSystemSettings(
@@ -576,7 +586,7 @@ Profile* PrefsTabHelper::GetProfile() {
return Profile::FromBrowserContext(web_contents_->GetBrowserContext());
}
-void PrefsTabHelper::OnWebPrefChanged(const std::string& pref_name) {
+void PrefsTabHelper::OnFontFamilyPrefChanged(const std::string& pref_name) {
// When a font family pref's value goes from non-empty to the empty string, we
// must add it to the usual WebPreferences struct passed to the renderer.
//
@@ -604,6 +614,12 @@ void PrefsTabHelper::OnWebPrefChanged(const std::string& pref_name) {
return;
}
}
+}
+
+void PrefsTabHelper::OnWebPrefChanged(const std::string& pref_name) {
+#if !defined(OS_ANDROID)
+ OnFontFamilyPrefChanged(pref_name);
+#endif
- UpdateWebPreferences();
+ web_contents_->GetRenderViewHost()->OnWebkitPreferencesChanged();
}

Powered by Google App Engine
This is Rietveld 408576698