| 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/me2me_desktop_environment.h" | 5 #include "remoting/host/me2me_desktop_environment.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
| 9 #include "remoting/base/logging.h" | 9 #include "remoting/base/logging.h" |
| 10 #include "remoting/host/client_session_control.h" | 10 #include "remoting/host/client_session_control.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 scoped_ptr<GnubbyAuthHandler> Me2MeDesktopEnvironment::CreateGnubbyAuthHandler( | 59 scoped_ptr<GnubbyAuthHandler> Me2MeDesktopEnvironment::CreateGnubbyAuthHandler( |
| 60 protocol::ClientStub* client_stub) { | 60 protocol::ClientStub* client_stub) { |
| 61 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 61 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
| 62 | 62 |
| 63 if (gnubby_auth_enabled_) | 63 if (gnubby_auth_enabled_) |
| 64 return scoped_ptr<GnubbyAuthHandler>( | 64 return scoped_ptr<GnubbyAuthHandler>( |
| 65 GnubbyAuthHandler::Create(client_stub)); | 65 GnubbyAuthHandler::Create(client_stub)); |
| 66 | 66 |
| 67 HOST_LOG << "gnubby auth is not enabled"; | 67 HOST_LOG << "gnubby auth is not enabled"; |
| 68 return scoped_ptr<GnubbyAuthHandler>(); | 68 return nullptr; |
| 69 } | 69 } |
| 70 | 70 |
| 71 bool Me2MeDesktopEnvironment::InitializeSecurity( | 71 bool Me2MeDesktopEnvironment::InitializeSecurity( |
| 72 base::WeakPtr<ClientSessionControl> client_session_control, | 72 base::WeakPtr<ClientSessionControl> client_session_control, |
| 73 bool curtain_enabled) { | 73 bool curtain_enabled) { |
| 74 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 74 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
| 75 | 75 |
| 76 // Detach the session from the local console if the caller requested. | 76 // Detach the session from the local console if the caller requested. |
| 77 if (curtain_enabled) { | 77 if (curtain_enabled) { |
| 78 curtain_ = CurtainMode::Create(caller_task_runner(), | 78 curtain_ = CurtainMode::Create(caller_task_runner(), |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 scoped_ptr<DesktopEnvironment> Me2MeDesktopEnvironmentFactory::Create( | 141 scoped_ptr<DesktopEnvironment> Me2MeDesktopEnvironmentFactory::Create( |
| 142 base::WeakPtr<ClientSessionControl> client_session_control) { | 142 base::WeakPtr<ClientSessionControl> client_session_control) { |
| 143 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 143 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
| 144 | 144 |
| 145 scoped_ptr<Me2MeDesktopEnvironment> desktop_environment( | 145 scoped_ptr<Me2MeDesktopEnvironment> desktop_environment( |
| 146 new Me2MeDesktopEnvironment(caller_task_runner(), | 146 new Me2MeDesktopEnvironment(caller_task_runner(), |
| 147 input_task_runner(), | 147 input_task_runner(), |
| 148 ui_task_runner())); | 148 ui_task_runner())); |
| 149 if (!desktop_environment->InitializeSecurity(client_session_control, | 149 if (!desktop_environment->InitializeSecurity(client_session_control, |
| 150 curtain_enabled_)) { | 150 curtain_enabled_)) { |
| 151 return scoped_ptr<DesktopEnvironment>(); | 151 return nullptr; |
| 152 } | 152 } |
| 153 desktop_environment->SetEnableGnubbyAuth(gnubby_auth_enabled_); | 153 desktop_environment->SetEnableGnubbyAuth(gnubby_auth_enabled_); |
| 154 | 154 |
| 155 return desktop_environment.PassAs<DesktopEnvironment>(); | 155 return desktop_environment.Pass(); |
| 156 } | 156 } |
| 157 | 157 |
| 158 void Me2MeDesktopEnvironmentFactory::SetEnableCurtaining(bool enable) { | 158 void Me2MeDesktopEnvironmentFactory::SetEnableCurtaining(bool enable) { |
| 159 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 159 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
| 160 | 160 |
| 161 curtain_enabled_ = enable; | 161 curtain_enabled_ = enable; |
| 162 } | 162 } |
| 163 | 163 |
| 164 void Me2MeDesktopEnvironmentFactory::SetEnableGnubbyAuth( | 164 void Me2MeDesktopEnvironmentFactory::SetEnableGnubbyAuth( |
| 165 bool gnubby_auth_enabled) { | 165 bool gnubby_auth_enabled) { |
| 166 gnubby_auth_enabled_ = gnubby_auth_enabled; | 166 gnubby_auth_enabled_ = gnubby_auth_enabled; |
| 167 } | 167 } |
| 168 | 168 |
| 169 } // namespace remoting | 169 } // namespace remoting |
| OLD | NEW |