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

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: Set page type, fix tests. 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/zoom/zoom_controller.cc
diff --git a/chrome/browser/ui/zoom/zoom_controller.cc b/chrome/browser/ui/zoom/zoom_controller.cc
index 95ab757f3f7d5bf75cc7c3956e7045ae7fb3afae..45b087588422f4aa7e43ecaff35b2339ffb9538f 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_page =
+ web_contents()->GetController().GetLastCommittedEntry()->GetPageType() ==
+ content::PAGE_TYPE_ERROR;
// Cannot zoom in disabled mode. Also, don't allow changing zoom level on
- // a crashed tab.
+ // a crashed tab or an error page.
if (zoom_mode_ == ZOOM_MODE_DISABLED ||
- !web_contents()->GetRenderViewHost()->IsRenderViewLive())
+ !web_contents()->GetRenderViewHost()->IsRenderViewLive() ||
+ is_error_page)
return false;
// Store extension data so that |extension| can be attributed when the zoom

Powered by Google App Engine
This is Rietveld 408576698