Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: remoting/host/me2me_desktop_environment.cc

Issue 138753005: Add gnubby authentication to remoting host (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another Windows warning Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « remoting/host/me2me_desktop_environment.h ('k') | remoting/host/policy_hack/policy_watcher.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/host/client_session_control.h" 10 #include "remoting/host/client_session_control.h"
10 #include "remoting/host/curtain_mode.h" 11 #include "remoting/host/curtain_mode.h"
11 #include "remoting/host/desktop_resizer.h" 12 #include "remoting/host/desktop_resizer.h"
13 #include "remoting/host/gnubby_auth_handler.h"
12 #include "remoting/host/host_window.h" 14 #include "remoting/host/host_window.h"
13 #include "remoting/host/host_window.h" 15 #include "remoting/host/host_window.h"
14 #include "remoting/host/host_window_proxy.h" 16 #include "remoting/host/host_window_proxy.h"
15 #include "remoting/host/local_input_monitor.h" 17 #include "remoting/host/local_input_monitor.h"
16 #include "remoting/host/resizing_host_observer.h" 18 #include "remoting/host/resizing_host_observer.h"
17 #include "remoting/host/screen_controls.h" 19 #include "remoting/host/screen_controls.h"
18 #include "third_party/webrtc/modules/desktop_capture/desktop_capture_options.h" 20 #include "third_party/webrtc/modules/desktop_capture/desktop_capture_options.h"
19 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" 21 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"
20 22
21 #if defined(OS_POSIX) 23 #if defined(OS_POSIX)
(...skipping 29 matching lines...) Expand all
51 std::string Me2MeDesktopEnvironment::GetCapabilities() const { 53 std::string Me2MeDesktopEnvironment::GetCapabilities() const {
52 return kRateLimitResizeRequests; 54 return kRateLimitResizeRequests;
53 } 55 }
54 56
55 Me2MeDesktopEnvironment::Me2MeDesktopEnvironment( 57 Me2MeDesktopEnvironment::Me2MeDesktopEnvironment(
56 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, 58 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
57 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, 59 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
58 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) 60 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner)
59 : BasicDesktopEnvironment(caller_task_runner, 61 : BasicDesktopEnvironment(caller_task_runner,
60 input_task_runner, 62 input_task_runner,
61 ui_task_runner) { 63 ui_task_runner),
64 gnubby_auth_enabled_(false) {
62 DCHECK(caller_task_runner->BelongsToCurrentThread()); 65 DCHECK(caller_task_runner->BelongsToCurrentThread());
63 } 66 }
64 67
68 scoped_ptr<GnubbyAuthHandler> Me2MeDesktopEnvironment::CreateGnubbyAuthHandler(
69 protocol::ClientStub* client_stub) {
70 DCHECK(caller_task_runner()->BelongsToCurrentThread());
71
72 if (gnubby_auth_enabled_)
73 return scoped_ptr<GnubbyAuthHandler>(
74 GnubbyAuthHandler::Create(client_stub));
75
76 HOST_LOG << "gnubby auth is not enabled";
77 return scoped_ptr<GnubbyAuthHandler>();
78 }
79
65 bool Me2MeDesktopEnvironment::InitializeSecurity( 80 bool Me2MeDesktopEnvironment::InitializeSecurity(
66 base::WeakPtr<ClientSessionControl> client_session_control, 81 base::WeakPtr<ClientSessionControl> client_session_control,
67 bool curtain_enabled) { 82 bool curtain_enabled) {
68 DCHECK(caller_task_runner()->BelongsToCurrentThread()); 83 DCHECK(caller_task_runner()->BelongsToCurrentThread());
69 84
70 // Detach the session from the local console if the caller requested. 85 // Detach the session from the local console if the caller requested.
71 if (curtain_enabled) { 86 if (curtain_enabled) {
72 curtain_ = CurtainMode::Create(caller_task_runner(), 87 curtain_ = CurtainMode::Create(caller_task_runner(),
73 ui_task_runner(), 88 ui_task_runner(),
74 client_session_control); 89 client_session_control);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 disconnect_window_.reset(new HostWindowProxy( 123 disconnect_window_.reset(new HostWindowProxy(
109 caller_task_runner(), 124 caller_task_runner(),
110 ui_task_runner(), 125 ui_task_runner(),
111 disconnect_window_.Pass())); 126 disconnect_window_.Pass()));
112 disconnect_window_->Start(client_session_control); 127 disconnect_window_->Start(client_session_control);
113 } 128 }
114 129
115 return true; 130 return true;
116 } 131 }
117 132
133 void Me2MeDesktopEnvironment::SetEnableGnubbyAuth(bool gnubby_auth_enabled) {
134 gnubby_auth_enabled_ = gnubby_auth_enabled;
135 }
136
118 Me2MeDesktopEnvironmentFactory::Me2MeDesktopEnvironmentFactory( 137 Me2MeDesktopEnvironmentFactory::Me2MeDesktopEnvironmentFactory(
119 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, 138 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
120 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, 139 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
121 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) 140 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner)
122 : BasicDesktopEnvironmentFactory(caller_task_runner, 141 : BasicDesktopEnvironmentFactory(caller_task_runner,
123 input_task_runner, 142 input_task_runner,
124 ui_task_runner), 143 ui_task_runner),
125 curtain_enabled_(false) { 144 curtain_enabled_(false) {
126 } 145 }
127 146
128 Me2MeDesktopEnvironmentFactory::~Me2MeDesktopEnvironmentFactory() { 147 Me2MeDesktopEnvironmentFactory::~Me2MeDesktopEnvironmentFactory() {
129 } 148 }
130 149
131 scoped_ptr<DesktopEnvironment> Me2MeDesktopEnvironmentFactory::Create( 150 scoped_ptr<DesktopEnvironment> Me2MeDesktopEnvironmentFactory::Create(
132 base::WeakPtr<ClientSessionControl> client_session_control) { 151 base::WeakPtr<ClientSessionControl> client_session_control) {
133 DCHECK(caller_task_runner()->BelongsToCurrentThread()); 152 DCHECK(caller_task_runner()->BelongsToCurrentThread());
134 153
135 scoped_ptr<Me2MeDesktopEnvironment> desktop_environment( 154 scoped_ptr<Me2MeDesktopEnvironment> desktop_environment(
136 new Me2MeDesktopEnvironment(caller_task_runner(), 155 new Me2MeDesktopEnvironment(caller_task_runner(),
137 input_task_runner(), 156 input_task_runner(),
138 ui_task_runner())); 157 ui_task_runner()));
139 if (!desktop_environment->InitializeSecurity(client_session_control, 158 if (!desktop_environment->InitializeSecurity(client_session_control,
140 curtain_enabled_)) { 159 curtain_enabled_)) {
141 return scoped_ptr<DesktopEnvironment>(); 160 return scoped_ptr<DesktopEnvironment>();
142 } 161 }
162 desktop_environment->SetEnableGnubbyAuth(gnubby_auth_enabled_);
143 163
144 return desktop_environment.PassAs<DesktopEnvironment>(); 164 return desktop_environment.PassAs<DesktopEnvironment>();
145 } 165 }
146 166
147 void Me2MeDesktopEnvironmentFactory::SetEnableCurtaining(bool enable) { 167 void Me2MeDesktopEnvironmentFactory::SetEnableCurtaining(bool enable) {
148 DCHECK(caller_task_runner()->BelongsToCurrentThread()); 168 DCHECK(caller_task_runner()->BelongsToCurrentThread());
149 169
150 curtain_enabled_ = enable; 170 curtain_enabled_ = enable;
151 } 171 }
152 172
173 void Me2MeDesktopEnvironmentFactory::SetEnableGnubbyAuth(
174 bool gnubby_auth_enabled) {
175 gnubby_auth_enabled_ = gnubby_auth_enabled;
176 }
177
153 } // namespace remoting 178 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/me2me_desktop_environment.h ('k') | remoting/host/policy_hack/policy_watcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698