| 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/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 Loading... |
| 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 |
| OLD | NEW |