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

Side by Side Diff: remoting/protocol/client_event_dispatcher.cc

Issue 9646013: Add the plumbing that will carry a clipboard item from a chromoting client to a host. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync, and make InputStub inherit from ClipboardStub. Created 8 years, 9 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) 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/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 13 matching lines...) Expand all
24 ClientEventDispatcher::~ClientEventDispatcher() { 24 ClientEventDispatcher::~ClientEventDispatcher() {
25 writer_->Close(); 25 writer_->Close();
26 } 26 }
27 27
28 void ClientEventDispatcher::OnInitialized() { 28 void ClientEventDispatcher::OnInitialized() {
29 // TODO(garykac): Set write failed callback. 29 // TODO(garykac): Set write failed callback.
30 writer_->Init(channel(), 30 writer_->Init(channel(),
31 BufferedSocketWriter::WriteFailedCallback()); 31 BufferedSocketWriter::WriteFailedCallback());
32 } 32 }
33 33
34 void ClientEventDispatcher::InjectClipboardEvent(const ClipboardEvent& event) {
35 // Clipboard events are not handled here.
36 // TODO(wez): Remove this function when InputEvent no longer inherits from
37 // ClipboardEvent.
Wez 2012/03/15 01:14:44 nit: NOTIMPLEMENTED() (or NOTREACHED()) here?
simonmorris 2012/03/15 16:53:19 No longer needed.
38 }
39
34 void ClientEventDispatcher::InjectKeyEvent(const KeyEvent& event) { 40 void ClientEventDispatcher::InjectKeyEvent(const KeyEvent& event) {
35 EventMessage message; 41 EventMessage message;
36 message.set_sequence_number(base::Time::Now().ToInternalValue()); 42 message.set_sequence_number(base::Time::Now().ToInternalValue());
37 message.mutable_key_event()->CopyFrom(event); 43 message.mutable_key_event()->CopyFrom(event);
38 writer_->Write(SerializeAndFrameMessage(message), base::Closure()); 44 writer_->Write(SerializeAndFrameMessage(message), base::Closure());
39 } 45 }
40 46
41 void ClientEventDispatcher::InjectMouseEvent(const MouseEvent& event) { 47 void ClientEventDispatcher::InjectMouseEvent(const MouseEvent& event) {
42 EventMessage message; 48 EventMessage message;
43 message.set_sequence_number(base::Time::Now().ToInternalValue()); 49 message.set_sequence_number(base::Time::Now().ToInternalValue());
44 message.mutable_mouse_event()->CopyFrom(event); 50 message.mutable_mouse_event()->CopyFrom(event);
45 writer_->Write(SerializeAndFrameMessage(message), base::Closure()); 51 writer_->Write(SerializeAndFrameMessage(message), base::Closure());
46 } 52 }
47 53
48 } // namespace protocol 54 } // namespace protocol
49 } // namespace remoting 55 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698