OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/notifications/notification_ui_manager_mac.h" | 5 #include "chrome/browser/notifications/notification_ui_manager_mac.h" |
6 | 6 |
7 #include "base/mac/cocoa_protocols.h" | 7 #include "base/mac/cocoa_protocols.h" |
8 #include "base/mac/mac_util.h" | 8 #include "base/mac/mac_util.h" |
9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
10 #include "chrome/browser/notifications/notification.h" | 10 #include "chrome/browser/notifications/notification.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 instance = impl = new NotificationUIManagerImpl(local_state); | 92 instance = impl = new NotificationUIManagerImpl(local_state); |
93 } | 93 } |
94 | 94 |
95 impl->Initialize(balloons); | 95 impl->Initialize(balloons); |
96 balloons->set_space_change_listener(impl); | 96 balloons->set_space_change_listener(impl); |
97 | 97 |
98 return instance; | 98 return instance; |
99 } | 99 } |
100 | 100 |
101 NotificationUIManagerMac::ControllerNotification::ControllerNotification( | 101 NotificationUIManagerMac::ControllerNotification::ControllerNotification( |
102 id<CrUserNotification> a_view, Notification* a_model) | 102 id<CrUserNotification> view, Notification* model) |
103 : view(a_view), | 103 : view(view), |
104 model(a_model) { | 104 model(model) { |
105 } | 105 } |
106 | 106 |
107 NotificationUIManagerMac::ControllerNotification::~ControllerNotification() { | 107 NotificationUIManagerMac::ControllerNotification::~ControllerNotification() { |
108 [view release]; | 108 [view release]; |
109 delete model; | 109 delete model; |
110 } | 110 } |
111 | 111 |
112 //////////////////////////////////////////////////////////////////////////////// | 112 //////////////////////////////////////////////////////////////////////////////// |
113 | 113 |
114 NotificationUIManagerMac::NotificationUIManagerMac(PrefService* local_state) | 114 NotificationUIManagerMac::NotificationUIManagerMac(PrefService* local_state) |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 notification->Click(); | 298 notification->Click(); |
299 } | 299 } |
300 | 300 |
301 - (BOOL)userNotificationCenter:(NSUserNotificationCenter*)center | 301 - (BOOL)userNotificationCenter:(NSUserNotificationCenter*)center |
302 shouldPresentNotification:(id<CrUserNotification>)nsNotification { | 302 shouldPresentNotification:(id<CrUserNotification>)nsNotification { |
303 // Always display notifications, regardless of whether the app is foreground. | 303 // Always display notifications, regardless of whether the app is foreground. |
304 return YES; | 304 return YES; |
305 } | 305 } |
306 | 306 |
307 @end | 307 @end |
OLD | NEW |