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

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: Address suggestions. 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..4925a147b4ed42146d20c5779e7a8db6e214c985 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_normal_page =
+ 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, an error page or an interstitial page.
if (zoom_mode_ == ZOOM_MODE_DISABLED ||
- !web_contents()->GetRenderViewHost()->IsRenderViewLive())
+ !web_contents()->GetRenderViewHost()->IsRenderViewLive() ||
+ !is_normal_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