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

Unified Diff: chrome/browser/chrome_page_zoom.cc

Issue 232773011: Zoom Extension API (work in progress) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Took callbacks, zoom modes, and observer stuff out of content, and reimplemented similar functional… Created 6 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/app/generated_resources.grd ('k') | chrome/browser/extensions/api/tabs/tabs_api.h » ('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 5c6c7c34f8ee16d800c9d7cc8425bb943d446b2e..1dfb24a41797b5ebf5deca75b493f1f4404e6cf9 100644
--- a/chrome/browser/chrome_page_zoom.cc
+++ b/chrome/browser/chrome_page_zoom.cc
@@ -10,6 +10,7 @@
#include "base/prefs/pref_service.h"
#include "chrome/browser/chrome_page_zoom_constants.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/zoom/zoom_controller.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/user_metrics.h"
@@ -70,8 +71,11 @@ void Zoom(content::WebContents* web_contents, content::PageZoom zoom) {
Profile::FromBrowserContext(web_contents->GetBrowserContext())->
GetPrefs()->GetDouble(prefs::kDefaultZoomLevel);
+ ZoomController* zoom_controller =
+ ZoomController::FromWebContents(web_contents);
+
if (zoom == content::PAGE_ZOOM_RESET) {
- web_contents->SetZoomLevel(default_zoom_level);
+ zoom_controller->SetZoomLevel(default_zoom_level);
content::RecordAction(UserMetricsAction("ZoomNormal"));
return;
}
@@ -89,7 +93,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) {
- web_contents->SetZoomLevel(zoom_level);
+ zoom_controller->SetZoomLevel(zoom_level);
content::RecordAction(UserMetricsAction("ZoomMinus"));
return;
}
@@ -104,7 +108,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) {
- web_contents->SetZoomLevel(zoom_level);
+ zoom_controller->SetZoomLevel(zoom_level);
content::RecordAction(UserMetricsAction("ZoomPlus"));
return;
}
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/extensions/api/tabs/tabs_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698