| 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 <X11/extensions/XInput.h> | 7 #include <X11/extensions/XInput.h> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/ptr_util.h" |
| 11 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
| 12 #include "remoting/base/logging.h" | 13 #include "remoting/base/logging.h" |
| 13 #include "remoting/host/client_session_control.h" | 14 #include "remoting/host/client_session_control.h" |
| 14 | 15 |
| 15 namespace remoting { | 16 namespace remoting { |
| 16 | 17 |
| 17 class CurtainModeLinux : public CurtainMode { | 18 class CurtainModeLinux : public CurtainMode { |
| 18 public: | 19 public: |
| 19 CurtainModeLinux(); | 20 CurtainModeLinux(); |
| 20 | 21 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 found_other_devices = true; | 94 found_other_devices = true; |
| 94 HOST_LOG << "Non Xvfb device found: " << device_info->name; | 95 HOST_LOG << "Non Xvfb device found: " << device_info->name; |
| 95 } | 96 } |
| 96 } | 97 } |
| 97 XFreeDeviceList(devices); | 98 XFreeDeviceList(devices); |
| 98 XCloseDisplay(display); | 99 XCloseDisplay(display); |
| 99 return found_xvfb_mouse && found_xvfb_keyboard && !found_other_devices; | 100 return found_xvfb_mouse && found_xvfb_keyboard && !found_other_devices; |
| 100 } | 101 } |
| 101 | 102 |
| 102 // static | 103 // static |
| 103 scoped_ptr<CurtainMode> CurtainMode::Create( | 104 std::unique_ptr<CurtainMode> CurtainMode::Create( |
| 104 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 105 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
| 105 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | 106 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
| 106 base::WeakPtr<ClientSessionControl> client_session_control) { | 107 base::WeakPtr<ClientSessionControl> client_session_control) { |
| 107 return make_scoped_ptr(new CurtainModeLinux()); | 108 return base::WrapUnique(new CurtainModeLinux()); |
| 108 } | 109 } |
| 109 | 110 |
| 110 } // namespace remoting | 111 } // namespace remoting |
| OLD | NEW |