OLD | NEW |
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_WEB_CONTENTS_AURA_GESTURE_NAV_SIMPLE_H_ | 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_AURA_GESTURE_NAV_SIMPLE_H_ |
6 #define CONTENT_BROWSER_WEB_CONTENTS_AURA_GESTURE_NAV_SIMPLE_H_ | 6 #define CONTENT_BROWSER_WEB_CONTENTS_AURA_GESTURE_NAV_SIMPLE_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "content/browser/renderer_host/overscroll_controller_delegate.h" | 9 #include "content/browser/renderer_host/overscroll_controller_delegate.h" |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 // of the web-contents as a hint for pending navigations from overscroll. | 25 // of the web-contents as a hint for pending navigations from overscroll. |
26 class GestureNavSimple : public OverscrollControllerDelegate { | 26 class GestureNavSimple : public OverscrollControllerDelegate { |
27 public: | 27 public: |
28 explicit GestureNavSimple(WebContentsImpl* web_contents); | 28 explicit GestureNavSimple(WebContentsImpl* web_contents); |
29 virtual ~GestureNavSimple(); | 29 virtual ~GestureNavSimple(); |
30 | 30 |
31 private: | 31 private: |
32 void ApplyEffectsAndDestroy(const gfx::Transform& transform, float opacity); | 32 void ApplyEffectsAndDestroy(const gfx::Transform& transform, float opacity); |
33 void AbortGestureAnimation(); | 33 void AbortGestureAnimation(); |
34 void CompleteGestureAnimation(); | 34 void CompleteGestureAnimation(); |
35 void ApplyEffectsForDelta(float delta_x); | 35 // Returns true if the delta was applied. |
| 36 bool ApplyEffectsForDelta(float delta_x); |
36 | 37 |
37 // OverscrollControllerDelegate: | 38 // OverscrollControllerDelegate: |
38 virtual gfx::Rect GetVisibleBounds() const OVERRIDE; | 39 virtual gfx::Rect GetVisibleBounds() const OVERRIDE; |
39 virtual void OnOverscrollUpdate(float delta_x, float delta_y) OVERRIDE; | 40 // Returns true if the scroll update was consumed. |
| 41 virtual bool OnOverscrollUpdate(float delta_x, float delta_y) OVERRIDE; |
40 virtual void OnOverscrollComplete(OverscrollMode overscroll_mode) OVERRIDE; | 42 virtual void OnOverscrollComplete(OverscrollMode overscroll_mode) OVERRIDE; |
41 virtual void OnOverscrollModeChange(OverscrollMode old_mode, | 43 virtual void OnOverscrollModeChange(OverscrollMode old_mode, |
42 OverscrollMode new_mode) OVERRIDE; | 44 OverscrollMode new_mode) OVERRIDE; |
43 | 45 |
44 WebContentsImpl* web_contents_; | 46 WebContentsImpl* web_contents_; |
45 scoped_ptr<ui::Layer> clip_layer_; | 47 scoped_ptr<ui::Layer> clip_layer_; |
46 scoped_ptr<ui::Layer> arrow_; | 48 scoped_ptr<ui::Layer> arrow_; |
47 scoped_ptr<ArrowLayerDelegate> arrow_delegate_; | 49 scoped_ptr<ArrowLayerDelegate> arrow_delegate_; |
48 float completion_threshold_; | 50 float completion_threshold_; |
49 | 51 |
50 DISALLOW_COPY_AND_ASSIGN(GestureNavSimple); | 52 DISALLOW_COPY_AND_ASSIGN(GestureNavSimple); |
51 }; | 53 }; |
52 | 54 |
53 } // namespace content | 55 } // namespace content |
54 | 56 |
55 #endif // CONTENT_BROWSER_WEB_CONTENTS_AURA_GESTURE_NAV_SIMPLE_H_ | 57 #endif // CONTENT_BROWSER_WEB_CONTENTS_AURA_GESTURE_NAV_SIMPLE_H_ |
OLD | NEW |