summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-13 22:06:55 +0000
committerrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-13 22:06:55 +0000
commitdff4b777ea1c6900be84f40a41c65a32bd95949a (patch)
tree2420e664eabd5432d4f135c8a2248236466ff754
parent21c211e07c342e7b6a8edbcbee23028bfd2b8703 (diff)
downloadchromium_src-dff4b777ea1c6900be84f40a41c65a32bd95949a.zip
chromium_src-dff4b777ea1c6900be84f40a41c65a32bd95949a.tar.gz
chromium_src-dff4b777ea1c6900be84f40a41c65a32bd95949a.tar.bz2
Merge 216100 "[Mac] NULL-check the ZoomController before derefer..."
> [Mac] NULL-check the ZoomController before dereferencing it. > > I cannot figure out how a WebContents can lack this TabHelper, but it's > apparently possible. The other platforms do this, too. > > BUG=254977 > TEST=? > > Review URL: https://chromiumcodereview.appspot.com/22415013 TBR=rsesek@chromium.org Review URL: https://codereview.chromium.org/23128003 git-svn-id: svn://svn.chromium.org/chrome/branches/1547/src@217357 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/cocoa/browser/zoom_bubble_controller.mm3
1 files changed, 3 insertions, 0 deletions
diff --git a/chrome/browser/ui/cocoa/browser/zoom_bubble_controller.mm b/chrome/browser/ui/cocoa/browser/zoom_bubble_controller.mm
index 0f2baa2..d1378da 100644
--- a/chrome/browser/ui/cocoa/browser/zoom_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/browser/zoom_bubble_controller.mm
@@ -129,6 +129,9 @@ void SetZoomBubbleAutoCloseDelayForTesting(NSTimeInterval time_interval) {
return; // NULL in tests.
ZoomController* zoomController = ZoomController::FromWebContents(contents_);
+ if (!zoomController)
+ return;
+
int percent = zoomController->zoom_percent();
NSString* string =
l10n_util::GetNSStringF(IDS_ZOOM_PERCENT, base::IntToString16(percent));