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

Unified Diff: chrome/browser/ui/zoom/zoom_controller.cc

Issue 580133002: Update entry page type to include error pages when appropriate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revise comment, prevent trying to zoom interstitial pages as well. 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
« no previous file with comments | « chrome/browser/ssl/ssl_browser_tests.cc ('k') | chrome/browser/ui/zoom/zoom_controller_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/zoom/zoom_controller.cc
diff --git a/chrome/browser/ui/zoom/zoom_controller.cc b/chrome/browser/ui/zoom/zoom_controller.cc
index 95ab757f3f7d5bf75cc7c3956e7045ae7fb3afae..8248305d1a3bea0a6853b437fbc7f1b472975517 100644
--- a/chrome/browser/ui/zoom/zoom_controller.cc
+++ b/chrome/browser/ui/zoom/zoom_controller.cc
@@ -12,6 +12,7 @@
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/common/page_type.h"
#include "content/public/common/page_zoom.h"
#include "extensions/common/extension.h"
#include "grit/theme_resources.h"
@@ -78,10 +79,14 @@ bool ZoomController::SetZoomLevel(double zoom_level) {
bool ZoomController::SetZoomLevelByExtension(
double zoom_level,
const scoped_refptr<const extensions::Extension>& extension) {
+ bool is_error_or_interstitial_page =
Charlie Reis 2014/09/24 18:08:52 Let's invert and call this is_normal.
wjmaclean 2014/09/24 18:18:51 Done.
+ web_contents()->GetController().GetLastCommittedEntry()->GetPageType() !=
+ content::PAGE_TYPE_NORMAL;
// Cannot zoom in disabled mode. Also, don't allow changing zoom level on
- // a crashed tab.
+ // a crashed tab or an error page.
Charlie Reis 2014/09/24 18:08:52 nit: mention interstitials here as well (as the ot
wjmaclean 2014/09/24 18:18:51 Done.
if (zoom_mode_ == ZOOM_MODE_DISABLED ||
- !web_contents()->GetRenderViewHost()->IsRenderViewLive())
+ !web_contents()->GetRenderViewHost()->IsRenderViewLive() ||
+ is_error_or_interstitial_page)
return false;
// Store extension data so that |extension| can be attributed when the zoom
« no previous file with comments | « chrome/browser/ssl/ssl_browser_tests.cc ('k') | chrome/browser/ui/zoom/zoom_controller_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698