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/setup/daemon_controller.h" | 5 #include "remoting/host/setup/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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 } | 292 } |
293 OSStatus status = LSOpenFSRef(&pane_path_ref, NULL); | 293 OSStatus status = LSOpenFSRef(&pane_path_ref, NULL); |
294 if (status != noErr) { | 294 if (status != noErr) { |
295 OSSTATUS_LOG(ERROR, status) << "LSOpenFSRef failed for path: " | 295 OSSTATUS_LOG(ERROR, status) << "LSOpenFSRef failed for path: " |
296 << pane_path.value(); | 296 << pane_path.value(); |
297 return false; | 297 return false; |
298 } | 298 } |
299 | 299 |
300 CFNotificationCenterRef center = | 300 CFNotificationCenterRef center = |
301 CFNotificationCenterGetDistributedCenter(); | 301 CFNotificationCenterGetDistributedCenter(); |
302 base::mac::ScopedCFTypeRef<CFStringRef> service_name( | 302 base::ScopedCFTypeRef<CFStringRef> service_name(CFStringCreateWithCString( |
303 CFStringCreateWithCString(kCFAllocatorDefault, remoting::kServiceName, | 303 kCFAllocatorDefault, remoting::kServiceName, kCFStringEncodingUTF8)); |
304 kCFStringEncodingUTF8)); | |
305 CFNotificationCenterPostNotification(center, service_name, NULL, NULL, | 304 CFNotificationCenterPostNotification(center, service_name, NULL, NULL, |
306 TRUE); | 305 TRUE); |
307 return true; | 306 return true; |
308 } | 307 } |
309 | 308 |
310 void DaemonControllerMac::DoStop(const CompletionCallback& done_callback) { | 309 void DaemonControllerMac::DoStop(const CompletionCallback& done_callback) { |
311 ShowPreferencePane("", done_callback); | 310 ShowPreferencePane("", done_callback); |
312 } | 311 } |
313 | 312 |
314 // CFNotificationCenterAddObserver ties the thread on which distributed | 313 // CFNotificationCenterAddObserver ties the thread on which distributed |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 } | 369 } |
371 } | 370 } |
372 | 371 |
373 } // namespace | 372 } // namespace |
374 | 373 |
375 scoped_ptr<DaemonController> remoting::DaemonController::Create() { | 374 scoped_ptr<DaemonController> remoting::DaemonController::Create() { |
376 return scoped_ptr<DaemonController>(new DaemonControllerMac()); | 375 return scoped_ptr<DaemonController>(new DaemonControllerMac()); |
377 } | 376 } |
378 | 377 |
379 } // namespace remoting | 378 } // namespace remoting |
OLD | NEW |