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

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

Issue 609983002: Fix ZoomController crash on kiosk launching. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « no previous file | no next file » | 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 4925a147b4ed42146d20c5779e7a8db6e214c985..50fb694637c18442d72ce12516f2ff581e83706d 100644
--- a/chrome/browser/ui/zoom/zoom_controller.cc
+++ b/chrome/browser/ui/zoom/zoom_controller.cc
@@ -79,9 +79,10 @@ bool ZoomController::SetZoomLevel(double zoom_level) {
bool ZoomController::SetZoomLevelByExtension(
double zoom_level,
const scoped_refptr<const extensions::Extension>& extension) {
+ content::NavigationEntry* entry =
+ web_contents()->GetController().GetLastCommittedEntry();
bool is_normal_page =
- web_contents()->GetController().GetLastCommittedEntry()->GetPageType() ==
- content::PAGE_TYPE_NORMAL;
+ entry && entry->GetPageType() == content::PAGE_TYPE_NORMAL;
wjmaclean 2014/09/26 21:05:44 If there's no committed entry, what are we zooming
xiyuan 2014/09/26 21:39:37 If there is no committed entry, |is_normal_page| w
wjmaclean 2014/09/26 23:48:39 Sorry ... I realized shortly after I left the offi
// Cannot zoom in disabled mode. Also, don't allow changing zoom level on
// a crashed tab, an error page or an interstitial page.
if (zoom_mode_ == ZOOM_MODE_DISABLED ||
@@ -134,9 +135,6 @@ bool ZoomController::SetZoomLevelByExtension(
zoom_map->SetTemporaryZoomLevel(
render_process_id, render_view_id, zoom_level);
} else {
- content::NavigationEntry* entry =
- web_contents()->GetController().GetLastCommittedEntry();
-
if (!entry) {
last_extension_ = NULL;
return false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698