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

Unified Diff: chrome/browser/ui/webui/constrained_web_dialog_delegate_base.cc

Issue 541103002: Introduce ChromeZoomLevelPref, make zoom level prefs independent of profile prefs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/webui/constrained_web_dialog_delegate_base.cc
diff --git a/chrome/browser/ui/webui/constrained_web_dialog_delegate_base.cc b/chrome/browser/ui/webui/constrained_web_dialog_delegate_base.cc
index 1b7244dd14edd6951bcba44fbfb102c7d66ead7c..266e8cb6d1402e2bb73142665019e2c1c1438123 100644
--- a/chrome/browser/ui/webui/constrained_web_dialog_delegate_base.cc
+++ b/chrome/browser/ui/webui/constrained_web_dialog_delegate_base.cc
@@ -9,8 +9,10 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_preferences_util.h"
#include "chrome/browser/ui/webui/chrome_web_contents_handler.h"
+#include "content/public/browser/host_zoom_map.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/common/renderer_preferences.h"
#include "ipc/ipc_message.h"
#include "ui/web_dialogs/web_dialog_delegate.h"
#include "ui/web_dialogs/web_dialog_ui.h"
@@ -38,9 +40,15 @@ ConstrainedWebDialogDelegateBase::ConstrainedWebDialogDelegateBase(
} else {
web_contents_->SetDelegate(this);
}
+ content::RendererPreferences* prefs =
+ web_contents_->GetMutableRendererPrefs();
renderer_preferences_util::UpdateFromSystemSettings(
- web_contents_->GetMutableRendererPrefs(),
- Profile::FromBrowserContext(browser_context));
+ prefs, Profile::FromBrowserContext(browser_context));
+ // TODO(wjmaclean): Convert this to use the HostZoomMap for the WebContents
+ // when HostZoomMap moves to StoragePartition.
+ prefs->default_zoom_level = content::HostZoomMap::GetDefaultForBrowserContext(
+ browser_context)->GetDefaultZoomLevel();
+
web_contents_->GetRenderViewHost()->SyncRendererPrefs();
// Set |this| as a delegate so the ConstrainedWebDialogUI can retrieve it.

Powered by Google App Engine
This is Rietveld 408576698