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

Side by Side Diff: remoting/host/it2me/it2me_host.h

Issue 2179353004: Update Windows It2Me to allow remote users to interact with elevated windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@it2me_uiaccess
Patch Set: Fixing some comments Created 4 years, 3 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef REMOTING_HOST_IT2ME_IT2ME_HOST_H_ 5 #ifndef REMOTING_HOST_IT2ME_IT2ME_HOST_H_
6 #define REMOTING_HOST_IT2ME_IT2ME_HOST_H_ 6 #define REMOTING_HOST_IT2ME_IT2ME_HOST_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string>
9 10
10 #include "base/macros.h" 11 #include "base/macros.h"
11 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
12 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
13 #include "base/single_thread_task_runner.h" 14 #include "base/single_thread_task_runner.h"
14 #include "remoting/host/host_status_observer.h" 15 #include "remoting/host/host_status_observer.h"
15 #include "remoting/host/it2me/it2me_confirmation_dialog.h" 16 #include "remoting/host/it2me/it2me_confirmation_dialog.h"
16 #include "remoting/host/it2me/it2me_confirmation_dialog_proxy.h" 17 #include "remoting/host/it2me/it2me_confirmation_dialog_proxy.h"
17 #include "remoting/protocol/validating_authenticator.h" 18 #include "remoting/protocol/validating_authenticator.h"
18 #include "remoting/signaling/xmpp_signal_strategy.h" 19 #include "remoting/signaling/xmpp_signal_strategy.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 const std::string& remote_jid, 159 const std::string& remote_jid,
159 const protocol::ValidatingAuthenticator::ResultCallback& result_callback); 160 const protocol::ValidatingAuthenticator::ResultCallback& result_callback);
160 161
161 // Caller supplied fields. 162 // Caller supplied fields.
162 std::unique_ptr<ChromotingHostContext> host_context_; 163 std::unique_ptr<ChromotingHostContext> host_context_;
163 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 164 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
164 base::WeakPtr<It2MeHost::Observer> observer_; 165 base::WeakPtr<It2MeHost::Observer> observer_;
165 XmppSignalStrategy::XmppServerConfig xmpp_server_config_; 166 XmppSignalStrategy::XmppServerConfig xmpp_server_config_;
166 std::string directory_bot_jid_; 167 std::string directory_bot_jid_;
167 168
168 It2MeHostState state_; 169 It2MeHostState state_ = kDisconnected;
169 170
170 scoped_refptr<RsaKeyPair> host_key_pair_; 171 scoped_refptr<RsaKeyPair> host_key_pair_;
171 std::unique_ptr<SignalStrategy> signal_strategy_; 172 std::unique_ptr<SignalStrategy> signal_strategy_;
172 std::unique_ptr<RegisterSupportHostRequest> register_request_; 173 std::unique_ptr<RegisterSupportHostRequest> register_request_;
173 std::unique_ptr<HostStatusLogger> host_status_logger_; 174 std::unique_ptr<HostStatusLogger> host_status_logger_;
174 std::unique_ptr<DesktopEnvironmentFactory> desktop_environment_factory_; 175 std::unique_ptr<DesktopEnvironmentFactory> desktop_environment_factory_;
175 std::unique_ptr<HostEventLogger> host_event_logger_; 176 std::unique_ptr<HostEventLogger> host_event_logger_;
176 177
177 std::unique_ptr<ChromotingHost> host_; 178 std::unique_ptr<ChromotingHost> host_;
178 int failed_login_attempts_; 179 int failed_login_attempts_ = 0;
179 180
180 std::unique_ptr<PolicyWatcher> policy_watcher_; 181 std::unique_ptr<PolicyWatcher> policy_watcher_;
181 std::unique_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory_; 182 std::unique_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory_;
182 std::unique_ptr<It2MeConfirmationDialogProxy> confirmation_dialog_proxy_; 183 std::unique_ptr<It2MeConfirmationDialogProxy> confirmation_dialog_proxy_;
183 184
184 // Host the current nat traversal policy setting. 185 // Host the current nat traversal policy setting.
185 bool nat_traversal_enabled_; 186 bool nat_traversal_enabled_ = false;
186 187
187 // The client and host domain policy setting. 188 // The client and host domain policy setting.
188 std::string required_client_domain_; 189 std::string required_client_domain_;
189 std::string required_host_domain_; 190 std::string required_host_domain_;
190 191
191 // Indicates whether or not a policy has ever been read. This is to ensure 192 // Indicates whether or not a policy has ever been read. This is to ensure
192 // that on startup, we do not accidentally start a connection before we have 193 // that on startup, we do not accidentally start a connection before we have
193 // queried our policy restrictions. 194 // queried our policy restrictions.
194 bool policy_received_; 195 bool policy_received_ = false;
195 196
196 // On startup, it is possible to have Connect() called before the policy read 197 // On startup, it is possible to have Connect() called before the policy read
197 // is completed. Rather than just failing, we thunk the connection call so 198 // is completed. Rather than just failing, we thunk the connection call so
198 // it can be executed after at least one successful policy read. This 199 // it can be executed after at least one successful policy read. This
199 // variable contains the thunk if it is necessary. 200 // variable contains the thunk if it is necessary.
200 base::Closure pending_connect_; 201 base::Closure pending_connect_;
201 202
202 // Called after the client machine initiates the connection process and 203 // Called after the client machine initiates the connection process and
203 // determines whether to reject the connection or allow it to continue. 204 // determines whether to reject the connection or allow it to continue.
204 protocol::ValidatingAuthenticator::ValidationCallback validation_callback_; 205 protocol::ValidatingAuthenticator::ValidationCallback validation_callback_;
205 206
206 DISALLOW_COPY_AND_ASSIGN(It2MeHost); 207 DISALLOW_COPY_AND_ASSIGN(It2MeHost);
207 }; 208 };
208 209
209 // Having a factory interface makes it possible for the test to provide a mock 210 // Having a factory interface makes it possible for the test to provide a mock
210 // implementation of the It2MeHost. 211 // implementation of the It2MeHost.
211 class It2MeHostFactory { 212 class It2MeHostFactory {
212 public: 213 public:
213 It2MeHostFactory(); 214 It2MeHostFactory();
214 virtual ~It2MeHostFactory(); 215 virtual ~It2MeHostFactory();
215 216
216 // |policy_service| is used for creating the policy watcher for new
217 // instances of It2MeHost on ChromeOS. The caller must ensure that
218 // |policy_service| is valid throughout the lifetime of the It2MeHostFactory
219 // and each created It2MeHost object. This is currently possible because
220 // |policy_service| is a global singleton available from the browser process.
221 virtual void set_policy_service(policy::PolicyService* policy_service);
222
223 virtual scoped_refptr<It2MeHost> CreateIt2MeHost( 217 virtual scoped_refptr<It2MeHost> CreateIt2MeHost(
224 std::unique_ptr<ChromotingHostContext> context, 218 std::unique_ptr<ChromotingHostContext> context,
225 base::WeakPtr<It2MeHost::Observer> observer, 219 base::WeakPtr<It2MeHost::Observer> observer,
226 const XmppSignalStrategy::XmppServerConfig& xmpp_server_config, 220 const XmppSignalStrategy::XmppServerConfig& xmpp_server_config,
227 const std::string& directory_bot_jid); 221 const std::string& directory_bot_jid);
228 222
223 // |policy_service| is used for creating the policy watcher for new
224 // instances of It2MeHost on ChromeOS. The caller must ensure that
225 // |policy_service| is valid throughout the lifetime of the It2MeHostFactory
226 // and each created It2MeHost object. This is currently possible because
227 // |policy_service| is a global singleton available from the browser process.
228 void set_policy_service(policy::PolicyService* policy_service);
229
230 policy::PolicyService* get_policy_service() { return policy_service_; }
Sergey Ulanov 2016/08/31 23:00:16 This also looks out of place here. Factories shoul
joedow 2016/09/02 21:58:59 Great suggestion
231
229 private: 232 private:
230 policy::PolicyService* policy_service_; 233 policy::PolicyService* policy_service_ = nullptr;
231 DISALLOW_COPY_AND_ASSIGN(It2MeHostFactory); 234 DISALLOW_COPY_AND_ASSIGN(It2MeHostFactory);
232 }; 235 };
233 236
234 } // namespace remoting 237 } // namespace remoting
235 238
236 #endif // REMOTING_HOST_IT2ME_IT2ME_HOST_H_ 239 #endif // REMOTING_HOST_IT2ME_IT2ME_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698