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 #include "remoting/host/plugin/daemon_controller.h" | 5 #include "remoting/host/plugin/daemon_controller.h" |
6 | 6 |
7 #include <launch.h> | 7 #include <launch.h> |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 #include <sys/types.h> | 9 #include <sys/types.h> |
10 | 10 |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 CFNotificationSuspensionBehaviorDeliverImmediately); | 341 CFNotificationSuspensionBehaviorDeliverImmediately); |
342 } | 342 } |
343 | 343 |
344 void DaemonControllerMac::PreferencePaneCallbackDelegate(CFStringRef name) { | 344 void DaemonControllerMac::PreferencePaneCallbackDelegate(CFStringRef name) { |
345 AsyncResult result = RESULT_FAILED; | 345 AsyncResult result = RESULT_FAILED; |
346 if (CFStringCompare(name, CFSTR(kUpdateSucceededNotificationName), 0) == | 346 if (CFStringCompare(name, CFSTR(kUpdateSucceededNotificationName), 0) == |
347 kCFCompareEqualTo) { | 347 kCFCompareEqualTo) { |
348 result = RESULT_OK; | 348 result = RESULT_OK; |
349 } else if (CFStringCompare(name, CFSTR(kUpdateFailedNotificationName), 0) == | 349 } else if (CFStringCompare(name, CFSTR(kUpdateFailedNotificationName), 0) == |
350 kCFCompareEqualTo) { | 350 kCFCompareEqualTo) { |
351 result = RESULT_CANCELLED; | 351 result = RESULT_FAILED; |
352 } else { | 352 } else { |
353 LOG(WARNING) << "Ignoring unexpected notification: " << name; | 353 LOG(WARNING) << "Ignoring unexpected notification: " << name; |
354 return; | 354 return; |
355 } | 355 } |
356 DCHECK(!current_callback_.is_null()); | 356 DCHECK(!current_callback_.is_null()); |
357 current_callback_.Run(result); | 357 current_callback_.Run(result); |
358 current_callback_.Reset(); | 358 current_callback_.Reset(); |
359 DeregisterForPreferencePaneNotifications(); | 359 DeregisterForPreferencePaneNotifications(); |
360 } | 360 } |
361 | 361 |
(...skipping 10 matching lines...) Expand all Loading... |
372 } | 372 } |
373 } | 373 } |
374 | 374 |
375 } // namespace | 375 } // namespace |
376 | 376 |
377 scoped_ptr<DaemonController> remoting::DaemonController::Create() { | 377 scoped_ptr<DaemonController> remoting::DaemonController::Create() { |
378 return scoped_ptr<DaemonController>(new DaemonControllerMac()); | 378 return scoped_ptr<DaemonController>(new DaemonControllerMac()); |
379 } | 379 } |
380 | 380 |
381 } // namespace remoting | 381 } // namespace remoting |
OLD | NEW |