OLD | NEW |
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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 NSArray* accountItems = [self.collectionViewModel | 237 NSArray* accountItems = [self.collectionViewModel |
238 itemsInSectionWithIdentifier:SectionIdentifierAccounts]; | 238 itemsInSectionWithIdentifier:SectionIdentifierAccounts]; |
239 for (CollectionViewAccountItem* accountItem in accountItems) { | 239 for (CollectionViewAccountItem* accountItem in accountItems) { |
240 if (accountItem != selectedAccountItem && | 240 if (accountItem != selectedAccountItem && |
241 accountItem.accessoryType != MDCCollectionViewCellAccessoryNone) { | 241 accountItem.accessoryType != MDCCollectionViewCellAccessoryNone) { |
242 // TODO(crbug.com/631486) : Checkmark animation. | 242 // TODO(crbug.com/631486) : Checkmark animation. |
243 accountItem.accessoryType = MDCCollectionViewCellAccessoryNone; | 243 accountItem.accessoryType = MDCCollectionViewCellAccessoryNone; |
244 [reloadItems addObject:accountItem]; | 244 [reloadItems addObject:accountItem]; |
245 } | 245 } |
246 } | 246 } |
247 [self reconfigureCellsForItems:reloadItems | 247 [self reconfigureCellsForItems:reloadItems]; |
248 inSectionWithIdentifier:SectionIdentifierAccounts]; | |
249 } else if (item.type == ItemTypeAddAccount) { | 248 } else if (item.type == ItemTypeAddAccount) { |
250 [self.delegate accountSelectorControllerDidSelectAddAccount:self]; | 249 [self.delegate accountSelectorControllerDidSelectAddAccount:self]; |
251 } | 250 } |
252 } | 251 } |
253 | 252 |
254 #pragma mark - ChromeIdentityServiceObserver | 253 #pragma mark - ChromeIdentityServiceObserver |
255 | 254 |
256 - (void)onIdentityListChanged { | 255 - (void)onIdentityListChanged { |
257 ChromeIdentity* selectedIdentity = [self selectedIdentity]; | 256 ChromeIdentity* selectedIdentity = [self selectedIdentity]; |
258 [self loadModel]; | 257 [self loadModel]; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 [self.collectionViewModel itemTypeForIndexPath:indexPath]; | 323 [self.collectionViewModel itemTypeForIndexPath:indexPath]; |
325 return (itemType == ItemTypeTitle); | 324 return (itemType == ItemTypeTitle); |
326 } | 325 } |
327 | 326 |
328 - (BOOL)collectionView:(nonnull UICollectionView*)collectionView | 327 - (BOOL)collectionView:(nonnull UICollectionView*)collectionView |
329 shouldHideItemBackgroundAtIndexPath:(nonnull NSIndexPath*)indexPath { | 328 shouldHideItemBackgroundAtIndexPath:(nonnull NSIndexPath*)indexPath { |
330 return YES; | 329 return YES; |
331 } | 330 } |
332 | 331 |
333 @end | 332 @end |
OLD | NEW |