OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef UI_MESSAGE_CENTER_COCOA_TRAY_CONTROLLER_H_ | 5 #ifndef UI_MESSAGE_CENTER_COCOA_TRAY_CONTROLLER_H_ |
6 #define UI_MESSAGE_CENTER_COCOA_TRAY_CONTROLLER_H_ | 6 #define UI_MESSAGE_CENTER_COCOA_TRAY_CONTROLLER_H_ |
7 | 7 |
8 #import <AppKit/AppKit.h> | 8 #import <AppKit/AppKit.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/scoped_nsobject.h" | 11 #include "base/memory/scoped_nsobject.h" |
12 #include "ui/message_center/message_center_export.h" | 12 #include "ui/message_center/message_center_export.h" |
13 | 13 |
14 @class MCTrayViewController; | 14 @class MCTrayViewController; |
15 | 15 |
16 namespace message_center { | 16 namespace message_center { |
17 class MessageCenterTray; | 17 class MessageCenterTray; |
18 } | 18 } |
19 | 19 |
20 // The window controller for the message center tray. This merely hosts the | 20 // The window controller for the message center tray. This merely hosts the |
21 // view from MCTrayViewController. | 21 // view from MCTrayViewController. |
22 MESSAGE_CENTER_EXPORT | 22 MESSAGE_CENTER_EXPORT |
23 @interface MCTrayController : NSWindowController<NSWindowDelegate> { | 23 @interface MCTrayController : NSWindowController<NSWindowDelegate> { |
24 @private | 24 @private |
25 message_center::MessageCenterTray* tray_; // Weak, indirectly owns this. | 25 message_center::MessageCenterTray* tray_; // Weak, indirectly owns this. |
26 | 26 |
27 // View controller that provides this window's content. | 27 // View controller that provides this window's content. |
28 scoped_nsobject<MCTrayViewController> viewController_; | 28 scoped_nsobject<MCTrayViewController> viewController_; |
| 29 |
| 30 // An event monitor that listens for clicks outside the tray window to cause |
| 31 // it to close. |
| 32 id clickEventMonitor_; |
29 } | 33 } |
30 | 34 |
31 // Designated initializer. | 35 // Designated initializer. |
32 - (id)initWithMessageCenterTray:(message_center::MessageCenterTray*)tray; | 36 - (id)initWithMessageCenterTray:(message_center::MessageCenterTray*)tray; |
33 | 37 |
34 // Opens the message center tray with the window's upper-left corner at |point|. | 38 // Opens the message center tray with the window's upper-left corner at |point|. |
35 - (void)showTrayAt:(NSPoint)point; | 39 - (void)showTrayAt:(NSPoint)point; |
36 | 40 |
37 // Callback from MessageCenterTrayDelegate, used to update the tray content. | 41 // Callback from MessageCenterTrayDelegate, used to update the tray content. |
38 - (void)onMessageCenterTrayChanged; | 42 - (void)onMessageCenterTrayChanged; |
39 | 43 |
40 @end | 44 @end |
41 | 45 |
42 #endif // UI_MESSAGE_CENTER_COCOA_TRAY_CONTROLLER_H_ | 46 #endif // UI_MESSAGE_CENTER_COCOA_TRAY_CONTROLLER_H_ |
OLD | NEW |