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

Side by Side Diff: content/renderer/input/input_handler_proxy.h

Issue 136173004: Early terminate flings when scrolling impossible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 8 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
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_RENDERER_INPUT_INPUT_HANDLER_PROXY_H_ 5 #ifndef CONTENT_RENDERER_INPUT_INPUT_HANDLER_PROXY_H_
6 #define CONTENT_RENDERER_INPUT_INPUT_HANDLER_PROXY_H_ 6 #define CONTENT_RENDERER_INPUT_INPUT_HANDLER_PROXY_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 28 matching lines...) Expand all
39 }; 39 };
40 EventDisposition HandleInputEventWithLatencyInfo( 40 EventDisposition HandleInputEventWithLatencyInfo(
41 const blink::WebInputEvent& event, 41 const blink::WebInputEvent& event,
42 ui::LatencyInfo* latency_info); 42 ui::LatencyInfo* latency_info);
43 EventDisposition HandleInputEvent(const blink::WebInputEvent& event); 43 EventDisposition HandleInputEvent(const blink::WebInputEvent& event);
44 44
45 // cc::InputHandlerClient implementation. 45 // cc::InputHandlerClient implementation.
46 virtual void WillShutdown() OVERRIDE; 46 virtual void WillShutdown() OVERRIDE;
47 virtual void Animate(base::TimeTicks time) OVERRIDE; 47 virtual void Animate(base::TimeTicks time) OVERRIDE;
48 virtual void MainThreadHasStoppedFlinging() OVERRIDE; 48 virtual void MainThreadHasStoppedFlinging() OVERRIDE;
49 virtual void DidOverscroll(const cc::DidOverscrollParams& params) OVERRIDE; 49 virtual void DidOverscroll(const gfx::Vector2dF& accumulated_overscroll,
50 const gfx::Vector2dF& latest_overscroll_delta)
51 OVERRIDE;
50 52
51 // blink::WebGestureCurveTarget implementation. 53 // blink::WebGestureCurveTarget implementation.
52 virtual void scrollBy(const blink::WebFloatSize& offset); 54 virtual bool scrollBy(const blink::WebFloatSize& offset,
53 virtual void notifyCurrentFlingVelocity(const blink::WebFloatSize& velocity); 55 const blink::WebFloatSize& velocity);
54 56
55 bool gesture_scroll_on_impl_thread_for_testing() const { 57 bool gesture_scroll_on_impl_thread_for_testing() const {
56 return gesture_scroll_on_impl_thread_; 58 return gesture_scroll_on_impl_thread_;
57 } 59 }
58 60
59 private: 61 private:
60 EventDisposition HandleGestureFling(const blink::WebGestureEvent& event); 62 EventDisposition HandleGestureFling(const blink::WebGestureEvent& event);
61 63
62 // Returns true if we scrolled by the increment. 64 // Returns true if we scrolled by the increment.
63 bool TouchpadFlingScroll(const blink::WebFloatSize& increment); 65 bool TouchpadFlingScroll(const blink::WebFloatSize& increment);
(...skipping 17 matching lines...) Expand all
81 // This is always false when there are no flings on the main thread, but 83 // This is always false when there are no flings on the main thread, but
82 // conservative in the sense that we might not be actually flinging when it is 84 // conservative in the sense that we might not be actually flinging when it is
83 // true. 85 // true.
84 bool fling_may_be_active_on_main_thread_; 86 bool fling_may_be_active_on_main_thread_;
85 // The axes on which the current fling is allowed to scroll. If a given fling 87 // The axes on which the current fling is allowed to scroll. If a given fling
86 // has overscrolled on a particular axis, further fling scrolls on that axis 88 // has overscrolled on a particular axis, further fling scrolls on that axis
87 // will be disabled. 89 // will be disabled.
88 bool disallow_horizontal_fling_scroll_; 90 bool disallow_horizontal_fling_scroll_;
89 bool disallow_vertical_fling_scroll_; 91 bool disallow_vertical_fling_scroll_;
90 92
93 // Non-zero only within the scope of |scrollBy|.
94 gfx::Vector2dF current_fling_velocity_;
95
91 DISALLOW_COPY_AND_ASSIGN(InputHandlerProxy); 96 DISALLOW_COPY_AND_ASSIGN(InputHandlerProxy);
92 }; 97 };
93 98
94 } // namespace content 99 } // namespace content
95 100
96 #endif // CONTENT_RENDERER_INPUT_INPUT_HANDLER_PROXY_H_ 101 #endif // CONTENT_RENDERER_INPUT_INPUT_HANDLER_PROXY_H_
OLDNEW
« no previous file with comments | « content/renderer/input/input_handler_manager_client.h ('k') | content/renderer/input/input_handler_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698