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/logging.h" | 10 #include "base/logging.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 XFreeDeviceList(devices); | 88 XFreeDeviceList(devices); |
89 XCloseDisplay(display); | 89 XCloseDisplay(display); |
90 return found_xvfb_mouse && found_xvfb_keyboard && !found_other_devices; | 90 return found_xvfb_mouse && found_xvfb_keyboard && !found_other_devices; |
91 } | 91 } |
92 | 92 |
93 void CurtainModeLinux::SetActivated(bool activated) { | 93 void CurtainModeLinux::SetActivated(bool activated) { |
94 // We can't curtain the session in run-time in Linux. | 94 // We can't curtain the session in run-time in Linux. |
95 // Either the session is running on Xvfb (i.e. always curtained), or it is | 95 // Either the session is running on Xvfb (i.e. always curtained), or it is |
96 // attached to the physical console (i.e. impossible to curtain). | 96 // attached to the physical console (i.e. impossible to curtain). |
97 if (activated && !IsXvfbSession()) { | 97 if (activated && !IsXvfbSession()) { |
| 98 LOG(ERROR) << "Curtain-mode is not supported when running on non-Xvfb " |
| 99 "X server"; |
98 on_error_.Run(); | 100 on_error_.Run(); |
99 } | 101 } |
100 } | 102 } |
101 | 103 |
102 // static | 104 // static |
103 scoped_ptr<CurtainMode> CurtainMode::Create( | 105 scoped_ptr<CurtainMode> CurtainMode::Create( |
104 const base::Closure& on_session_activate, | 106 const base::Closure& on_session_activate, |
105 const base::Closure& on_error) { | 107 const base::Closure& on_error) { |
106 return scoped_ptr<CurtainMode>( | 108 return scoped_ptr<CurtainMode>( |
107 new CurtainModeLinux(on_session_activate, on_error)); | 109 new CurtainModeLinux(on_session_activate, on_error)); |
108 } | 110 } |
109 | 111 |
110 } // namespace remoting | 112 } // namespace remoting |
OLD | NEW |