Skip to content

Commit 5a36703

Browse files
Arthur-MilchiorChromium LUCI CQ
authored andcommitted
[iOS]Uses GaiaId type when possible in ['consistency promo']
GaiaId in iOS is currently often encoded as a NSString or more rarely a std::string. It should ideally be replaced by GaiaId, a c++ class that contains simply the gaia id (or an empty string to represents the id missing). In order for the migration not to break ios_internal, some virtual method has to be temporarily duplicated, taking both kind of arguments. In this case, both functions call the other function, and the classes inheriting this abstract class must implement one of the two functions. This is part of the chain + crrev.com/c/7003548 (that is splitted) - crrev.com/i/8634707 - crrev.com/c/7021136 - crrev.com/i/8650938 - crrev.com/c/7021672 This CL was uploaded by git cl split. Bug: 449195064 Change-Id: I06956f2ad2435cbec322d430f250c985640790c3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7025631 Auto-Submit: Arthur Milchior <[email protected]> Reviewed-by: Menghan Yang <[email protected]> Commit-Queue: Menghan Yang <[email protected]> Cr-Commit-Position: refs/heads/main@{#1532371}
1 parent 32ee0f8 commit 5a36703

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ios/chrome/browser/authentication/ui_bundled/signin/consistency_promo_signin/consistency_promo_signin_mediator.mm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#import "components/signin/public/identity_manager/accounts_in_cookie_jar_info.h"
1919
#import "components/signin/public/identity_manager/identity_manager.h"
2020
#import "components/signin/public/identity_manager/objc/identity_manager_observer_bridge.h"
21+
#import "google_apis/gaia/gaia_id.h"
2122
#import "ios/chrome/browser/authentication/ui_bundled/authentication_flow/authentication_flow.h"
2223
#import "ios/chrome/browser/authentication/ui_bundled/authentication_flow/authentication_flow_delegate.h"
2324
#import "ios/chrome/browser/authentication/ui_bundled/continuation.h"
@@ -50,7 +51,7 @@ @interface ConsistencyPromoSigninMediator () <
5051

5152
// List of gaia IDs added by the user with the consistency view. Used for
5253
// metrics.
53-
NSMutableSet* _addedGaiaIDs;
54+
base::flat_set<GaiaId> _addedGaiaIDs;
5455

5556
// Identity for the sign-in in progress.
5657
id<SystemIdentity> _signingIdentity;
@@ -107,7 +108,6 @@ @implementation ConsistencyPromoSigninMediator
107108
_authServiceObserverBridge =
108109
std::make_unique<AuthenticationServiceObserverBridge>(
109110
authenticationService, self);
110-
_addedGaiaIDs = [[NSMutableSet alloc] init];
111111
_identityManagerObserverBridge =
112112
std::make_unique<signin::IdentityManagerObserverBridge>(
113113
_identityManager, self);
@@ -158,7 +158,7 @@ - (void)disconnectWithResult:(SigninCoordinatorResult)signinResult {
158158
signin_metrics::AccountConsistencyPromoAction::
159159
SIGNED_IN_WITH_NO_DEVICE_ACCOUNT,
160160
_accessPoint);
161-
} else if ([_addedGaiaIDs containsObject:signingIdentity.gaiaID]) {
161+
} else if (_addedGaiaIDs.contains(signingIdentity.gaiaId)) {
162162
// Added identity.
163163
RecordConsistencyPromoUserAction(
164164
signin_metrics::AccountConsistencyPromoAction::
@@ -209,7 +209,7 @@ - (void)disconnectWithResult:(SigninCoordinatorResult)signinResult {
209209
}
210210

211211
- (void)systemIdentityAdded:(id<SystemIdentity>)identity {
212-
[_addedGaiaIDs addObject:identity.gaiaID];
212+
_addedGaiaIDs.insert(identity.gaiaId);
213213
}
214214

215215
- (void)signinWithAuthenticationFlow:(AuthenticationFlow*)authenticationFlow {

0 commit comments

Comments
 (0)