OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_FLING_FLINGER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_FLING_FLINGER_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_FLING_FLINGER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_FLING_FLINGER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/timer/timer.h" | 9 #include "base/timer/timer.h" |
10 #include "content/browser/renderer_host/input/fling/fling_curve.h" | 10 #include "content/browser/renderer_host/input/fling/fling_curve.h" |
11 #include "content/port/browser/event_with_latency_info.h" | 11 #include "content/port/browser/event_with_latency_info.h" |
12 #include "content/port/common/input_event_ack_state.h" | 12 #include "content/port/common/input_event_ack_state.h" |
13 #include "third_party/WebKit/public/web/WebInputEvent.h" | 13 #include "third_party/WebKit/public/web/WebInputEvent.h" |
14 #include "ui/gfx/point.h" | 14 #include "ui/gfx/point.h" |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 class FlingerTest; | 17 class FlingerTest; |
| 18 class MockRenderWidgetHost; |
18 | 19 |
19 class FlingHelper { | 20 class FlingHelper { |
20 public: | 21 public: |
21 virtual ~FlingHelper() {} | 22 virtual ~FlingHelper() {} |
22 | 23 |
23 virtual void SendEventForFling(const WebKit::WebInputEvent& event) = 0; | 24 virtual void SendEventForFling(const WebKit::WebInputEvent& event) = 0; |
24 virtual void FlingFinished(WebKit::WebGestureEvent::SourceDevice source) = 0; | 25 virtual void FlingFinished(WebKit::WebGestureEvent::SourceDevice source) = 0; |
25 }; | 26 }; |
26 | 27 |
27 // Handles fling gestures. | 28 // Handles fling gestures. |
(...skipping 14 matching lines...) Expand all Loading... |
42 | 43 |
43 // Filters key events that may be just canceling an in-process fling. | 44 // Filters key events that may be just canceling an in-process fling. |
44 bool HandleKeyboardEvent(); | 45 bool HandleKeyboardEvent(); |
45 | 46 |
46 void ProcessEventAck(WebKit::WebInputEvent::Type type, | 47 void ProcessEventAck(WebKit::WebInputEvent::Type type, |
47 InputEventAckState ack_result, | 48 InputEventAckState ack_result, |
48 const ui::LatencyInfo& latency); | 49 const ui::LatencyInfo& latency); |
49 | 50 |
50 private: | 51 private: |
51 friend class FlingerTest; | 52 friend class FlingerTest; |
| 53 friend class MockRenderWidgetHost; |
52 | 54 |
53 // Overridden from FlingCurveTarget. | 55 // Overridden from FlingCurveTarget. |
54 virtual void ScrollBy(const gfx::PointF& delta) OVERRIDE; | 56 virtual void ScrollBy(const gfx::PointF& delta) OVERRIDE; |
55 virtual void NotifyCurrentFlingVelocity(const gfx::PointF& velocity) OVERRIDE; | 57 virtual void NotifyCurrentFlingVelocity(const gfx::PointF& velocity) OVERRIDE; |
56 | 58 |
57 void StartCurveTimer(); | 59 void StartCurveTimer(); |
58 void CurveTimerFired(); | 60 void CurveTimerFired(); |
59 | 61 |
60 void StopFlingAndCleanup(); | 62 void StopFlingAndCleanup(); |
61 | 63 |
(...skipping 13 matching lines...) Expand all Loading... |
75 double fling_start_time_secs_; | 77 double fling_start_time_secs_; |
76 int fling_modifier_; | 78 int fling_modifier_; |
77 WebKit::WebGestureEvent::SourceDevice fling_source_; | 79 WebKit::WebGestureEvent::SourceDevice fling_source_; |
78 | 80 |
79 DISALLOW_COPY_AND_ASSIGN(Flinger); | 81 DISALLOW_COPY_AND_ASSIGN(Flinger); |
80 }; | 82 }; |
81 | 83 |
82 } // namespace content | 84 } // namespace content |
83 | 85 |
84 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_FLING_FLINGER_H_ | 86 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_FLING_FLINGER_H_ |
OLD | NEW |