OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 IOS_CHROME_BROWSER_UI_OVERSCROLL_ACTIONS_OVERSCROLL_ACTIONS_CONTROLLER_H
_ | 5 #ifndef IOS_CHROME_BROWSER_UI_OVERSCROLL_ACTIONS_OVERSCROLL_ACTIONS_CONTROLLER_H
_ |
6 #define IOS_CHROME_BROWSER_UI_OVERSCROLL_ACTIONS_OVERSCROLL_ACTIONS_CONTROLLER_H
_ | 6 #define IOS_CHROME_BROWSER_UI_OVERSCROLL_ACTIONS_OVERSCROLL_ACTIONS_CONTROLLER_H
_ |
7 | 7 |
8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
9 | 9 |
10 #import "ios/chrome/browser/ui/overscroll_actions/overscroll_actions_view.h" | 10 #import "ios/chrome/browser/ui/overscroll_actions/overscroll_actions_view.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // Init the OverscrollActionsController with a nil scrollview. | 79 // Init the OverscrollActionsController with a nil scrollview. |
80 // If the scrollview is nil then the OverscrollActionsController will be | 80 // If the scrollview is nil then the OverscrollActionsController will be |
81 // configured to use the scrollview from the CRWWebControllerObserver. | 81 // configured to use the scrollview from the CRWWebControllerObserver. |
82 - (instancetype)init; | 82 - (instancetype)init; |
83 // Designated initializer, when initialized with a scrollview, the | 83 // Designated initializer, when initialized with a scrollview, the |
84 // OverscrollActionsController will not use the CRWWebControllerObserver to | 84 // OverscrollActionsController will not use the CRWWebControllerObserver to |
85 // configure the scrollview, it will directly use the passed scrollview. | 85 // configure the scrollview, it will directly use the passed scrollview. |
86 - (instancetype)initWithScrollView:(UIScrollView*)scrollView; | 86 - (instancetype)initWithScrollView:(UIScrollView*)scrollView; |
87 | 87 |
88 // The scrollview the overscroll controller will control. | 88 // The scrollview the overscroll controller will control. |
89 @property(nonatomic, readonly) UIScrollView* scrollView; | 89 @property(weak, nonatomic, readonly) UIScrollView* scrollView; |
90 // The current state of the overscroll controller. | 90 // The current state of the overscroll controller. |
91 @property(nonatomic, assign, readonly) OverscrollState overscrollState; | 91 @property(nonatomic, assign, readonly) OverscrollState overscrollState; |
92 // The delegate must be set for the OverscrollActionsController to work | 92 // The delegate must be set for the OverscrollActionsController to work |
93 // properly. | 93 // properly. |
94 @property(nonatomic, assign) id<OverscrollActionsControllerDelegate> delegate; | 94 @property(nonatomic, weak) id<OverscrollActionsControllerDelegate> delegate; |
95 | 95 |
96 // Used to clear state maintained by the controller and de-register from | 96 // Used to clear state maintained by the controller and de-register from |
97 // notifications. After this call the controller ceases to function and will | 97 // notifications. After this call the controller ceases to function and will |
98 // clear its delegate. | 98 // clear its delegate. |
99 - (void)invalidate; | 99 - (void)invalidate; |
100 // Schedules call to |invalidate| at the end of the current action. This lets | 100 // Schedules call to |invalidate| at the end of the current action. This lets |
101 // the animation finish before invalidating the controller. | 101 // the animation finish before invalidating the controller. |
102 // If no action is running, calls |invalidate| immediately. | 102 // If no action is running, calls |invalidate| immediately. |
103 - (void)scheduleInvalidate; | 103 - (void)scheduleInvalidate; |
104 // Force the controller to switch to NO_PULL_STARTED state. | 104 // Force the controller to switch to NO_PULL_STARTED state. |
105 - (void)clear; | 105 - (void)clear; |
106 // Disabling overscroll actions will stop showing the overscroll actions view on | 106 // Disabling overscroll actions will stop showing the overscroll actions view on |
107 // top of the header when the user is pulling the webview's scrollview. | 107 // top of the header when the user is pulling the webview's scrollview. |
108 // Disable/enableOverscrollActions method calls are ref counted, this means | 108 // Disable/enableOverscrollActions method calls are ref counted, this means |
109 // that calls to disable must be compensated by the same amount of call to | 109 // that calls to disable must be compensated by the same amount of call to |
110 // enable in order to reenable overscroll actions. | 110 // enable in order to reenable overscroll actions. |
111 - (void)disableOverscrollActions; | 111 - (void)disableOverscrollActions; |
112 // Enabling overscroll actions will reverse the effect of a call to | 112 // Enabling overscroll actions will reverse the effect of a call to |
113 // -disableOverscrollActions. | 113 // -disableOverscrollActions. |
114 - (void)enableOverscrollActions; | 114 - (void)enableOverscrollActions; |
115 // Sets the style of the overscroll actions. | 115 // Sets the style of the overscroll actions. |
116 - (void)setStyle:(OverscrollStyle)style; | 116 - (void)setStyle:(OverscrollStyle)style; |
117 | 117 |
118 @end | 118 @end |
119 | 119 |
120 #endif // IOS_CHROME_BROWSER_UI_OVERSCROLL_ACTIONS_OVERSCROLL_ACTIONS_CONTROLLE
R_H_ | 120 #endif // IOS_CHROME_BROWSER_UI_OVERSCROLL_ACTIONS_OVERSCROLL_ACTIONS_CONTROLLE
R_H_ |
OLD | NEW |