Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Unified Diff: ios/chrome/browser/ui/ntp/google_landing_controller.mm

Issue 2833513002: Replace TabModel with WebStateList in GoogleLandingController. (Closed)
Patch Set: Fix gn Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/ntp/google_landing_controller.mm
diff --git a/ios/chrome/browser/ui/ntp/google_landing_controller.mm b/ios/chrome/browser/ui/ntp/google_landing_controller.mm
index 7f1d3c7340f3cc3c9e3de5856e7734dd8ea6218b..6775b127da0f93e592919a3ce43b1795027ca2ac 100644
--- a/ios/chrome/browser/ui/ntp/google_landing_controller.mm
+++ b/ios/chrome/browser/ui/ntp/google_landing_controller.mm
@@ -190,6 +190,9 @@ const CGFloat kMostVisitedPaddingIPadFavicon = 24;
// |YES| if a what's new promo can be displayed.
@property(nonatomic, assign) BOOL promoCanShow;
+// The number of tabs to show in the google landing fake toolbar.
+@property(nonatomic, assign) int tabCount;
+
// iPhone landscape uses a slightly different layout for the doodle and search
// field frame. Returns the proper frame from |frames| based on orientation,
// centered in the view.
@@ -259,6 +262,7 @@ const CGFloat kMostVisitedPaddingIPadFavicon = 24;
@synthesize promoIcon = _promoIcon;
@synthesize promoCanShow = _promoCanShow;
@synthesize maximumMostVisitedSitesShown = _maximumMostVisitedSitesShown;
+@synthesize tabCount = _tabCount;
@synthesize voiceSearchIsEnabled = _voiceSearchIsEnabled;
- (void)loadView {
@@ -995,6 +999,7 @@ const CGFloat kMostVisitedPaddingIPadFavicon = 24;
// iPhone header also contains a toolbar since the normal toolbar is
// hidden.
[_headerView addToolbarWithDataSource:self.dataSource];
+ [_headerView setToolbarTabCount:self.tabCount];
}
[_supplementaryViews addObject:_headerView];
}
@@ -1484,4 +1489,9 @@ const CGFloat kMostVisitedPaddingIPadFavicon = 24;
[_mostVisitedView reloadItemsAtIndexPaths:@[ indexPath ]];
}
+- (void)setTabCount:(int)tabCount {
+ _tabCount = tabCount;
+ [_headerView setToolbarTabCount:self.tabCount];
+}
+
@end
« no previous file with comments | « ios/chrome/browser/ui/ntp/google_landing_consumer.h ('k') | ios/chrome/browser/ui/ntp/google_landing_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698