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

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

Issue 952793002: Mac: Make ui/base/cocoa WindowAnimator Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git add Created 5 years, 10 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 | « chrome/browser/ui/app_list/app_list_service_mac.mm ('k') | chrome/browser/ui/cocoa/info_bubble_window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/base_bubble_controller.mm
diff --git a/chrome/browser/ui/cocoa/base_bubble_controller.mm b/chrome/browser/ui/cocoa/base_bubble_controller.mm
index c4f4cf19d93c9fb162300f13fa7923bc4213a0a7..e5a8a8a060d359315eb672cb9e880d62b2d1d3e9 100644
--- a/chrome/browser/ui/cocoa/base_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/base_bubble_controller.mm
@@ -17,6 +17,7 @@
#import "chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h"
@interface BaseBubbleController (Private)
+- (InfoBubbleWindow*)bubbleWindow;
- (void)registerForNotifications;
- (void)updateOriginFromAnchor;
- (void)activateTabWithContents:(content::WebContents*)newContents
@@ -114,6 +115,10 @@
[super dealloc];
}
+- (InfoBubbleWindow*)bubbleWindow {
+ return base::mac::ObjCCastStrict<InfoBubbleWindow>([self window]);
+}
+
- (void)registerForNotifications {
NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
// Watch to see if the parent window closes, and if so, close this one.
@@ -233,7 +238,7 @@
- (void)close {
[self closeCleanup];
- [super close];
+ [[self bubbleWindow] animateClose];
}
// The controller is the delegate of the window so it receives did resign key
@@ -259,17 +264,13 @@
// so disable sharing parent key state. Share parent key state is only used
// to enable the close/minimize/maximize buttons of the parent window when
// the bubble has key state, so disabling it here is safe.
- InfoBubbleWindow* bubbleWindow =
- base::mac::ObjCCastStrict<InfoBubbleWindow>([self window]);
- [bubbleWindow setAllowShareParentKeyState:NO];
+ [[self bubbleWindow] setAllowShareParentKeyState:NO];
}
- (void)windowDidBecomeKey:(NSNotification*)notification {
// Re-enable share parent key state to make sure the close/minimize/maximize
// buttons of the parent window are active.
- InfoBubbleWindow* bubbleWindow =
- base::mac::ObjCCastStrict<InfoBubbleWindow>([self window]);
- [bubbleWindow setAllowShareParentKeyState:YES];
+ [[self bubbleWindow] setAllowShareParentKeyState:YES];
}
// Since the bubble shares first responder with its parent window, set event
« no previous file with comments | « chrome/browser/ui/app_list/app_list_service_mac.mm ('k') | chrome/browser/ui/cocoa/info_bubble_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698