Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 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_NTP_NEW_TAB_PAGE_BAR_H_ | 5 #ifndef IOS_CHROME_BROWSER_UI_NTP_NEW_TAB_PAGE_BAR_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_NTP_NEW_TAB_PAGE_BAR_H_ | 6 #define IOS_CHROME_BROWSER_UI_NTP_NEW_TAB_PAGE_BAR_H_ |
| 7 | 7 |
| 8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
| 9 | 9 |
| 10 #import "ios/chrome/browser/ui/ntp/google_landing_controller.h" | 10 #import "ios/chrome/browser/ui/ntp/google_landing_controller.h" |
| 11 | 11 |
| 12 @class NewTabPageBarItem; | 12 @class NewTabPageBarItem; |
| 13 | 13 |
| 14 @protocol NewTabPageBarDelegate | 14 @protocol NewTabPageBarDelegate |
| 15 // Called when new tab page bar item is selected and the selection is changed. | 15 // Called when new tab page bar item is selected and the selection is changed. |
| 16 // If |changePanel| is true, bring the panel into view in the scroll view. | 16 // If |changePanel| is true, bring the panel into view in the scroll view. |
| 17 - (void)newTabBarItemDidChange:(NewTabPageBarItem*)selectedItem | 17 - (void)newTabBarItemDidChange:(NewTabPageBarItem*)selectedItem |
| 18 changePanel:(BOOL)changePanel; | 18 changePanel:(BOOL)changePanel; |
| 19 @end | 19 @end |
| 20 | 20 |
| 21 // The bar in the new tab page that switches between the provided choices. | 21 // The bar in the new tab page that switches between the provided choices. |
| 22 // It also draws a notch pointing to the center of the selected choice to | 22 // It also draws a notch pointing to the center of the selected choice to |
| 23 // create a "speech bubble" effect. | 23 // create a "speech bubble" effect. |
| 24 @interface NewTabPageBar : UIView<UIGestureRecognizerDelegate> | 24 @interface NewTabPageBar : UIView<UIGestureRecognizerDelegate> |
| 25 | 25 |
| 26 @property(nonatomic, retain) NSArray* items; | 26 @property(nonatomic, retain) NSArray* items; // NewTabPageBarItem |
| 27 // Which button is currently selected. | |
| 27 @property(nonatomic, assign) NSUInteger selectedIndex; | 28 @property(nonatomic, assign) NSUInteger selectedIndex; |
| 28 @property(nonatomic, assign) CGFloat overlayPercentage; | 29 @property(nonatomic, assign) CGFloat overlayPercentage; |
| 29 @property(nonatomic, readonly, retain) NSArray* buttons; | 30 // Tabbar buttons. |
| 31 @property(nonatomic, readonly, retain) NSArray* buttons; // UIButton | |
|
Sidney San Martín
2017/01/05 03:24:05
I moved these comments from the ivar declarations
| |
| 30 @property(nonatomic, assign) id<NewTabPageBarDelegate> delegate; | 32 @property(nonatomic, assign) id<NewTabPageBarDelegate> delegate; |
| 31 | 33 |
| 32 // Changes the colors of the buttons and overlay depending on the content offset | 34 // Changes the colors of the buttons and overlay depending on the content offset |
| 33 // of the scroll view. Tablet Incognito only. | 35 // of the scroll view. Tablet Incognito only. |
| 34 - (void)updateColorsForScrollView:(UIScrollView*)scrollView; | 36 - (void)updateColorsForScrollView:(UIScrollView*)scrollView; |
| 35 | 37 |
| 36 // Updates the alpha of the shadow image. When the alpha changes from 0 to 1 or | 38 // Updates the alpha of the shadow image. When the alpha changes from 0 to 1 or |
| 37 // 1 to 0, the alpha change is animated. | 39 // 1 to 0, the alpha change is animated. |
| 38 - (void)setShadowAlpha:(CGFloat)alpha; | 40 - (void)setShadowAlpha:(CGFloat)alpha; |
| 39 | 41 |
| 40 @end | 42 @end |
| 41 | 43 |
| 42 #endif // IOS_CHROME_BROWSER_UI_NTP_NEW_TAB_PAGE_BAR_H_ | 44 #endif // IOS_CHROME_BROWSER_UI_NTP_NEW_TAB_PAGE_BAR_H_ |
| OLD | NEW |