Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "remoting/host/mouse_clamping_filter.h" | |
| 6 | |
| 7 #include "remoting/host/video_frame_capturer.h" | |
| 8 #include "remoting/proto/event.pb.h" | |
| 9 #include "remoting/protocol/mouse_input_filter.h" | |
| 10 | |
| 11 namespace remoting { | |
| 12 | |
| 13 MouseClampingFilter::MouseClampingFilter( | |
| 14 VideoFrameCapturer* capturer, | |
| 15 protocol::MouseInputFilter* mouse_input_filter) | |
| 16 : InputFilter(mouse_input_filter), | |
| 17 capturer_(capturer), | |
| 18 mouse_input_filter_(mouse_input_filter) { | |
|
simonmorris
2012/08/20 20:59:45
Aliasing an object as both a member variable and a
| |
| 19 } | |
| 20 | |
| 21 MouseClampingFilter::~MouseClampingFilter() { | |
| 22 } | |
| 23 | |
| 24 void MouseClampingFilter::InjectMouseEvent(const protocol::MouseEvent& event) { | |
| 25 // Ensure that the MouseInputFilter is clamping to the current dimensions. | |
| 26 mouse_input_filter_->set_output_size(capturer_->size_most_recent()); | |
| 27 mouse_input_filter_->set_input_size(capturer_->size_most_recent()); | |
| 28 | |
| 29 InputFilter::InjectMouseEvent(event); | |
| 30 } | |
| 31 | |
| 32 } // namespace remoting | |
| OLD | NEW |