summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-05 01:09:07 +0000
committerrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-05 01:09:07 +0000
commit338bcfd75953ebc2c1fd0084ecae6693835425c6 (patch)
treec442e32bf0a56c4147efce4d1d3ed6c2a547ca8d /ui
parent6be7350a39f2f66ae5296fcaa3e6c7c69609ea56 (diff)
downloadchromium_src-338bcfd75953ebc2c1fd0084ecae6693835425c6.zip
chromium_src-338bcfd75953ebc2c1fd0084ecae6693835425c6.tar.gz
chromium_src-338bcfd75953ebc2c1fd0084ecae6693835425c6.tar.bz2
[Mac][MC] Apply NSNonactivatingPanelMask to the tray and popup windows.
This requires making the popups NSPanels instead of NSWindows. It also removes the global event monitor, since the system will now deliver -windowDidResignKey: when Chromium isn't the active app. R=sail@chromium.org BUG=243752, 243128 Review URL: https://chromiumcodereview.appspot.com/15969027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204111 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/message_center/cocoa/popup_controller.mm5
-rw-r--r--ui/message_center/cocoa/tray_controller.h4
-rw-r--r--ui/message_center/cocoa/tray_controller.mm15
3 files changed, 5 insertions, 19 deletions
diff --git a/ui/message_center/cocoa/popup_controller.mm b/ui/message_center/cocoa/popup_controller.mm
index e807ce7..ad312eb 100644
--- a/ui/message_center/cocoa/popup_controller.mm
+++ b/ui/message_center/cocoa/popup_controller.mm
@@ -30,7 +30,7 @@ enum {
// Window Subclass /////////////////////////////////////////////////////////////
-@interface MCPopupWindow : NSWindow {
+@interface MCPopupWindow : NSPanel {
// The cumulative X and Y scrollingDeltas since the -scrollWheel: event began.
NSPoint totalScrollDelta_;
}
@@ -99,7 +99,8 @@ enum {
popupCollection:(MCPopupCollection*)popupCollection {
scoped_nsobject<MCPopupWindow> window(
[[MCPopupWindow alloc] initWithContentRect:ui::kWindowSizeDeterminedLater
- styleMask:NSBorderlessWindowMask
+ styleMask:NSBorderlessWindowMask |
+ NSNonactivatingPanelMask
backing:NSBackingStoreBuffered
defer:YES]);
if ((self = [super initWithWindow:window])) {
diff --git a/ui/message_center/cocoa/tray_controller.h b/ui/message_center/cocoa/tray_controller.h
index 82cc5f3..622635a 100644
--- a/ui/message_center/cocoa/tray_controller.h
+++ b/ui/message_center/cocoa/tray_controller.h
@@ -26,10 +26,6 @@ MESSAGE_CENTER_EXPORT
// View controller that provides this window's content.
scoped_nsobject<MCTrayViewController> viewController_;
-
- // An event monitor that listens for clicks outside the tray window to cause
- // it to close.
- id clickEventMonitor_;
}
// Designated initializer.
diff --git a/ui/message_center/cocoa/tray_controller.mm b/ui/message_center/cocoa/tray_controller.mm
index abe07e3..d000efc 100644
--- a/ui/message_center/cocoa/tray_controller.mm
+++ b/ui/message_center/cocoa/tray_controller.mm
@@ -27,7 +27,8 @@
- (id)initWithMessageCenterTray:(message_center::MessageCenterTray*)tray {
scoped_nsobject<MCTrayWindow> window(
[[MCTrayWindow alloc] initWithContentRect:ui::kWindowSizeDeterminedLater
- styleMask:NSBorderlessWindowMask
+ styleMask:NSBorderlessWindowMask |
+ NSNonactivatingPanelMask
backing:NSBackingStoreBuffered
defer:NO]);
if ((self = [super initWithWindow:window])) {
@@ -43,23 +44,11 @@
NSView* contentView = [viewController_ view];
[window setFrame:[contentView frame] display:NO];
[window setContentView:contentView];
-
- // The global event monitor will close the tray in response to events
- // delivered to other applications, and -windowDidResignKey: will catch
- // events within the application.
- clickEventMonitor_ =
- [NSEvent addGlobalMonitorForEventsMatchingMask:NSLeftMouseDownMask |
- NSRightMouseDownMask |
- NSOtherMouseDownMask
- handler:^(NSEvent* event) {
- tray_->HideMessageCenterBubble();
- }];
}
return self;
}
- (void)dealloc {
- [NSEvent removeMonitor:clickEventMonitor_];
[super dealloc];
}