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> |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
58 on_error_(on_error), | 58 on_error_(on_error), |
59 event_handler_(NULL) { | 59 event_handler_(NULL) { |
60 } | 60 } |
61 | 61 |
62 CurtainModeMac::~CurtainModeMac() { | 62 CurtainModeMac::~CurtainModeMac() { |
63 SetActivated(false); | 63 SetActivated(false); |
64 } | 64 } |
65 | 65 |
66 void CurtainModeMac::SetActivated(bool activated) { | 66 void CurtainModeMac::SetActivated(bool activated) { |
67 if (activated) { | 67 if (activated) { |
68 if (!ActivateCurtain()) { | 68 // If curtain mode is required, then we can't currently support remoting |
69 // the login screen. This is because we don't curtain the login screen | |
70 // and the current daemon architecture means that the connction is closed | |
71 // immediately after login, leaving the host system uncurtained. | |
72 // | |
73 // TODO(jamiewalch): Fix this once we have implemented the multi-process | |
74 // daemon architecture (crbug.com/134894) | |
75 if (getuid() == 0) { | |
rmsousa
2012/11/07 00:19:16
IIRC (Jamie might have more details) with the curr
Jamie
2012/11/07 00:27:49
Renato is correct. This is not an error activating
Wez
2012/11/07 02:37:32
Aha; it wasn't clear to me from the comment that t
| |
69 on_error_.Run(); | 76 on_error_.Run(); |
77 return; | |
70 } | 78 } |
79 | |
80 // Curtain-mode has issues on Mac OS X 10.7, so is currently disabled. | |
81 //if (!ActivateCurtain()) { | |
82 on_error_.Run(); | |
83 //} | |
71 } else { | 84 } else { |
72 RemoveEventHandler(); | 85 RemoveEventHandler(); |
73 } | 86 } |
74 } | 87 } |
75 | 88 |
76 bool CurtainModeMac::ActivateCurtain() { | 89 bool CurtainModeMac::ActivateCurtain() { |
77 // Try to install the switch-in handler. Do this before switching out the | 90 // Try to install the switch-in handler. Do this before switching out the |
78 // current session so that the console session is not affected if it fails. | 91 // current session so that the console session is not affected if it fails. |
79 if (!InstallEventHandler()) { | 92 if (!InstallEventHandler()) { |
80 return false; | 93 return false; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
141 | 154 |
142 // static | 155 // static |
143 scoped_ptr<CurtainMode> CurtainMode::Create( | 156 scoped_ptr<CurtainMode> CurtainMode::Create( |
144 const base::Closure& on_session_activate, | 157 const base::Closure& on_session_activate, |
145 const base::Closure& on_error) { | 158 const base::Closure& on_error) { |
146 return scoped_ptr<CurtainMode>( | 159 return scoped_ptr<CurtainMode>( |
147 new CurtainModeMac(on_session_activate, on_error)); | 160 new CurtainModeMac(on_session_activate, on_error)); |
148 } | 161 } |
149 | 162 |
150 } // namespace remoting | 163 } // namespace remoting |
OLD | NEW |