OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <AppKit/AppKit.h> | 5 #import <AppKit/AppKit.h> |
6 | 6 |
7 #import "chrome/browser/ui/cocoa/notifications/notification_service_delegate.h" | 7 #import "chrome/browser/ui/cocoa/notifications/notification_service_delegate.h" |
8 | 8 |
9 #include "base/mac/scoped_nsobject.h" | 9 #include "base/mac/scoped_nsobject.h" |
10 #import "chrome/browser/ui/cocoa/notifications/alert_notification_service.h" | 10 #import "chrome/browser/ui/cocoa/notifications/alert_notification_service.h" |
11 #import "chrome/browser/ui/cocoa/notifications/notification_delivery.h" | 11 #import "chrome/browser/ui/cocoa/notifications/notification_delivery.h" |
| 12 #import "chrome/browser/ui/cocoa/notifications/notification_private_mac.h" |
12 #import "chrome/browser/ui/cocoa/notifications/notification_response_builder_mac
.h" | 13 #import "chrome/browser/ui/cocoa/notifications/notification_response_builder_mac
.h" |
13 | 14 |
14 @class NSUserNotificationCenter; | 15 @class NSUserNotificationCenter; |
15 | 16 |
16 @implementation ServiceDelegate | 17 @implementation ServiceDelegate |
17 | 18 |
18 @synthesize connection = connection_; | 19 @synthesize connection = connection_; |
19 | 20 |
20 - (instancetype)init { | 21 - (instancetype)init { |
21 if ((self = [super init])) { | 22 if ((self = [super init])) { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 } | 54 } |
54 | 55 |
55 // NSUserNotification center delegate | 56 // NSUserNotification center delegate |
56 - (void)userNotificationCenter:(NSUserNotificationCenter*)center | 57 - (void)userNotificationCenter:(NSUserNotificationCenter*)center |
57 didActivateNotification:(NSUserNotification*)notification { | 58 didActivateNotification:(NSUserNotification*)notification { |
58 NSDictionary* response = | 59 NSDictionary* response = |
59 [NotificationResponseBuilder buildDictionary:notification]; | 60 [NotificationResponseBuilder buildDictionary:notification]; |
60 [[connection_ remoteObjectProxy] notificationClick:response]; | 61 [[connection_ remoteObjectProxy] notificationClick:response]; |
61 } | 62 } |
62 | 63 |
| 64 // NSUserNotificationCenter private. |
| 65 - (void)userNotificationCenter:(NSUserNotificationCenter*)center |
| 66 didDismissAlert:(NSUserNotification*)notification { |
| 67 NSDictionary* response = |
| 68 [NotificationResponseBuilder buildDictionary:notification]; |
| 69 [[connection_ remoteObjectProxy] notificationClick:response]; |
| 70 } |
| 71 |
63 @end | 72 @end |
OLD | NEW |