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

Side by Side Diff: chrome/browser/ui/zoom/zoom_controller.cc

Issue 529993002: Use IsRenderViewLive() to test for SadTab in ZoomController. (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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/zoom/zoom_controller_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/zoom/zoom_controller.h" 5 #include "chrome/browser/ui/zoom/zoom_controller.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "chrome/browser/chrome_notification_types.h" 8 #include "chrome/browser/chrome_notification_types.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/zoom/zoom_event_manager.h" 10 #include "chrome/browser/ui/zoom/zoom_event_manager.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 // An extension did not initiate this zoom change. 86 // An extension did not initiate this zoom change.
87 return SetZoomLevelByExtension(zoom_level, NULL); 87 return SetZoomLevelByExtension(zoom_level, NULL);
88 } 88 }
89 89
90 bool ZoomController::SetZoomLevelByExtension( 90 bool ZoomController::SetZoomLevelByExtension(
91 double zoom_level, 91 double zoom_level,
92 const scoped_refptr<const extensions::Extension>& extension) { 92 const scoped_refptr<const extensions::Extension>& extension) {
93 // Cannot zoom in disabled mode. Also, don't allow changing zoom level on 93 // Cannot zoom in disabled mode. Also, don't allow changing zoom level on
94 // a crashed tab. 94 // a crashed tab.
95 if (zoom_mode_ == ZOOM_MODE_DISABLED || 95 if (zoom_mode_ == ZOOM_MODE_DISABLED ||
96 !web_contents()->GetRenderProcessHost()->HasConnection()) 96 !web_contents()->GetRenderViewHost()->IsRenderViewLive())
Fady Samuel 2014/09/02 14:27:24 nit: indentation is off
wjmaclean 2014/09/02 14:42:54 Done.
97 return false; 97 return false;
98 98
99 // Store extension data so that |extension| can be attributed when the zoom 99 // Store extension data so that |extension| can be attributed when the zoom
100 // change completes. We expect that by the time this function returns that 100 // change completes. We expect that by the time this function returns that
101 // any observers that require this information will have requested it. 101 // any observers that require this information will have requested it.
102 last_extension_ = extension; 102 last_extension_ = extension;
103 103
104 // Do not actually rescale the page in manual mode. 104 // Do not actually rescale the page in manual mode.
105 if (zoom_mode_ == ZOOM_MODE_MANUAL) { 105 if (zoom_mode_ == ZOOM_MODE_MANUAL) {
106 double old_zoom_level = zoom_level_; 106 double old_zoom_level = zoom_level_;
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 } else { 298 } else {
299 // TODO(wjmaclean) Should we consider having HostZoomMap send both old and 299 // TODO(wjmaclean) Should we consider having HostZoomMap send both old and
300 // new zoom levels here? 300 // new zoom levels here?
301 double zoom_level = GetZoomLevel(); 301 double zoom_level = GetZoomLevel();
302 ZoomChangedEventData zoom_change_data( 302 ZoomChangedEventData zoom_change_data(
303 web_contents(), zoom_level, zoom_level, zoom_mode_, can_show_bubble); 303 web_contents(), zoom_level, zoom_level, zoom_mode_, can_show_bubble);
304 FOR_EACH_OBSERVER( 304 FOR_EACH_OBSERVER(
305 ZoomObserver, observers_, OnZoomChanged(zoom_change_data)); 305 ZoomObserver, observers_, OnZoomChanged(zoom_change_data));
306 } 306 }
307 } 307 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/zoom/zoom_controller_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698