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

Unified Diff: chrome/browser/chrome_page_zoom.cc

Issue 98073015: <webview>: Support zoom in WebUI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix GTK Created 6 years, 11 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 | « no previous file | chrome/browser/ui/gtk/zoom_bubble_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_page_zoom.cc
diff --git a/chrome/browser/chrome_page_zoom.cc b/chrome/browser/chrome_page_zoom.cc
index ae596ce20db5314bbe9996d487c3c4d4d70a9498..8fb9cf928adcc30d760d0226c401bf8d6d790669 100644
--- a/chrome/browser/chrome_page_zoom.cc
+++ b/chrome/browser/chrome_page_zoom.cc
@@ -65,14 +65,13 @@ std::vector<double> PresetZoomLevels(double custom_level) {
}
void Zoom(content::WebContents* web_contents, content::PageZoom zoom) {
- content::RenderViewHost* host = web_contents->GetRenderViewHost();
double current_zoom_level = web_contents->GetZoomLevel();
double default_zoom_level =
Profile::FromBrowserContext(web_contents->GetBrowserContext())->
GetPrefs()->GetDouble(prefs::kDefaultZoomLevel);
if (zoom == content::PAGE_ZOOM_RESET) {
- host->SetZoomLevel(default_zoom_level);
+ web_contents->SetZoomLevel(default_zoom_level);
content::RecordAction(UserMetricsAction("ZoomNormal"));
return;
}
@@ -90,7 +89,7 @@ void Zoom(content::WebContents* web_contents, content::PageZoom zoom) {
if (content::ZoomValuesEqual(zoom_level, current_zoom_level))
continue;
if (zoom_level < current_zoom_level) {
- host->SetZoomLevel(zoom_level);
+ web_contents->SetZoomLevel(zoom_level);
content::RecordAction(UserMetricsAction("ZoomMinus"));
return;
}
@@ -105,7 +104,7 @@ void Zoom(content::WebContents* web_contents, content::PageZoom zoom) {
if (content::ZoomValuesEqual(zoom_level, current_zoom_level))
continue;
if (zoom_level > current_zoom_level) {
- host->SetZoomLevel(zoom_level);
+ web_contents->SetZoomLevel(zoom_level);
content::RecordAction(UserMetricsAction("ZoomPlus"));
return;
}
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/zoom_bubble_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698