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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // TODO(jamiewalch): If the underlying OS bug is ever fixed, we should support | 84 // TODO(jamiewalch): If the underlying OS bug is ever fixed, we should support |
85 // curtain mode on suitable versions of Lion. | 85 // curtain mode on suitable versions of Lion. |
86 if (base::mac::IsOSLion()) { | 86 if (base::mac::IsOSLion()) { |
87 LOG(ERROR) << "Host curtaining is not supported on Mac OS X 10.7."; | 87 LOG(ERROR) << "Host curtaining is not supported on Mac OS X 10.7."; |
88 return false; | 88 return false; |
89 } | 89 } |
90 | 90 |
91 // Try to install the switch-in handler. Do this before switching out the | 91 // Try to install the switch-in handler. Do this before switching out the |
92 // current session so that the console session is not affected if it fails. | 92 // current session so that the console session is not affected if it fails. |
93 if (!InstallEventHandler()) { | 93 if (!InstallEventHandler()) { |
| 94 LOG(ERROR) << "Failed to install the switch-in handler."; |
94 return false; | 95 return false; |
95 } | 96 } |
96 | 97 |
97 base::mac::ScopedCFTypeRef<CFDictionaryRef> session( | 98 base::mac::ScopedCFTypeRef<CFDictionaryRef> session( |
98 CGSessionCopyCurrentDictionary()); | 99 CGSessionCopyCurrentDictionary()); |
99 | 100 |
100 // CGSessionCopyCurrentDictionary has been observed to return NULL in some | 101 // CGSessionCopyCurrentDictionary has been observed to return NULL in some |
101 // cases. Once the system is in this state, curtain mode will fail as the | 102 // cases. Once the system is in this state, curtain mode will fail as the |
102 // CGSession command thinks the session is not attached to the console. The | 103 // CGSession command thinks the session is not attached to the console. The |
103 // only known remedy is logout or reboot. Since we're not sure what causes | 104 // only known remedy is logout or reboot. Since we're not sure what causes |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 | 166 |
166 // static | 167 // static |
167 scoped_ptr<CurtainMode> CurtainMode::Create( | 168 scoped_ptr<CurtainMode> CurtainMode::Create( |
168 const base::Closure& on_session_activate, | 169 const base::Closure& on_session_activate, |
169 const base::Closure& on_error) { | 170 const base::Closure& on_error) { |
170 return scoped_ptr<CurtainMode>( | 171 return scoped_ptr<CurtainMode>( |
171 new CurtainModeMac(on_session_activate, on_error)); | 172 new CurtainModeMac(on_session_activate, on_error)); |
172 } | 173 } |
173 | 174 |
174 } // namespace remoting | 175 } // namespace remoting |
OLD | NEW |