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

Unified Diff: chrome/browser/ui/cocoa/browser/zoom_bubble_controller.mm

Issue 886883002: [OSX] Allow one zoom bubble to override another. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
Index: chrome/browser/ui/cocoa/browser/zoom_bubble_controller.mm
diff --git a/chrome/browser/ui/cocoa/browser/zoom_bubble_controller.mm b/chrome/browser/ui/cocoa/browser/zoom_bubble_controller.mm
index 234eb6d92827d1b22738ade1fe3a7921cbfe6ddc..05c9221a6f3caa69d83dc0136eb528dd24f0a3b9 100644
--- a/chrome/browser/ui/cocoa/browser/zoom_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/browser/zoom_bubble_controller.mm
@@ -75,6 +75,8 @@ void SetZoomBubbleAutoCloseDelayForTesting(NSTimeInterval time_interval) {
@implementation ZoomBubbleController
+@synthesize delegate = delegate_;
+
- (id)initWithParentWindow:(NSWindow*)parentWindow
delegate:(ZoomBubbleControllerDelegate*)delegate {
base::scoped_nsobject<InfoBubbleWindow> window(
@@ -126,6 +128,10 @@ void SetZoomBubbleAutoCloseDelayForTesting(NSTimeInterval time_interval) {
}
- (void)onZoomChanged {
+ // |delegate_| may be set null by this object's owner.
+ if (!delegate_)
+ return;
+
// TODO(shess): It may be appropriate to close the window if
// |contents| or |zoomController| are NULL. But they can be NULL in
// tests.
@@ -169,8 +175,11 @@ void SetZoomBubbleAutoCloseDelayForTesting(NSTimeInterval time_interval) {
}
- (void)windowWillClose:(NSNotification*)notification {
- delegate_->OnClose();
- delegate_ = NULL;
+ // |delegate_| may be set null by this object's owner.
+ if (delegate_) {
+ delegate_->OnClose();
+ delegate_ = NULL;
+ }
[NSObject cancelPreviousPerformRequestsWithTarget:self
selector:@selector(autoCloseBubble)
object:nil];
« no previous file with comments | « chrome/browser/ui/cocoa/browser/zoom_bubble_controller.h ('k') | chrome/browser/ui/cocoa/location_bar/zoom_decoration.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698