OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/client_session.h" | 5 #include "remoting/host/client_session.h" |
6 | 6 |
7 #include "base/task.h" | 7 #include "base/task.h" |
8 #include "remoting/host/user_authenticator.h" | 8 #include "remoting/host/user_authenticator.h" |
9 #include "remoting/proto/auth.pb.h" | 9 #include "remoting/proto/auth.pb.h" |
10 #include "remoting/proto/event.pb.h" | 10 #include "remoting/proto/event.pb.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 connection_(connection), | 31 connection_(connection), |
32 input_stub_(input_stub), | 32 input_stub_(input_stub), |
33 authenticated_(false), | 33 authenticated_(false), |
34 awaiting_continue_approval_(false), | 34 awaiting_continue_approval_(false), |
35 remote_mouse_button_state_(0) { | 35 remote_mouse_button_state_(0) { |
36 } | 36 } |
37 | 37 |
38 ClientSession::~ClientSession() { | 38 ClientSession::~ClientSession() { |
39 } | 39 } |
40 | 40 |
41 void ClientSession::SuggestResolution( | |
42 const protocol::SuggestResolutionRequest* msg, Task* done) { | |
43 base::ScopedTaskRunner done_runner(done); | |
44 | |
45 if (!authenticated_) { | |
46 LOG(WARNING) << "Invalid control message received " | |
47 << "(client not authenticated)."; | |
48 return; | |
49 } | |
50 } | |
51 | |
52 void ClientSession::BeginSessionRequest( | 41 void ClientSession::BeginSessionRequest( |
53 const protocol::LocalLoginCredentials* credentials, Task* done) { | 42 const protocol::LocalLoginCredentials* credentials, Task* done) { |
54 DCHECK(event_handler_); | 43 DCHECK(event_handler_); |
55 | 44 |
56 base::ScopedTaskRunner done_runner(done); | 45 base::ScopedTaskRunner done_runner(done); |
57 | 46 |
58 bool success = false; | 47 bool success = false; |
59 switch (credentials->type()) { | 48 switch (credentials->type()) { |
60 case protocol::PASSWORD: | 49 case protocol::PASSWORD: |
61 success = user_authenticator_->Authenticate(credentials->username(), | 50 success = user_authenticator_->Authenticate(credentials->username(), |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 for (i = pressed_keys_.begin(); i != pressed_keys_.end(); ++i) { | 165 for (i = pressed_keys_.begin(); i != pressed_keys_.end(); ++i) { |
177 protocol::KeyEvent key; | 166 protocol::KeyEvent key; |
178 key.set_keycode(*i); | 167 key.set_keycode(*i); |
179 key.set_pressed(false); | 168 key.set_pressed(false); |
180 input_stub_->InjectKeyEvent(&key, NULL); | 169 input_stub_->InjectKeyEvent(&key, NULL); |
181 } | 170 } |
182 pressed_keys_.clear(); | 171 pressed_keys_.clear(); |
183 } | 172 } |
184 | 173 |
185 } // namespace remoting | 174 } // namespace remoting |
OLD | NEW |