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 #import "remoting/host/me2me_preference_pane.h" | 5 #import "remoting/host/me2me_preference_pane.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 #include <CommonCrypto/CommonHMAC.h> | 8 #include <CommonCrypto/CommonHMAC.h> |
9 #include <launch.h> | 9 #include <launch.h> |
10 #import <PreferencePanes/PreferencePanes.h> | 10 #import <PreferencePanes/PreferencePanes.h> |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 // Ensure the authorization token is up-to-date before using it. | 219 // Ensure the authorization token is up-to-date before using it. |
220 [self updateAuthorizationStatus]; | 220 [self updateAuthorizationStatus]; |
221 [self updateUI]; | 221 [self updateUI]; |
222 if (!is_pane_unlocked_) | 222 if (!is_pane_unlocked_) |
223 return; | 223 return; |
224 | 224 |
225 if (![self runHelperAsRootWithCommand:"--disable" | 225 if (![self runHelperAsRootWithCommand:"--disable" |
226 inputData:""]) { | 226 inputData:""]) { |
227 LOG(ERROR) << "Failed to run the helper tool"; | 227 LOG(ERROR) << "Failed to run the helper tool"; |
228 [self showError]; | 228 [self showError]; |
| 229 [self notifyPlugin: kUpdateFailedNotificationName]; |
229 return; | 230 return; |
230 } | 231 } |
231 | 232 |
232 // Stop the launchd job. This cannot easily be done by the helper tool, | 233 // Stop the launchd job. This cannot easily be done by the helper tool, |
233 // since the launchd job runs in the current user's context. | 234 // since the launchd job runs in the current user's context. |
234 [self sendJobControlMessage:LAUNCH_KEY_STOPJOB]; | 235 [self sendJobControlMessage:LAUNCH_KEY_STOPJOB]; |
| 236 |
| 237 [self notifyPlugin: kUpdateSucceededNotificationName]; |
235 } | 238 } |
236 | 239 |
237 - (void)onNewConfigFile:(NSNotification*)notification { | 240 - (void)onNewConfigFile:(NSNotification*)notification { |
238 [self readNewConfig]; | 241 [self readNewConfig]; |
239 [self updateUI]; | 242 [self updateUI]; |
240 } | 243 } |
241 | 244 |
242 - (void)refreshServiceStatus:(NSTimer*)timer { | 245 - (void)refreshServiceStatus:(NSTimer*)timer { |
243 BOOL was_running = is_service_running_; | 246 BOOL was_running = is_service_running_; |
244 [self updateServiceStatus]; | 247 [self updateServiceStatus]; |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 - (void)notifyPlugin:(const char*)message { | 494 - (void)notifyPlugin:(const char*)message { |
492 NSDistributedNotificationCenter* center = | 495 NSDistributedNotificationCenter* center = |
493 [NSDistributedNotificationCenter defaultCenter]; | 496 [NSDistributedNotificationCenter defaultCenter]; |
494 NSString* name = [NSString stringWithUTF8String:message]; | 497 NSString* name = [NSString stringWithUTF8String:message]; |
495 [center postNotificationName:name | 498 [center postNotificationName:name |
496 object:nil | 499 object:nil |
497 userInfo:nil]; | 500 userInfo:nil]; |
498 } | 501 } |
499 | 502 |
500 @end | 503 @end |
OLD | NEW |