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

Unified Diff: chrome/browser/ui/cocoa/profiles/avatar_base_controller.mm

Issue 2047643003: DO NOT SUBMIT. Implement an XPCService for notifications. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge to use AlertNotificationService Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/notifications/xpc_service_main.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/profiles/avatar_base_controller.mm
diff --git a/chrome/browser/ui/cocoa/profiles/avatar_base_controller.mm b/chrome/browser/ui/cocoa/profiles/avatar_base_controller.mm
index ef503f002245ebf0682c24d027402f3e92851b1e..1e3b160448a81dfad5b8e02e743d1b489c779848 100644
--- a/chrome/browser/ui/cocoa/profiles/avatar_base_controller.mm
+++ b/chrome/browser/ui/cocoa/profiles/avatar_base_controller.mm
@@ -26,6 +26,9 @@
#include "components/signin/core/common/profile_management_switches.h"
#include "ui/base/cocoa/cocoa_base_utils.h"
+#import "base/mac/bundle_locations.h"
+#import "chrome/browser/ui/cocoa/notifications/notification_delivery.h"
+
// Space between the avatar icon and the avatar menu bubble.
const CGFloat kMenuYOffsetAdjust = 1.0;
// Offset needed to align the edge of the avatar bubble with the edge of the
@@ -218,6 +221,30 @@ class ProfileAttributesUpdateObserver
}
- (IBAction)buttonClicked:(id)sender {
+ {
+ NSLog(@"attempting to start NSXPCS");
+ NSXPCConnection* conn = [[NSXPCConnection alloc]
+ initWithServiceName:
+ [NSString
+ stringWithFormat:@"%@.BannerNotificationService",
+ [base::mac::OuterBundle() bundleIdentifier]]];
+ conn.remoteObjectInterface =
+ [NSXPCInterface interfaceWithProtocol:@protocol(NotificationDelivery)];
+ conn.interruptionHandler = ^{
+ NSLog(@"conn interruptionHandler: %@", conn);
+ };
+ conn.invalidationHandler = ^{
+ NSLog(@"conn invalidationHandler %@", conn);
+ };
+ [conn resume];
+
+ NSDictionary* dict = @{ @"title" : @"hello world" };
+ [[conn remoteObjectProxy] deliverNotification:dict];
+
+ //[conn invalidate];
+ //[conn release];
+ }
+
BrowserWindow::AvatarBubbleMode mode =
BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT;
if ([self isCtrlPressed])
« no previous file with comments | « chrome/browser/ui/cocoa/notifications/xpc_service_main.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698