Chromium Code Reviews| 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 |