Commit 942d5843 authored by David Roger's avatar David Roger Committed by Commit Bot

[signin] Remove dead code

Change-Id: Iff5a926e97bbe177c510b44414a47b4c28a94715
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1849379Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Commit-Queue: David Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704195}
parent 043a35bf
...@@ -78,10 +78,6 @@ class ProxyingURLLoaderFactory : public network::mojom::URLLoaderFactory { ...@@ -78,10 +78,6 @@ class ProxyingURLLoaderFactory : public network::mojom::URLLoaderFactory {
void RemoveRequest(InProgressRequest* request); void RemoveRequest(InProgressRequest* request);
void MaybeDestroySelf(); void MaybeDestroySelf();
const content::WebContents::Getter& web_contents_getter() {
return web_contents_getter_;
}
std::unique_ptr<HeaderModificationDelegate> delegate_; std::unique_ptr<HeaderModificationDelegate> delegate_;
content::WebContents::Getter web_contents_getter_; content::WebContents::Getter web_contents_getter_;
......
...@@ -120,11 +120,6 @@ class DiceResponseHandler : public KeyedService { ...@@ -120,11 +120,6 @@ class DiceResponseHandler : public KeyedService {
// Deletes the token fetcher. // Deletes the token fetcher.
void DeleteTokenFetcher(DiceTokenFetcher* token_fetcher); void DeleteTokenFetcher(DiceTokenFetcher* token_fetcher);
// Returns true if it is acceptable to get a new token for the account.
// Always returns true when using kDice.
bool CanGetTokenForAccount(const std::string& gaia_id,
const std::string& email);
// Process the Dice signin action. // Process the Dice signin action.
void ProcessDiceSigninHeader( void ProcessDiceSigninHeader(
const std::string& gaia_id, const std::string& gaia_id,
......
...@@ -47,13 +47,6 @@ bool SigninGlobalError::HasError() { ...@@ -47,13 +47,6 @@ bool SigninGlobalError::HasError() {
return HasMenuItem(); return HasMenuItem();
} }
void SigninGlobalError::AttemptToFixError(Browser* browser) {
if (!HasError())
return;
ExecuteMenuItem(browser);
}
void SigninGlobalError::Shutdown() { void SigninGlobalError::Shutdown() {
error_controller_->RemoveObserver(this); error_controller_->RemoveObserver(this);
error_controller_ = NULL; error_controller_ = NULL;
......
...@@ -27,10 +27,6 @@ class SigninGlobalError : public GlobalErrorWithStandardBubble, ...@@ -27,10 +27,6 @@ class SigninGlobalError : public GlobalErrorWithStandardBubble,
// Returns true if there is an authentication error. // Returns true if there is an authentication error.
bool HasError(); bool HasError();
// Shows re-authentication UI to the user in an attempt to fix the error.
// The re-authentication UI will be shown in |browser|.
void AttemptToFixError(Browser* browser);
private: private:
FRIEND_TEST_ALL_PREFIXES(SigninGlobalErrorTest, Basic); FRIEND_TEST_ALL_PREFIXES(SigninGlobalErrorTest, Basic);
FRIEND_TEST_ALL_PREFIXES(SigninGlobalErrorTest, AuthStatusEnumerateAllErrors); FRIEND_TEST_ALL_PREFIXES(SigninGlobalErrorTest, AuthStatusEnumerateAllErrors);
......
...@@ -175,23 +175,6 @@ void EnableSyncFromPromo( ...@@ -175,23 +175,6 @@ void EnableSyncFromPromo(
} }
} // namespace internal } // namespace internal
std::string GetDisplayEmail(Profile* profile, const std::string& account_id) {
signin::IdentityManager* identity_manager =
IdentityManagerFactory::GetForProfile(profile);
std::string email =
identity_manager
->FindExtendedAccountInfoForAccountWithRefreshTokenByAccountId(
account_id)
->email;
if (email.empty()) {
DCHECK_EQ(
signin::IdentityManager::AccountIdMigrationState::MIGRATION_NOT_STARTED,
identity_manager->GetAccountIdMigrationState());
return account_id;
}
return email;
}
std::vector<AccountInfo> GetAccountsForDicePromos(Profile* profile) { std::vector<AccountInfo> GetAccountsForDicePromos(Profile* profile) {
// Fetch account ids for accounts that have a token. // Fetch account ids for accounts that have a token.
signin::IdentityManager* identity_manager = signin::IdentityManager* identity_manager =
......
...@@ -53,12 +53,6 @@ void EnableSyncFromPromo(Browser* browser, ...@@ -53,12 +53,6 @@ void EnableSyncFromPromo(Browser* browser,
bool is_default_promo_account); bool is_default_promo_account);
#if BUILDFLAG(ENABLE_DICE_SUPPORT) #if BUILDFLAG(ENABLE_DICE_SUPPORT)
// Returns the display email string for the given account. If the profile
// has not been migrated to use gaia ids, then its possible for the display
// to not ne known yet. In this case, use |account_id|, which is assumed to
// be an email address.
std::string GetDisplayEmail(Profile* profile, const std::string& account_id);
// Returns the list of all accounts that have a token. The default account in // Returns the list of all accounts that have a token. The default account in
// the Gaia cookies will be the first account in the list. // the Gaia cookies will be the first account in the list.
std::vector<AccountInfo> GetAccountsForDicePromos(Profile* profile); std::vector<AccountInfo> GetAccountsForDicePromos(Profile* profile);
......
...@@ -69,7 +69,6 @@ class UserManagerScreenHandler : public content::WebUIMessageHandler, ...@@ -69,7 +69,6 @@ class UserManagerScreenHandler : public content::WebUIMessageHandler,
void HandleRemoveUser(const base::ListValue* args); void HandleRemoveUser(const base::ListValue* args);
void HandleAreAllProfilesLocked(const base::ListValue* args); void HandleAreAllProfilesLocked(const base::ListValue* args);
void HandleRemoveUserWarningLoadStats(const base::ListValue* args); void HandleRemoveUserWarningLoadStats(const base::ListValue* args);
void HandleGetRemoveWarningDialogMessage(const base::ListValue* args);
// Function used to gather statistics from a profile. // Function used to gather statistics from a profile.
void GatherStatistics(base::Time start_time, Profile* profile); void GatherStatistics(base::Time start_time, Profile* profile);
......
...@@ -253,8 +253,6 @@ class AccountReconcilor : public KeyedService, ...@@ -253,8 +253,6 @@ class AccountReconcilor : public KeyedService,
void UnregisterWithAllDependencies(); void UnregisterWithAllDependencies();
void RegisterWithIdentityManager(); void RegisterWithIdentityManager();
void UnregisterWithIdentityManager(); void UnregisterWithIdentityManager();
void RegisterWithCookieManagerService();
void UnregisterWithCookieManagerService();
void RegisterWithContentSettings(); void RegisterWithContentSettings();
void UnregisterWithContentSettings(); void UnregisterWithContentSettings();
......
...@@ -46,27 +46,4 @@ std::string SigninStatusFieldToString(TimedSigninStatusField field) { ...@@ -46,27 +46,4 @@ std::string SigninStatusFieldToString(TimedSigninStatusField field) {
return std::string(); return std::string();
} }
std::string TokenPrefPath(const std::string& token_name) {
return std::string(kTokenPrefPrefix) + token_name;
}
// Gets the first few hex characters of the SHA256 hash of the passed in string.
// These are enough to perform equality checks across a single users tokens,
// while preventing outsiders from reverse-engineering the actual token from
// the displayed value.
// Note that for readability (in about:signin-internals), an empty string
// is not hashed, but simply returned as an empty string.
std::string GetTruncatedHash(const std::string& str) {
if (str.empty())
return str;
// Since each character in the hash string generates two hex charaters
// we only need half as many charaters in |hash_val| as hex characters
// returned.
const int kTruncateSize = kTruncateTokenStringLength / 2;
char hash_val[kTruncateSize];
crypto::SHA256HashString(str, &hash_val[0], kTruncateSize);
return base::ToLowerASCII(base::HexEncode(&hash_val[0], kTruncateSize));
}
} // namespace signin_internals_util } // namespace signin_internals_util
...@@ -19,9 +19,6 @@ namespace signin_internals_util { ...@@ -19,9 +19,6 @@ namespace signin_internals_util {
extern const char kSigninPrefPrefix[]; extern const char kSigninPrefPrefix[];
extern const char kTokenPrefPrefix[]; extern const char kTokenPrefPrefix[];
// The length of strings returned by GetTruncatedHash() below.
const size_t kTruncateTokenStringLength = 6;
// Helper enums to access fields from SigninStatus (declared below). // Helper enums to access fields from SigninStatus (declared below).
enum { enum {
SIGNIN_FIELDS_BEGIN = 0, SIGNIN_FIELDS_BEGIN = 0,
...@@ -54,23 +51,10 @@ enum { ...@@ -54,23 +51,10 @@ enum {
SIGNIN_FIELDS_COUNT = SIGNIN_FIELDS_END - SIGNIN_FIELDS_BEGIN SIGNIN_FIELDS_COUNT = SIGNIN_FIELDS_END - SIGNIN_FIELDS_BEGIN
}; };
// Returns the root preference path for the service. The path should be
// qualified with one of .value, .status or .time to get the respective
// full preference path names.
std::string TokenPrefPath(const std::string& service_name);
// Returns the name of a SigninStatus field. // Returns the name of a SigninStatus field.
std::string SigninStatusFieldToString(UntimedSigninStatusField field); std::string SigninStatusFieldToString(UntimedSigninStatusField field);
std::string SigninStatusFieldToString(TimedSigninStatusField field); std::string SigninStatusFieldToString(TimedSigninStatusField field);
// Gets the first 6 hex characters of the SHA256 hash of the passed in string.
// These are enough to perform equality checks across a single users tokens,
// while preventing outsiders from reverse-engineering the actual token from
// the displayed value.
// Note that for readability (in about:signin-internals), an empty string
// is not hashed, but simply returned as an empty string.
std::string GetTruncatedHash(const std::string& str);
} // namespace signin_internals_util } // namespace signin_internals_util
#endif // COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_INTERNALS_UTIL_H_ #endif // COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_INTERNALS_UTIL_H_
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