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 #import "ui/message_center/cocoa/popup_controller.h" | 5 #import "ui/message_center/cocoa/popup_controller.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #import "base/mac/foundation_util.h" | 9 #import "base/mac/foundation_util.h" |
10 #import "base/mac/sdk_forward_declarations.h" | 10 #import "base/mac/sdk_forward_declarations.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 @implementation MCPopupController | 96 @implementation MCPopupController |
97 | 97 |
98 - (id)initWithNotification:(const message_center::Notification*)notification | 98 - (id)initWithNotification:(const message_center::Notification*)notification |
99 messageCenter:(message_center::MessageCenter*)messageCenter | 99 messageCenter:(message_center::MessageCenter*)messageCenter |
100 popupCollection:(MCPopupCollection*)popupCollection { | 100 popupCollection:(MCPopupCollection*)popupCollection { |
101 base::scoped_nsobject<MCPopupWindow> window( | 101 base::scoped_nsobject<MCPopupWindow> window( |
102 [[MCPopupWindow alloc] initWithContentRect:ui::kWindowSizeDeterminedLater | 102 [[MCPopupWindow alloc] initWithContentRect:ui::kWindowSizeDeterminedLater |
103 styleMask:NSBorderlessWindowMask | | 103 styleMask:NSBorderlessWindowMask | |
104 NSNonactivatingPanelMask | 104 NSNonactivatingPanelMask |
105 backing:NSBackingStoreBuffered | 105 backing:NSBackingStoreBuffered |
106 defer:YES]); | 106 defer:NO]); |
107 if ((self = [super initWithWindow:window])) { | 107 if ((self = [super initWithWindow:window])) { |
108 messageCenter_ = messageCenter; | 108 messageCenter_ = messageCenter; |
109 popupCollection_ = popupCollection; | 109 popupCollection_ = popupCollection; |
110 notificationController_.reset( | 110 notificationController_.reset( |
111 [[MCNotificationController alloc] initWithNotification:notification | 111 [[MCNotificationController alloc] initWithNotification:notification |
112 messageCenter:messageCenter_]); | 112 messageCenter:messageCenter_]); |
113 isClosing_ = NO; | 113 isClosing_ = NO; |
114 bounds_ = [[notificationController_ view] frame]; | 114 bounds_ = [[notificationController_ view] frame]; |
115 | 115 |
116 [window setReleasedWhenClosed:NO]; | 116 [window setReleasedWhenClosed:NO]; |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 | 290 |
291 - (void)mouseEntered:(NSEvent*)event { | 291 - (void)mouseEntered:(NSEvent*)event { |
292 messageCenter_->PausePopupTimers(); | 292 messageCenter_->PausePopupTimers(); |
293 } | 293 } |
294 | 294 |
295 - (void)mouseExited:(NSEvent*)event { | 295 - (void)mouseExited:(NSEvent*)event { |
296 messageCenter_->RestartPopupTimers(); | 296 messageCenter_->RestartPopupTimers(); |
297 } | 297 } |
298 | 298 |
299 @end | 299 @end |
OLD | NEW |