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

Side by Side Diff: ios/clean/chrome/browser/ui/tab_collection/tab_collection_mediator.mm

Issue 2908623004: [ios clean] Toolbar displays total number of tabs. (Closed)
Patch Set: Add comment. Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | ios/clean/chrome/browser/ui/toolbar/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #import "ios/clean/chrome/browser/ui/tab_collection/tab_collection_mediator.h" 5 #import "ios/clean/chrome/browser/ui/tab_collection/tab_collection_mediator.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/scoped_observer.h" 8 #include "base/scoped_observer.h"
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #import "ios/chrome/browser/web_state_list/web_state_list.h" 10 #import "ios/chrome/browser/web_state_list/web_state_list.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 #pragma mark - Public 43 #pragma mark - Public
44 44
45 - (void)disconnect { 45 - (void)disconnect {
46 self.webStateList = nullptr; 46 self.webStateList = nullptr;
47 } 47 }
48 48
49 #pragma mark - Properties 49 #pragma mark - Properties
50 50
51 - (void)setWebStateList:(WebStateList*)webStateList { 51 - (void)setWebStateList:(WebStateList*)webStateList {
52 // TODO(crbug.com/727427):Add support for DCHECK(webStateList).
52 _scopedWebStateListObserver->RemoveAll(); 53 _scopedWebStateListObserver->RemoveAll();
53 _webStateList = webStateList; 54 _webStateList = webStateList;
54 [self populateConsumerItems]; 55 [self populateConsumerItems];
55 if (_webStateList) { 56 if (_webStateList) {
56 _scopedWebStateListObserver->Add(_webStateList); 57 _scopedWebStateListObserver->Add(_webStateList);
57 } 58 }
58 } 59 }
59 60
60 - (void)setConsumer:(id<TabCollectionConsumer>)consumer { 61 - (void)setConsumer:(id<TabCollectionConsumer>)consumer {
61 _consumer = consumer; 62 _consumer = consumer;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 138
138 - (void)populateConsumerItems { 139 - (void)populateConsumerItems {
139 if (self.consumer && self.webStateList) { 140 if (self.consumer && self.webStateList) {
140 [self.consumer populateItems:[self tabCollectionItemsFromWebStateList: 141 [self.consumer populateItems:[self tabCollectionItemsFromWebStateList:
141 self.webStateList]]; 142 self.webStateList]];
142 [self.consumer selectItemAtIndex:self.webStateList->active_index()]; 143 [self.consumer selectItemAtIndex:self.webStateList->active_index()];
143 } 144 }
144 } 145 }
145 146
146 @end 147 @end
OLDNEW
« no previous file with comments | « no previous file | ios/clean/chrome/browser/ui/toolbar/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698