Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: chrome/browser/ui/cocoa/notifications/notification_service_delegate.mm

Issue 2736223002: Transfer the notification icon through XPC as NSData for OSX 10.09 (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/notifications/notification_builder_mac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 20 matching lines...) Expand all
31 - (void)dealloc { 31 - (void)dealloc {
32 [[NSUserNotificationCenter defaultUserNotificationCenter] setDelegate:nil]; 32 [[NSUserNotificationCenter defaultUserNotificationCenter] setDelegate:nil];
33 [super dealloc]; 33 [super dealloc];
34 } 34 }
35 35
36 - (BOOL)listener:(NSXPCListener*)listener 36 - (BOOL)listener:(NSXPCListener*)listener
37 shouldAcceptNewConnection:(NSXPCConnection*)newConnection { 37 shouldAcceptNewConnection:(NSXPCConnection*)newConnection {
38 newConnection.exportedInterface = 38 newConnection.exportedInterface =
39 [NSXPCInterface interfaceWithProtocol:@protocol(NotificationDelivery)]; 39 [NSXPCInterface interfaceWithProtocol:@protocol(NotificationDelivery)];
40 [newConnection.exportedInterface 40 [newConnection.exportedInterface
41 setClasses:[NSSet setWithObjects:[NSDictionary class], [NSImage class], 41 setClasses:[NSSet setWithObjects:[NSData class], [NSDictionary class],
42 [NSNumber class], [NSString class], 42 [NSImage class], [NSNumber class],
43 nil] 43 [NSString class], nil]
44 forSelector:@selector(deliverNotification:) 44 forSelector:@selector(deliverNotification:)
45 argumentIndex:0 45 argumentIndex:0
46 ofReply:NO]; 46 ofReply:NO];
47 47
48 base::scoped_nsobject<AlertNotificationService> object( 48 base::scoped_nsobject<AlertNotificationService> object(
49 [[AlertNotificationService alloc] 49 [[AlertNotificationService alloc]
50 initWithTransactionHandler:transactionHandler_]); 50 initWithTransactionHandler:transactionHandler_]);
51 newConnection.exportedObject = object.get(); 51 newConnection.exportedObject = object.get();
52 newConnection.remoteObjectInterface = 52 newConnection.remoteObjectInterface =
53 [NSXPCInterface interfaceWithProtocol:@protocol(NotificationReply)]; 53 [NSXPCInterface interfaceWithProtocol:@protocol(NotificationReply)];
(...skipping 14 matching lines...) Expand all
68 // _NSUserNotificationCenterDelegatePrivate 68 // _NSUserNotificationCenterDelegatePrivate
69 - (void)userNotificationCenter:(NSUserNotificationCenter*)center 69 - (void)userNotificationCenter:(NSUserNotificationCenter*)center
70 didDismissAlert:(NSUserNotification*)notification { 70 didDismissAlert:(NSUserNotification*)notification {
71 NSDictionary* response = 71 NSDictionary* response =
72 [NotificationResponseBuilder buildDictionary:notification]; 72 [NotificationResponseBuilder buildDictionary:notification];
73 [[connection_ remoteObjectProxy] notificationClick:response]; 73 [[connection_ remoteObjectProxy] notificationClick:response];
74 [transactionHandler_ closeTransactionIfNeeded]; 74 [transactionHandler_ closeTransactionIfNeeded];
75 } 75 }
76 76
77 @end 77 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/notifications/notification_builder_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698