| Index: remoting/host/me2me_preference_pane.mm
|
| diff --git a/remoting/host/me2me_preference_pane.mm b/remoting/host/me2me_preference_pane.mm
|
| index d092983ba081d82ff257c5f6970fa9519e77be2f..4144cbe025f190f9f14d9bf54f5b0a19a80ba630 100644
|
| --- a/remoting/host/me2me_preference_pane.mm
|
| +++ b/remoting/host/me2me_preference_pane.mm
|
| @@ -28,6 +28,13 @@
|
| namespace {
|
| // The name of the Remoting Host service that is registered with launchd.
|
| #define kServiceName "org.chromium.chromoting"
|
| +
|
| +// Use separate named notifications for success and failure because sandboxed
|
| +// components can't include a dictionary when sending distributed notifications.
|
| +// The preferences panel is not yet sandboxed, but err on the side of caution.
|
| +#define kUpdateSucceededNotificationName kServiceName ".update_succeeded"
|
| +#define kUpdateFailedNotificationName kServiceName ".update_failed"
|
| +
|
| #define kConfigDir "/Library/PrivilegedHelperTools/"
|
|
|
| // This helper script is executed as root. It is passed a command-line option
|
| @@ -103,6 +110,9 @@ bool IsPinValid(const std::string& pin, const std::string& host_id,
|
| [service_status_timer_ invalidate];
|
| [service_status_timer_ release];
|
| service_status_timer_ = nil;
|
| + if (have_new_config_) {
|
| + [self notifyPlugin: kUpdateFailedNotificationName];
|
| + }
|
| }
|
|
|
| - (void)onApply:(id)sender {
|
| @@ -291,6 +301,10 @@ bool IsPinValid(const std::string& pin, const std::string& host_id,
|
| } else {
|
| [self sendJobControlMessage:LAUNCH_KEY_STARTJOB];
|
| }
|
| +
|
| + // Broadcast a distributed notification to inform the plugin that the
|
| + // configuration has been applied.
|
| + [self notifyPlugin: kUpdateSucceededNotificationName];
|
| }
|
|
|
| - (BOOL)runHelperAsRootWithCommand:(const char*)command
|
| @@ -400,4 +414,13 @@ bool IsPinValid(const std::string& pin, const std::string& host_id,
|
| return YES;
|
| }
|
|
|
| +- (void)notifyPlugin:(const char*)message {
|
| + NSDistributedNotificationCenter* center =
|
| + [NSDistributedNotificationCenter defaultCenter];
|
| + NSString* name = [NSString stringWithUTF8String:message];
|
| + [center postNotificationName:name
|
| + object:nil
|
| + userInfo:nil];
|
| +}
|
| +
|
| @end
|
|
|