OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/ui/gesture_interpreter.h" | 5 #include "remoting/client/gesture_interpreter.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "remoting/client/chromoting_session.h" | 9 #include "remoting/client/chromoting_session.h" |
10 #include "remoting/client/ui/direct_input_strategy.h" | 10 #include "remoting/client/input/direct_input_strategy.h" |
11 #include "remoting/client/input/trackpad_input_strategy.h" | |
11 #include "remoting/client/ui/renderer_proxy.h" | 12 #include "remoting/client/ui/renderer_proxy.h" |
12 #include "remoting/client/ui/trackpad_input_strategy.h" | |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 const float kOneFingerFlingTimeConstant = 325.f; | 16 const float kOneFingerFlingTimeConstant = 325.f; |
17 const float kScrollFlingTimeConstant = 250.f; | 17 const float kScrollFlingTimeConstant = 250.f; |
18 | 18 |
19 } // namespace | 19 } // namespace |
20 | 20 |
21 namespace remoting { | 21 namespace remoting { |
22 GestureInterpreter::GestureInterpreter(RendererProxy* renderer, | 22 GestureInterpreter::GestureInterpreter(RendererProxy* renderer, |
23 ChromotingSession* input_stub) | 23 ChromotingSession* input_stub) |
Yuwei
2017/05/23 21:28:26
I think you'll need to change ChromotingSession to
nicholss
2017/05/23 22:01:23
I did not want to change code for the move. It can
Yuwei
2017/05/23 22:20:42
Ah, yes, I think it's fine since GestureInterprete
| |
24 : renderer_(renderer), | 24 : renderer_(renderer), |
25 input_stub_(input_stub), | 25 input_stub_(input_stub), |
26 pan_animation_(kOneFingerFlingTimeConstant, | 26 pan_animation_(kOneFingerFlingTimeConstant, |
27 base::Bind(&GestureInterpreter::PanWithoutAbortAnimations, | 27 base::Bind(&GestureInterpreter::PanWithoutAbortAnimations, |
28 base::Unretained(this))), | 28 base::Unretained(this))), |
29 scroll_animation_( | 29 scroll_animation_( |
30 kScrollFlingTimeConstant, | 30 kScrollFlingTimeConstant, |
31 base::Bind(&GestureInterpreter::ScrollWithoutAbortAnimations, | 31 base::Bind(&GestureInterpreter::ScrollWithoutAbortAnimations, |
32 base::Unretained(this))) { | 32 base::Unretained(this))) { |
33 viewport_.RegisterOnTransformationChangedCallback( | 33 viewport_.RegisterOnTransformationChangedCallback( |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
213 if (feedback_radius > 0) { | 213 if (feedback_radius > 0) { |
214 // TODO(yuweih): The renderer takes diameter as parameter. Consider moving | 214 // TODO(yuweih): The renderer takes diameter as parameter. Consider moving |
215 // the *2 logic inside the renderer. | 215 // the *2 logic inside the renderer. |
216 float diameter_on_desktop = | 216 float diameter_on_desktop = |
217 2.f * feedback_radius / viewport_.GetTransformation().GetScale(); | 217 2.f * feedback_radius / viewport_.GetTransformation().GetScale(); |
218 renderer_->StartInputFeedback(cursor_x, cursor_y, diameter_on_desktop); | 218 renderer_->StartInputFeedback(cursor_x, cursor_y, diameter_on_desktop); |
219 } | 219 } |
220 } | 220 } |
221 | 221 |
222 } // namespace remoting | 222 } // namespace remoting |
OLD | NEW |