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

Side by Side Diff: content/browser/android/overscroll_controller_android.h

Issue 2528823002: Separate SwipeRefreshHandler and ContentViewCore (Closed)
Patch Set: tedchoc's requested changes Created 4 years 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_ANDROID_OVERSCROLL_CONTROLLER_ANDROID_H_ 5 #ifndef CONTENT_BROWSER_ANDROID_OVERSCROLL_CONTROLLER_ANDROID_H_
6 #define CONTENT_BROWSER_ANDROID_OVERSCROLL_CONTROLLER_ANDROID_H_ 6 #define CONTENT_BROWSER_ANDROID_OVERSCROLL_CONTROLLER_ANDROID_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/android/scoped_java_ref.h"
10 #include "base/macros.h" 11 #include "base/macros.h"
11 #include "base/time/time.h" 12 #include "base/time/time.h"
12 #include "content/common/input/input_event_ack_state.h" 13 #include "content/common/input/input_event_ack_state.h"
13 #include "ui/android/overscroll_glow.h" 14 #include "ui/android/overscroll_glow.h"
14 #include "ui/android/overscroll_refresh.h" 15 #include "ui/android/overscroll_refresh.h"
15 #include "ui/gfx/geometry/vector2d_f.h" 16 #include "ui/gfx/geometry/vector2d_f.h"
16 17
17 namespace blink { 18 namespace blink {
18 class WebGestureEvent; 19 class WebGestureEvent;
19 } 20 }
20 21
21 namespace cc { 22 namespace cc {
22 class CompositorFrameMetadata; 23 class CompositorFrameMetadata;
23 class Layer; 24 class Layer;
24 } 25 }
25 26
26 namespace ui { 27 namespace ui {
27 class WindowAndroidCompositor; 28 class WindowAndroidCompositor;
28 struct DidOverscrollParams; 29 struct DidOverscrollParams;
29 } 30 }
30 31
31 namespace content { 32 namespace content {
32 33
33 class ContentViewCoreImpl;
34
35 // Glue class for handling all inputs into Android-specific overscroll effects, 34 // Glue class for handling all inputs into Android-specific overscroll effects,
36 // both the passive overscroll glow and the active overscroll pull-to-refresh. 35 // both the passive overscroll glow and the active overscroll pull-to-refresh.
37 // Note that all input coordinates (both for events and overscroll) are in DIPs. 36 // Note that all input coordinates (both for events and overscroll) are in DIPs.
38 class OverscrollControllerAndroid : public ui::OverscrollGlowClient { 37 class OverscrollControllerAndroid : public ui::OverscrollGlowClient {
39 public: 38 public:
40 explicit OverscrollControllerAndroid(ContentViewCoreImpl* content_view_core, 39 OverscrollControllerAndroid(
41 float dpi_scale); 40 ui::OverscrollRefreshHandler* overscroll_refresh_handler,
41 ui::WindowAndroidCompositor* compositor,
42 float dpi_scale);
42 ~OverscrollControllerAndroid() override; 43 ~OverscrollControllerAndroid() override;
43 44
44 // Returns true if |event| is consumed by an overscroll effect, in which 45 // Returns true if |event| is consumed by an overscroll effect, in which
45 // case it should cease propagation. 46 // case it should cease propagation.
46 bool WillHandleGestureEvent(const blink::WebGestureEvent& event); 47 bool WillHandleGestureEvent(const blink::WebGestureEvent& event);
47 48
48 // To be called upon receipt of a gesture event ack. 49 // To be called upon receipt of a gesture event ack.
49 void OnGestureEventAck(const blink::WebGestureEvent& event, 50 void OnGestureEventAck(const blink::WebGestureEvent& event,
50 InputEventAckState ack_result); 51 InputEventAckState ack_result);
51 52
(...skipping 26 matching lines...) Expand all
78 // TODO(jdduke): Factor out a common API from the two overscroll effects. 79 // TODO(jdduke): Factor out a common API from the two overscroll effects.
79 std::unique_ptr<ui::OverscrollGlow> glow_effect_; 80 std::unique_ptr<ui::OverscrollGlow> glow_effect_;
80 std::unique_ptr<ui::OverscrollRefresh> refresh_effect_; 81 std::unique_ptr<ui::OverscrollRefresh> refresh_effect_;
81 82
82 DISALLOW_COPY_AND_ASSIGN(OverscrollControllerAndroid); 83 DISALLOW_COPY_AND_ASSIGN(OverscrollControllerAndroid);
83 }; 84 };
84 85
85 } // namespace content 86 } // namespace content
86 87
87 #endif // CONTENT_BROWSER_ANDROID_OVERSCROLL_CONTROLLER_ANDROID_H_ 88 #endif // CONTENT_BROWSER_ANDROID_OVERSCROLL_CONTROLLER_ANDROID_H_
OLDNEW
« no previous file with comments | « content/browser/android/content_view_core_impl.cc ('k') | content/browser/android/overscroll_controller_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698