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

Side by Side Diff: remoting/client/plugin/chromoting_instance.cc

Issue 10894050: Remove support for Windows-style keycodes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Linux EventExecutor typo. Created 8 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 | Annotate | Revision Log
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/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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 bool is_pressed = false; 292 bool is_pressed = false;
293 if (!data->GetInteger("usbKeycode", &usb_keycode) || 293 if (!data->GetInteger("usbKeycode", &usb_keycode) ||
294 !data->GetBoolean("pressed", &is_pressed)) { 294 !data->GetBoolean("pressed", &is_pressed)) {
295 LOG(ERROR) << "Invalid injectKeyEvent."; 295 LOG(ERROR) << "Invalid injectKeyEvent.";
296 return; 296 return;
297 } 297 }
298 298
299 protocol::KeyEvent event; 299 protocol::KeyEvent event;
300 event.set_usb_keycode(usb_keycode); 300 event.set_usb_keycode(usb_keycode);
301 event.set_pressed(is_pressed); 301 event.set_pressed(is_pressed);
302 // Even though new hosts will ignore keycode, it's a required field.
303 event.set_keycode(0);
304 InjectKeyEvent(event); 302 InjectKeyEvent(event);
305 } else if (method == "remapKey") { 303 } else if (method == "remapKey") {
306 int from_keycode = 0; 304 int from_keycode = 0;
307 int to_keycode = 0; 305 int to_keycode = 0;
308 if (!data->GetInteger("fromKeycode", &from_keycode) || 306 if (!data->GetInteger("fromKeycode", &from_keycode) ||
309 !data->GetInteger("toKeycode", &to_keycode)) { 307 !data->GetInteger("toKeycode", &to_keycode)) {
310 LOG(ERROR) << "Invalid remapKey."; 308 LOG(ERROR) << "Invalid remapKey.";
311 return; 309 return;
312 } 310 }
313 311
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 PostChromotingMessage("logDebugMessage", data.Pass()); 733 PostChromotingMessage("logDebugMessage", data.Pass());
736 g_logging_to_plugin = false; 734 g_logging_to_plugin = false;
737 } 735 }
738 736
739 bool ChromotingInstance::IsConnected() { 737 bool ChromotingInstance::IsConnected() {
740 return host_connection_.get() && 738 return host_connection_.get() &&
741 (host_connection_->state() == protocol::ConnectionToHost::CONNECTED); 739 (host_connection_->state() == protocol::ConnectionToHost::CONNECTED);
742 } 740 }
743 741
744 } // namespace remoting 742 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/key_event_mapper_unittest.cc ('k') | remoting/client/plugin/pepper_input_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698