OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_OVERSCROLL_CONTROLLER_DELEGATE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_OVERSCROLL_CONTROLLER_DELEGATE_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_OVERSCROLL_CONTROLLER_DELEGATE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_OVERSCROLL_CONTROLLER_DELEGATE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "content/browser/renderer_host/overscroll_controller.h" | 10 #include "content/browser/renderer_host/overscroll_controller.h" |
| 11 #include "content/common/content_export.h" |
11 #include "ui/gfx/geometry/rect.h" | 12 #include "ui/gfx/geometry/rect.h" |
12 | 13 |
13 namespace content { | 14 namespace content { |
14 | 15 |
15 // The delegate receives overscroll gesture updates from the controller and | 16 // The delegate receives overscroll gesture updates from the controller and |
16 // should perform appropriate actions. | 17 // should perform appropriate actions. |
17 class OverscrollControllerDelegate { | 18 class CONTENT_EXPORT OverscrollControllerDelegate { |
18 public: | 19 public: |
19 OverscrollControllerDelegate() {} | 20 OverscrollControllerDelegate() {} |
20 virtual ~OverscrollControllerDelegate() {} | 21 virtual ~OverscrollControllerDelegate() {} |
21 | 22 |
22 // Get the bounds of the view corresponding to the delegate. Overscroll-ending | 23 // Get the bounds of the view corresponding to the delegate. Overscroll-ending |
23 // events will only be processed if the visible bounds are non-empty. | 24 // events will only be processed if the visible bounds are non-empty. |
24 virtual gfx::Rect GetVisibleBounds() const = 0; | 25 virtual gfx::Rect GetVisibleBounds() const = 0; |
25 | 26 |
26 // This is called for each update in the overscroll amount. Returns true if | 27 // This is called for each update in the overscroll amount. Returns true if |
27 // the delegate consumed the event. | 28 // the delegate consumed the event. |
28 virtual bool OnOverscrollUpdate(float delta_x, float delta_y) = 0; | 29 virtual bool OnOverscrollUpdate(float delta_x, float delta_y) = 0; |
29 | 30 |
30 // This is called when the overscroll completes. | 31 // This is called when the overscroll completes. |
31 virtual void OnOverscrollComplete(OverscrollMode overscroll_mode) = 0; | 32 virtual void OnOverscrollComplete(OverscrollMode overscroll_mode) = 0; |
32 | 33 |
33 // This is called when the direction of the overscroll changes. | 34 // This is called when the direction of the overscroll changes. |
34 virtual void OnOverscrollModeChange(OverscrollMode old_mode, | 35 virtual void OnOverscrollModeChange(OverscrollMode old_mode, |
35 OverscrollMode new_mode) = 0; | 36 OverscrollMode new_mode) = 0; |
36 | 37 |
37 private: | 38 private: |
38 DISALLOW_COPY_AND_ASSIGN(OverscrollControllerDelegate); | 39 DISALLOW_COPY_AND_ASSIGN(OverscrollControllerDelegate); |
39 }; | 40 }; |
40 | 41 |
41 } // namespace content | 42 } // namespace content |
42 | 43 |
43 #endif // CONTENT_BROWSER_RENDERER_HOST_OVERSCROLL_CONTROLLER_DELEGATE_H_ | 44 #endif // CONTENT_BROWSER_RENDERER_HOST_OVERSCROLL_CONTROLLER_DELEGATE_H_ |
OLD | NEW |