Commit be9261a7 authored by Jérôme Lebel's avatar Jérôme Lebel Committed by Commit Bot

[iOS] Removing methods about canonicalize emails

ChromeIdentityService::GetCanonicalizeEmailsForAllIdentities()
is unused.
And also removing GetCanonicalizedEmailForIdentity(), this function
is only used in AuthenticationService. This method can use the user
email instead of the canonicalize email.

The implementation is removed with:
crrev.com/i/3326972.

Change-Id: I9f74f5bfffb2fec77bc4ee3fd220a1ae403fe60c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2465854Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Commit-Queue: Jérôme Lebel <jlebel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#816518}
parent e5ce4b07
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
#include "ios/chrome/browser/crash_report/crash_keys_helper.h" #include "ios/chrome/browser/crash_report/crash_keys_helper.h"
#include "ios/chrome/browser/pref_names.h" #include "ios/chrome/browser/pref_names.h"
#import "ios/chrome/browser/signin/authentication_service_delegate.h" #import "ios/chrome/browser/signin/authentication_service_delegate.h"
#include "ios/chrome/browser/signin/constants.h"
#include "ios/chrome/browser/signin/signin_util.h"
#include "ios/chrome/browser/sync/sync_setup_service.h" #include "ios/chrome/browser/sync/sync_setup_service.h"
#include "ios/chrome/browser/system_flags.h" #include "ios/chrome/browser/system_flags.h"
#include "ios/public/provider/chrome/browser/chrome_browser_provider.h" #include "ios/public/provider/chrome/browser/chrome_browser_provider.h"
...@@ -310,7 +308,7 @@ void AuthenticationService::SignIn(ChromeIdentity* identity) { ...@@ -310,7 +308,7 @@ void AuthenticationService::SignIn(ChromeIdentity* identity) {
const CoreAccountId account_id = identity_manager_->PickAccountIdForAccount( const CoreAccountId account_id = identity_manager_->PickAccountIdForAccount(
base::SysNSStringToUTF8(identity.gaiaID), base::SysNSStringToUTF8(identity.gaiaID),
GetCanonicalizedEmailForIdentity(identity)); base::SysNSStringToUTF8(identity.userEmail));
// Load all credentials from SSO library. This must load the credentials // Load all credentials from SSO library. This must load the credentials
// for the primary account too. // for the primary account too.
......
...@@ -15,10 +15,6 @@ ...@@ -15,10 +15,6 @@
// Returns an NSArray of |scopes| as NSStrings. // Returns an NSArray of |scopes| as NSStrings.
NSArray* GetScopeArray(const std::set<std::string>& scopes); NSArray* GetScopeArray(const std::set<std::string>& scopes);
// Returns the canonicalized and sanitized user email for the given identity.
// Returns nil if the identity does not have any user email.
std::string GetCanonicalizedEmailForIdentity(ChromeIdentity* identity);
// Returns whether the given signin |error| should be handled. // Returns whether the given signin |error| should be handled.
// //
// Note that cancel errors and errors handled internally by the signin component // Note that cancel errors and errors handled internally by the signin component
......
...@@ -22,14 +22,6 @@ NSArray* GetScopeArray(const std::set<std::string>& scopes) { ...@@ -22,14 +22,6 @@ NSArray* GetScopeArray(const std::set<std::string>& scopes) {
return scopes_array; return scopes_array;
} }
std::string GetCanonicalizedEmailForIdentity(ChromeIdentity* identity) {
NSString* nsEmail = [identity userEmail];
if (!nsEmail)
return std::string();
std::string email = base::SysNSStringToUTF8(nsEmail);
return gaia::CanonicalizeEmail(gaia::SanitizeEmail(email));
}
bool ShouldHandleSigninError(NSError* error) { bool ShouldHandleSigninError(NSError* error) {
ios::SigninErrorProvider* provider = ios::SigninErrorProvider* provider =
ios::GetChromeBrowserProvider()->GetSigninErrorProvider(); ios::GetChromeBrowserProvider()->GetSigninErrorProvider();
......
...@@ -159,9 +159,6 @@ class ChromeIdentityService { ...@@ -159,9 +159,6 @@ class ChromeIdentityService {
// if no matching identity is found. // if no matching identity is found.
virtual ChromeIdentity* GetIdentityWithGaiaID(const std::string& gaia_id); virtual ChromeIdentity* GetIdentityWithGaiaID(const std::string& gaia_id);
// Returns the canonicalized emails for all identities.
virtual std::vector<std::string> GetCanonicalizeEmailsForAllIdentities();
// Returns true if there is at least one identity. // Returns true if there is at least one identity.
virtual bool HasIdentities(); virtual bool HasIdentities();
......
...@@ -70,11 +70,6 @@ ChromeIdentity* ChromeIdentityService::GetIdentityWithGaiaID( ...@@ -70,11 +70,6 @@ ChromeIdentity* ChromeIdentityService::GetIdentityWithGaiaID(
return nil; return nil;
} }
std::vector<std::string>
ChromeIdentityService::GetCanonicalizeEmailsForAllIdentities() {
return std::vector<std::string>();
}
bool ChromeIdentityService::HasIdentities() { bool ChromeIdentityService::HasIdentities() {
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment