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/client/plugin/chromoting_instance.h" | 5 #include "remoting/client/plugin/chromoting_instance.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 pih->HandleMouseMoveEvent(pp::MouseInputEvent(event)); | 194 pih->HandleMouseMoveEvent(pp::MouseInputEvent(event)); |
195 return true; | 195 return true; |
196 } | 196 } |
197 | 197 |
198 case PP_INPUTEVENT_TYPE_CONTEXTMENU: { | 198 case PP_INPUTEVENT_TYPE_CONTEXTMENU: { |
199 // We need to return true here or else we'll get a local (plugin) context | 199 // We need to return true here or else we'll get a local (plugin) context |
200 // menu instead of the mouseup event for the right click. | 200 // menu instead of the mouseup event for the right click. |
201 return true; | 201 return true; |
202 } | 202 } |
203 | 203 |
204 case PP_INPUTEVENT_TYPE_KEYDOWN: | 204 case PP_INPUTEVENT_TYPE_KEYDOWN: { |
205 case PP_INPUTEVENT_TYPE_KEYUP: { | 205 pp::KeyboardInputEvent key = pp::KeyboardInputEvent(event); |
206 pp::KeyboardInputEvent key_event(event); | 206 logger_.VLog(3, "PP_INPUTEVENT_TYPE_KEYDOWN key=%d", key.GetKeyCode()); |
207 logger_.VLog(3, "PP_INPUTEVENT_TYPE_KEY%s key=%d", | 207 pih->HandleKeyEvent(true, key); |
208 (event.GetType()==PP_INPUTEVENT_TYPE_KEYDOWN ? "DOWN" : "UP"), | |
209 key_event.GetKeyCode()); | |
210 pih->HandleKeyEvent(event.GetType() == PP_INPUTEVENT_TYPE_KEYDOWN, | |
211 key_event); | |
212 return true; | 208 return true; |
213 } | 209 } |
214 | 210 |
| 211 case PP_INPUTEVENT_TYPE_KEYUP: { |
| 212 pp::KeyboardInputEvent key = pp::KeyboardInputEvent(event); |
| 213 logger_.VLog(3, "PP_INPUTEVENT_TYPE_KEYUP key=%d", key.GetKeyCode()); |
| 214 pih->HandleKeyEvent(false, key); |
| 215 return true; |
| 216 } |
| 217 |
215 case PP_INPUTEVENT_TYPE_CHAR: { | 218 case PP_INPUTEVENT_TYPE_CHAR: { |
216 pih->HandleCharacterEvent(pp::KeyboardInputEvent(event)); | 219 pih->HandleCharacterEvent(pp::KeyboardInputEvent(event)); |
217 return true; | 220 return true; |
218 } | 221 } |
219 | 222 |
220 default: | 223 default: { |
| 224 LOG(INFO) << "Unhandled input event: " << event.GetType(); |
221 break; | 225 break; |
| 226 } |
222 } | 227 } |
223 | 228 |
224 return false; | 229 return false; |
225 } | 230 } |
226 | 231 |
227 ChromotingScriptableObject* ChromotingInstance::GetScriptableObject() { | 232 ChromotingScriptableObject* ChromotingInstance::GetScriptableObject() { |
228 pp::VarPrivate object = GetInstanceObject(); | 233 pp::VarPrivate object = GetInstanceObject(); |
229 if (!object.is_undefined()) { | 234 if (!object.is_undefined()) { |
230 pp::deprecated::ScriptableObject* so = object.AsScriptableObject(); | 235 pp::deprecated::ScriptableObject* so = object.AsScriptableObject(); |
231 DCHECK(so != NULL); | 236 DCHECK(so != NULL); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 if (!client_.get()) | 295 if (!client_.get()) |
291 return NULL; | 296 return NULL; |
292 return client_->GetStats(); | 297 return client_->GetStats(); |
293 } | 298 } |
294 | 299 |
295 void ChromotingInstance::ReleaseAllKeys() { | 300 void ChromotingInstance::ReleaseAllKeys() { |
296 input_handler_->ReleaseAllKeys(); | 301 input_handler_->ReleaseAllKeys(); |
297 } | 302 } |
298 | 303 |
299 } // namespace remoting | 304 } // namespace remoting |
OLD | NEW |