Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/chrome/browser/ui/settings/sync_settings_collection_view_controller .h" | 5 #import "ios/chrome/browser/ui/settings/sync_settings_collection_view_controller .h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/mac/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
| (...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 957 [self stopBrowserStateServiceObservers]; | 957 [self stopBrowserStateServiceObservers]; |
| 958 [_authenticationFlow cancelAndDismiss]; | 958 [_authenticationFlow cancelAndDismiss]; |
| 959 } | 959 } |
| 960 | 960 |
| 961 #pragma mark - ChromeIdentityServiceObserver | 961 #pragma mark - ChromeIdentityServiceObserver |
| 962 | 962 |
| 963 - (void)onProfileUpdate:(ChromeIdentity*)identity { | 963 - (void)onProfileUpdate:(ChromeIdentity*)identity { |
| 964 CollectionViewAccountItem* item = | 964 CollectionViewAccountItem* item = |
| 965 base::mac::ObjCCastStrict<CollectionViewAccountItem>( | 965 base::mac::ObjCCastStrict<CollectionViewAccountItem>( |
| 966 [_identityMap objectForKey:identity.gaiaID]); | 966 [_identityMap objectForKey:identity.gaiaID]); |
| 967 if (item) { | |
|
lpromero
2017/05/03 10:05:57
Isn't it "if (!item)"?
Please also change the des
jlebel
2017/05/03 11:05:01
Done.
| |
| 968 // Ignoring unknown identity. | |
| 969 return; | |
| 970 } | |
| 967 [self updateAccountItem:item withIdentity:identity]; | 971 [self updateAccountItem:item withIdentity:identity]; |
| 968 [self reconfigureCellsForItems:@[ item ] | 972 [self reconfigureCellsForItems:@[ item ] |
| 969 inSectionWithIdentifier:SectionIdentifierSyncAccounts]; | 973 inSectionWithIdentifier:SectionIdentifierSyncAccounts]; |
| 970 } | 974 } |
| 971 | 975 |
| 972 - (void)onChromeIdentityServiceWillBeDestroyed { | 976 - (void)onChromeIdentityServiceWillBeDestroyed { |
| 973 _identityServiceObserver.reset(); | 977 _identityServiceObserver.reset(); |
| 974 } | 978 } |
| 975 | 979 |
| 976 @end | 980 @end |
| OLD | NEW |