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 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; |