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

Side by Side Diff: remoting/client/mouse_input_filter.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/client/mouse_input_filter.h" 5 #include "remoting/client/mouse_input_filter.h"
6 6
7 #include "remoting/proto/event.pb.h" 7 #include "remoting/proto/event.pb.h"
8 8
9 namespace remoting { 9 namespace remoting {
10 10
11 MouseInputFilter::MouseInputFilter(protocol::InputStub* input_stub) 11 MouseInputFilter::MouseInputFilter(protocol::InputStub* input_stub)
12 : input_stub_(input_stub) { 12 : input_stub_(input_stub) {
13 input_max_.setEmpty(); 13 input_max_.setEmpty();
14 output_max_.setEmpty(); 14 output_max_.setEmpty();
15 } 15 }
16 16
17 MouseInputFilter::~MouseInputFilter() { 17 MouseInputFilter::~MouseInputFilter() {
18 } 18 }
19 19
20 void MouseInputFilter::InjectClipboardEvent(
21 const protocol::ClipboardEvent& event) {
22 input_stub_->InjectClipboardEvent(event);
23 }
24
20 void MouseInputFilter::InjectKeyEvent(const protocol::KeyEvent& event) { 25 void MouseInputFilter::InjectKeyEvent(const protocol::KeyEvent& event) {
21 input_stub_->InjectKeyEvent(event); 26 input_stub_->InjectKeyEvent(event);
22 } 27 }
23 28
24 void MouseInputFilter::InjectMouseEvent(const protocol::MouseEvent& event) { 29 void MouseInputFilter::InjectMouseEvent(const protocol::MouseEvent& event) {
25 if (input_max_.isEmpty() || output_max_.isEmpty()) 30 if (input_max_.isEmpty() || output_max_.isEmpty())
26 return; 31 return;
27 32
28 // We scale based on the maximum input & output coordinates, rather than the 33 // We scale based on the maximum input & output coordinates, rather than the
29 // input and output sizes, so that it's possible to reach the edge of the 34 // input and output sizes, so that it's possible to reach the edge of the
(...skipping 16 matching lines...) Expand all
46 51
47 void MouseInputFilter::set_input_size(const SkISize& size) { 52 void MouseInputFilter::set_input_size(const SkISize& size) {
48 input_max_ = SkISize::Make(size.width() - 1, size.height() - 1); 53 input_max_ = SkISize::Make(size.width() - 1, size.height() - 1);
49 } 54 }
50 55
51 void MouseInputFilter::set_output_size(const SkISize& size) { 56 void MouseInputFilter::set_output_size(const SkISize& size) {
52 output_max_ = SkISize::Make(size.width() - 1, size.height() - 1); 57 output_max_ = SkISize::Make(size.width() - 1, size.height() - 1);
53 } 58 }
54 59
55 } // namespace remoting 60 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698