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

Side by Side Diff: ios/chrome/browser/ui/authentication/signin_account_selector_view_controller.mm

Issue 2622103005: [Signin iOS] Reload the Account Selector screen when identities change (Closed)
Patch Set: Created 3 years, 11 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include "ios/chrome/browser/ui/authentication/signin_account_selector_view_cont roller.h" 5 #include "ios/chrome/browser/ui/authentication/signin_account_selector_view_cont roller.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #import "base/mac/foundation_util.h" 9 #import "base/mac/foundation_util.h"
10 #import "base/mac/scoped_nsobject.h" 10 #import "base/mac/scoped_nsobject.h"
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 } else if (item.type == ItemTypeAddAccount) { 249 } else if (item.type == ItemTypeAddAccount) {
250 [self.delegate accountSelectorControllerDidSelectAddAccount:self]; 250 [self.delegate accountSelectorControllerDidSelectAddAccount:self];
251 } 251 }
252 } 252 }
253 253
254 #pragma mark - ChromeIdentityServiceObserver 254 #pragma mark - ChromeIdentityServiceObserver
255 255
256 - (void)onIdentityListChanged { 256 - (void)onIdentityListChanged {
257 ChromeIdentity* selectedIdentity = [self selectedIdentity]; 257 ChromeIdentity* selectedIdentity = [self selectedIdentity];
258 [self loadModel]; 258 [self loadModel];
259 [self.collectionView reloadData];
259 260
260 // Reselect the identity. 261 // Reselect the identity.
261 if (!selectedIdentity) { 262 if (!selectedIdentity) {
262 return; 263 return;
263 } 264 }
264 NSArray* accountItems = [self.collectionViewModel 265 NSArray* accountItems = [self.collectionViewModel
265 itemsInSectionWithIdentifier:SectionIdentifierAccounts]; 266 itemsInSectionWithIdentifier:SectionIdentifierAccounts];
266 for (CollectionViewAccountItem* accountItem in accountItems) { 267 for (CollectionViewAccountItem* accountItem in accountItems) {
267 if ([accountItem.chromeIdentity.gaiaID 268 if ([accountItem.chromeIdentity.gaiaID
268 isEqualToString:selectedIdentity.gaiaID]) { 269 isEqualToString:selectedIdentity.gaiaID]) {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 [self.collectionViewModel itemTypeForIndexPath:indexPath]; 324 [self.collectionViewModel itemTypeForIndexPath:indexPath];
324 return (itemType == ItemTypeTitle); 325 return (itemType == ItemTypeTitle);
325 } 326 }
326 327
327 - (BOOL)collectionView:(nonnull UICollectionView*)collectionView 328 - (BOOL)collectionView:(nonnull UICollectionView*)collectionView
328 shouldHideItemBackgroundAtIndexPath:(nonnull NSIndexPath*)indexPath { 329 shouldHideItemBackgroundAtIndexPath:(nonnull NSIndexPath*)indexPath {
329 return YES; 330 return YES;
330 } 331 }
331 332
332 @end 333 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698