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/curtain_mode.h" | 5 #include "remoting/host/curtain_mode.h" |
6 | 6 |
7 #include <ApplicationServices/ApplicationServices.h> | 7 #include <ApplicationServices/ApplicationServices.h> |
8 #include <Carbon/Carbon.h> | 8 #include <Carbon/Carbon.h> |
9 #include <Security/Security.h> | 9 #include <Security/Security.h> |
10 #include <unistd.h> | 10 #include <unistd.h> |
11 | 11 |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/location.h" | 13 #include "base/location.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/mac/mac_util.h" | 15 #include "base/mac/mac_util.h" |
16 #include "base/mac/scoped_cftyperef.h" | 16 #include "base/mac/scoped_cftyperef.h" |
17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/memory/ptr_util.h" |
18 #include "base/single_thread_task_runner.h" | 19 #include "base/single_thread_task_runner.h" |
19 #include "remoting/host/client_session_control.h" | 20 #include "remoting/host/client_session_control.h" |
20 #include "remoting/protocol/errors.h" | 21 #include "remoting/protocol/errors.h" |
21 | 22 |
22 namespace remoting { | 23 namespace remoting { |
23 | 24 |
24 namespace { | 25 namespace { |
25 | 26 |
26 const char* kCGSessionPath = | 27 const char* kCGSessionPath = |
27 "/System/Library/CoreServices/Menu Extras/User.menu/Contents/Resources/" | 28 "/System/Library/CoreServices/Menu Extras/User.menu/Contents/Resources/" |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 CurtainModeMac::~CurtainModeMac() { | 254 CurtainModeMac::~CurtainModeMac() { |
254 session_watcher_->Stop(); | 255 session_watcher_->Stop(); |
255 } | 256 } |
256 | 257 |
257 bool CurtainModeMac::Activate() { | 258 bool CurtainModeMac::Activate() { |
258 session_watcher_->Start(); | 259 session_watcher_->Start(); |
259 return true; | 260 return true; |
260 } | 261 } |
261 | 262 |
262 // static | 263 // static |
263 scoped_ptr<CurtainMode> CurtainMode::Create( | 264 std::unique_ptr<CurtainMode> CurtainMode::Create( |
264 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 265 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
265 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | 266 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
266 base::WeakPtr<ClientSessionControl> client_session_control) { | 267 base::WeakPtr<ClientSessionControl> client_session_control) { |
267 return make_scoped_ptr(new CurtainModeMac( | 268 return base::WrapUnique(new CurtainModeMac(caller_task_runner, ui_task_runner, |
268 caller_task_runner, ui_task_runner, client_session_control)); | 269 client_session_control)); |
269 } | 270 } |
270 | 271 |
271 } // namespace remoting | 272 } // namespace remoting |
OLD | NEW |