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

Side by Side Diff: remoting/protocol/client_event_dispatcher.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
« no previous file with comments | « remoting/proto/event.proto ('k') | remoting/protocol/host_event_dispatcher.cc » ('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/protocol/client_event_dispatcher.h" 5 #include "remoting/protocol/client_event_dispatcher.h"
6 6
7 #include "base/message_loop_proxy.h" 7 #include "base/message_loop_proxy.h"
8 #include "base/time.h" 8 #include "base/time.h"
9 #include "net/socket/stream_socket.h" 9 #include "net/socket/stream_socket.h"
10 #include "remoting/base/constants.h" 10 #include "remoting/base/constants.h"
(...skipping 12 matching lines...) Expand all
23 writer_.Close(); 23 writer_.Close();
24 } 24 }
25 25
26 void ClientEventDispatcher::OnInitialized() { 26 void ClientEventDispatcher::OnInitialized() {
27 // TODO(garykac): Set write failed callback. 27 // TODO(garykac): Set write failed callback.
28 writer_.Init(channel(), 28 writer_.Init(channel(),
29 BufferedSocketWriter::WriteFailedCallback()); 29 BufferedSocketWriter::WriteFailedCallback());
30 } 30 }
31 31
32 void ClientEventDispatcher::InjectKeyEvent(const KeyEvent& event) { 32 void ClientEventDispatcher::InjectKeyEvent(const KeyEvent& event) {
33 DCHECK(event.has_keycode() || event.has_usb_keycode()); 33 DCHECK(event.has_usb_keycode());
34 DCHECK(event.has_pressed()); 34 DCHECK(event.has_pressed());
35 EventMessage message; 35 EventMessage message;
36 message.set_sequence_number(base::Time::Now().ToInternalValue()); 36 message.set_sequence_number(base::Time::Now().ToInternalValue());
37 message.mutable_key_event()->CopyFrom(event); 37 message.mutable_key_event()->CopyFrom(event);
38 writer_.Write(SerializeAndFrameMessage(message), base::Closure()); 38 writer_.Write(SerializeAndFrameMessage(message), base::Closure());
39 } 39 }
40 40
41 void ClientEventDispatcher::InjectMouseEvent(const MouseEvent& event) { 41 void ClientEventDispatcher::InjectMouseEvent(const MouseEvent& event) {
42 EventMessage message; 42 EventMessage message;
43 message.set_sequence_number(base::Time::Now().ToInternalValue()); 43 message.set_sequence_number(base::Time::Now().ToInternalValue());
44 message.mutable_mouse_event()->CopyFrom(event); 44 message.mutable_mouse_event()->CopyFrom(event);
45 writer_.Write(SerializeAndFrameMessage(message), base::Closure()); 45 writer_.Write(SerializeAndFrameMessage(message), base::Closure());
46 } 46 }
47 47
48 } // namespace protocol 48 } // namespace protocol
49 } // namespace remoting 49 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/proto/event.proto ('k') | remoting/protocol/host_event_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698