OLD | NEW |
(Empty) | |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_CHROME_BROWSER_UI_NTP_NEW_TAB_PAGE_PANEL_PROTOCOL_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_NTP_NEW_TAB_PAGE_PANEL_PROTOCOL_H_ |
| 7 |
| 8 #import <UIKit/UIKit.h> |
| 9 |
| 10 @protocol NewTabPagePanelProtocol; |
| 11 |
| 12 extern const int kNewTabPageShadowHeight; |
| 13 extern const int kNewTabPageDistanceToFadeShadow; |
| 14 |
| 15 @protocol NewTabPagePanelControllerDelegate<NSObject> |
| 16 |
| 17 // Updates the NTP bar shadow alpha for the given NewTabPagePanelProtocol. |
| 18 - (void)updateNtpBarShadowForPanelController: |
| 19 (id<NewTabPagePanelProtocol>)ntpPanelController; |
| 20 |
| 21 @end |
| 22 |
| 23 // TODO(jbbegue): rename, extract and upstream so that CRWNativeContent can |
| 24 // implement it ( https://crbug.com/492156 ). |
| 25 @protocol NewTabPagePanelControllerSnapshotting<NSObject> |
| 26 |
| 27 @optional |
| 28 // Called when a snapshot of the content will be taken. |
| 29 - (void)willUpdateSnapshot; |
| 30 |
| 31 @end |
| 32 |
| 33 // Base class of a controller for the panels in the New Tab Page. This should |
| 34 // not be instantiated, but instead one of its sub-classes. |
| 35 @protocol NewTabPagePanelProtocol<NewTabPagePanelControllerSnapshotting> |
| 36 |
| 37 // NewTabPagePanelController delegate, may be nil. |
| 38 @property(nonatomic, assign) id<NewTabPagePanelControllerDelegate> delegate; |
| 39 |
| 40 // Alpha value to use for the NewTabPageBar shadow. |
| 41 @property(nonatomic, readonly) CGFloat alphaForBottomShadow; |
| 42 |
| 43 // Main view. |
| 44 @property(nonatomic, readonly) UIView* view; |
| 45 |
| 46 // Reload any displayed data to ensure the view is up to date. |
| 47 - (void)reload; |
| 48 |
| 49 // Notifies the NewTabPagePanelProtocol that it has been shown. |
| 50 - (void)wasShown; |
| 51 |
| 52 // Notifies the NewTabPagePanelProtocol that it has been hidden. |
| 53 - (void)wasHidden; |
| 54 |
| 55 // Dismisses any modal interaction elements. |
| 56 - (void)dismissModals; |
| 57 |
| 58 // Dismisses on-screen keyboard if necessary. |
| 59 - (void)dismissKeyboard; |
| 60 |
| 61 // Disable and enable scrollToTop |
| 62 - (void)setScrollsToTop:(BOOL)enable; |
| 63 |
| 64 @end |
| 65 |
| 66 #endif // IOS_CHROME_BROWSER_UI_NTP_NEW_TAB_PAGE_PANEL_PROTOCOL_H_ |
OLD | NEW |