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

Unified Diff: ios/chrome/browser/ui/ntp/new_tab_page_header_view.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/new_tab_page_header_view.mm
diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_header_view.mm b/ios/chrome/browser/ui/ntp/new_tab_page_header_view.mm
index 46590152472ef374e572197757653b01f1809938..a9a519412da9c7a5afbea8479ae889211ed5c3c9 100644
--- a/ios/chrome/browser/ui/ntp/new_tab_page_header_view.mm
+++ b/ios/chrome/browser/ui/ntp/new_tab_page_header_view.mm
@@ -25,9 +25,8 @@ const CGFloat kMaxConstraintConstantDiff = 5;
} // namespace
-@interface NewTabPageHeaderView ()<TabModelObserver> {
+@interface NewTabPageHeaderView () {
base::scoped_nsobject<NewTabPageToolbarController> _toolbarController;
- base::scoped_nsobject<TabModel> _tabModel;
base::scoped_nsobject<UIImageView> _searchBoxBorder;
base::scoped_nsobject<UIImageView> _shadow;
}
@@ -45,7 +44,6 @@ const CGFloat kMaxConstraintConstantDiff = 5;
}
- (void)dealloc {
- [_tabModel removeObserver:self];
[super dealloc];
}
@@ -74,9 +72,6 @@ const CGFloat kMaxConstraintConstantDiff = 5;
initWithToolbarDelegate:[dataSource toolbarDelegate]
focuser:dataSource]);
_toolbarController.get().readingListModel = [dataSource readingListModel];
- [_tabModel removeObserver:self];
- _tabModel.reset([[dataSource tabModel] retain]);
- [self addTabModelObserver];
UIView* toolbarView = [_toolbarController view];
CGRect toolbarFrame = self.bounds;
@@ -93,9 +88,8 @@ const CGFloat kMaxConstraintConstantDiff = 5;
[_toolbarController hideViewsForNewTabPage:YES];
};
-- (void)addTabModelObserver {
- [_tabModel addObserver:self];
- [_toolbarController setTabCount:[_tabModel count]];
+- (void)setToolbarTabCount:(int)tabCount {
+ [_toolbarController setTabCount:tabCount];
}
- (void)addViewsToSearchField:(UIView*)searchField {
@@ -122,11 +116,6 @@ const CGFloat kMaxConstraintConstantDiff = 5;
[_shadow setAlpha:0];
}
-- (void)tabModelDidChangeTabCount:(TabModel*)model {
- DCHECK(model == _tabModel);
- [_toolbarController setTabCount:[_tabModel count]];
-}
-
- (void)updateSearchField:(UIView*)searchField
withInitialFrame:(CGRect)initialFrame
subviewConstraints:(NSArray*)constraints
« no previous file with comments | « ios/chrome/browser/ui/ntp/new_tab_page_header_view.h ('k') | ios/clean/chrome/browser/ui/ntp/ntp_home_coordinator.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698