Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 IOS_CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_ | 5 #ifndef IOS_CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_ | 6 #define IOS_CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_ |
| 7 | 7 |
| 8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
| 9 | 9 |
| 10 #import "ios/web/public/web_state/crw_web_controller_observer.h" | 10 #import "ios/web/public/web_state/crw_web_controller_observer.h" |
| 11 #import "ios/web/public/web_state/crw_web_view_scroll_view_proxy.h" | 11 #import "ios/web/public/web_state/crw_web_view_scroll_view_proxy.h" |
| 12 | 12 |
| 13 namespace ios_internal { | 13 namespace ios_internal { |
| 14 // Duration of the toolbar animation. | 14 // Duration of the toolbar animation. |
| 15 const NSTimeInterval kToolbarAnimationDuration = 0.3; | 15 const NSTimeInterval kToolbarAnimationDuration = 0.3; |
| 16 } // namespace ios_internal | 16 } // namespace ios_internal |
| 17 | 17 |
| 18 @class CRWWebViewScrollViewProxy; | 18 @class CRWWebViewScrollViewProxy; |
| 19 @class FullScreenController; | 19 @class FullScreenController; |
| 20 @class Tab; | |
| 20 | 21 |
| 21 namespace web { | 22 namespace web { |
| 22 class NavigationManager; | 23 class NavigationManager; |
| 23 } | 24 } |
| 24 | 25 |
| 25 // Notification when the application is set up for testing. | 26 // Notification when the application is set up for testing. |
| 26 extern NSString* const kSetupForTestingWillCloseAllTabsNotification; | 27 extern NSString* const kSetupForTestingWillCloseAllTabsNotification; |
| 27 | 28 |
| 28 @protocol FullScreenControllerDelegate<NSObject> | 29 @protocol FullScreenControllerDelegate<NSObject> |
| 29 | 30 |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 42 // webViewProxy's scroll view at the same time. Should always be animated. | 43 // webViewProxy's scroll view at the same time. Should always be animated. |
| 43 // Only happens during a call to -setHeaderHeight:visible:onScrollView:. If | 44 // Only happens during a call to -setHeaderHeight:visible:onScrollView:. If |
| 44 // |changeTopContentPadding| is YES, then in addition to scrolling, delegate | 45 // |changeTopContentPadding| is YES, then in addition to scrolling, delegate |
| 45 // should also update webViewProxy's topContentPadding. | 46 // should also update webViewProxy's topContentPadding. |
| 46 - (void)fullScreenController:(FullScreenController*)fullScreenController | 47 - (void)fullScreenController:(FullScreenController*)fullScreenController |
| 47 drawHeaderViewFromOffset:(CGFloat)headerOffset | 48 drawHeaderViewFromOffset:(CGFloat)headerOffset |
| 48 onWebViewProxy:(id<CRWWebViewProxy>)webViewProxy | 49 onWebViewProxy:(id<CRWWebViewProxy>)webViewProxy |
| 49 changeTopContentPadding:(BOOL)changeTopContentPadding | 50 changeTopContentPadding:(BOOL)changeTopContentPadding |
| 50 scrollingToOffset:(CGFloat)contentOffset; | 51 scrollingToOffset:(CGFloat)contentOffset; |
| 51 | 52 |
| 52 // Called to retrieve the current height of the header. Only called from | 53 // Called to retrieve the height of the header view for the tab model's current |
| 54 // tab. Only called from -setHeaderVisible:, so that method needs to be | |
| 55 // explicitly called when the height changes. | |
| 56 - (CGFloat)headerHeightForCurrentTab; | |
| 57 | |
| 58 // Called to retrieve the height of the header view for |tab|. Only called from | |
| 53 // -setHeaderVisible:, so that method needs to be explicitly called when the | 59 // -setHeaderVisible:, so that method needs to be explicitly called when the |
| 54 // height changes. | 60 // height changes. |
| 55 - (CGFloat)headerHeight; | 61 - (CGFloat)headerHeightForTab:(Tab*)tab; |
|
noyau (Ping after 24h)
2017/01/09 15:09:31
This method should not be in this protocol, it is
Olivier
2017/01/09 17:23:18
Right. The delegate was called from other places.
| |
| 56 | 62 |
| 57 // Tests if the session ID matches the current tab. | 63 // Tests if the session ID matches the current tab. |
| 58 - (BOOL)isTabWithIDCurrent:(NSString*)sessionID; | 64 - (BOOL)isTabWithIDCurrent:(NSString*)sessionID; |
| 59 | 65 |
| 60 // Current offset of the header. A value between 0.0 (fully visible) and | 66 // Current offset of the header. A value between 0.0 (fully visible) and |
| 61 // headerHeight (fully hidden). | 67 // headerHeight (fully hidden). |
| 62 - (CGFloat)currentHeaderOffset; | 68 - (CGFloat)currentHeaderOffset; |
| 63 | 69 |
| 64 @end | 70 @end |
| 65 | 71 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 118 @interface FullScreenController (UsedForTesting) | 124 @interface FullScreenController (UsedForTesting) |
| 119 // Enables/Disables the FullScreenController in tests. The unit tests do not set | 125 // Enables/Disables the FullScreenController in tests. The unit tests do not set |
| 120 // the delegate which is crucial for methods to work on the controller. | 126 // the delegate which is crucial for methods to work on the controller. |
| 121 // This a temporary solution. | 127 // This a temporary solution. |
| 122 // TODO(shreyasv): Find a better solution/remove this when FullScreenController | 128 // TODO(shreyasv): Find a better solution/remove this when FullScreenController |
| 123 // moves to Tab. | 129 // moves to Tab. |
| 124 + (void)setEnabledForTests:(BOOL)enabled; | 130 + (void)setEnabledForTests:(BOOL)enabled; |
| 125 @end | 131 @end |
| 126 | 132 |
| 127 #endif // IOS_CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_ | 133 #endif // IOS_CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_ |
| OLD | NEW |