OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_CHROME_BROWSER_UI_NTP_NEW_TAB_PAGE_HEADER_VIEW_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_NTP_NEW_TAB_PAGE_HEADER_VIEW_H_ |
| 7 |
| 8 #import <UIKit/UIKit.h> |
| 9 |
| 10 #import "ios/chrome/browser/ui/toolbar/toolbar_owner.h" |
| 11 |
| 12 @protocol OmniboxFocuser; |
| 13 @class TabModel; |
| 14 @protocol WebToolbarDelegate; |
| 15 |
| 16 class ReadingListModel; |
| 17 |
| 18 // Header view for the Material Design NTP. The header view contains all views |
| 19 // that are displayed above the list of most visited sites, which includes the |
| 20 // toolbar buttons, Google doodle, and fake omnibox. |
| 21 @interface NewTabPageHeaderView : UICollectionReusableView<ToolbarOwner> |
| 22 |
| 23 // Return the toolbar view; |
| 24 @property(nonatomic, readonly) UIView* toolBarView; |
| 25 |
| 26 // Creates a NewTabPageToolbarController using the given |toolbarDelegate|, |
| 27 // |focuser| and |readingListModel|, and adds the toolbar view to self. |
| 28 - (void)addToolbarWithDelegate:(id<WebToolbarDelegate>)toolbarDelegate |
| 29 focuser:(id<OmniboxFocuser>)focuser |
| 30 tabModel:(TabModel*)tabModel |
| 31 readingListModel:(ReadingListModel*)readingListModel; |
| 32 |
| 33 // Changes the frame of |searchField| based on its |initialFrame| and the scroll |
| 34 // view's y |offset|. Also adjust the alpha values for |_searchBoxBorder| and |
| 35 // |_shadow| and the constant values for the |constraints|. |
| 36 - (void)updateSearchField:(UIView*)searchField |
| 37 withInitialFrame:(CGRect)initialFrame |
| 38 subviewConstraints:(NSArray*)constraints |
| 39 forOffset:(CGFloat)offset; |
| 40 |
| 41 // Initializes |_searchBoxBorder| and |_shadow| and adds them to |searchField|. |
| 42 - (void)addViewsToSearchField:(UIView*)searchField; |
| 43 |
| 44 // Animates |_shadow|'s alpha to 0. |
| 45 - (void)fadeOutShadow; |
| 46 |
| 47 // Hide toolbar subviews that should not be displayed on the new tab page. |
| 48 - (void)hideToolbarViewsForNewTabPage; |
| 49 |
| 50 @end |
| 51 |
| 52 #endif // IOS_CHROME_BROWSER_UI_NTP_NEW_TAB_PAGE_HEADER_VIEW_H_ |
OLD | NEW |