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

Side by Side Diff: remoting/client/plugin/touch_input_scaler.h

Issue 799233004: Add touch events to the protocol, the stub layer, and to the client plugin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add more comments to event proto Created 5 years, 10 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
OLDNEW
(Empty)
1 // Copyright 2015 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 #ifndef REMOTING_CLIENT_PLUGIN_TOUCH_INPUT_SCALER_H_
6 #define REMOTING_CLIENT_PLUGIN_TOUCH_INPUT_SCALER_H_
7
8 #include "remoting/protocol/input_filter.h"
9 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
10
11 namespace remoting {
12
13 namespace protocol {
14 class TouchEvent;
15 } // namespace protocol
16
17 // Scales the touch input coordinates to host coordinates and clamps so
18 // that the values do not go outside the remote desktop.
19 // Also resizes the touch radii.
20 class TouchInputScaler : public protocol::InputFilter {
21 public:
22 TouchInputScaler() = default;
23 explicit TouchInputScaler(InputStub* input_stub);
24 ~TouchInputScaler() override;
25
26 // Set input and output desktop sizes. - 1 so that it can be used as the "max"
27 // size.
Wez 2015/02/05 02:09:06 The "-1..." comment doesn't really help clarify an
Rintaro Kuroiwa 2015/02/06 23:35:00 Done.
28 void set_input_size(const webrtc::DesktopSize& size) {
29 input_size_.set(size.width() - 1, size.height() - 1);
30 }
31 void set_output_size(const webrtc::DesktopSize& size) {
32 output_size_.set(size.width() - 1, size.height() - 1);
33 }
34
35 // protocol::InputStub interface.
36 void InjectTouchEvent(const protocol::TouchEvent& event) override;
37
38 private:
39 // Sizes for scaling and clamping coordinates and sizes.
40 webrtc::DesktopSize input_size_;
41 webrtc::DesktopSize output_size_;
42
43 DISALLOW_COPY_AND_ASSIGN(TouchInputScaler);
44 };
45
46 } // namespace remoting
47
48 #endif // REMOTING_CLIENT_PLUGIN_TOUCH_INPUT_SCALER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698