#include "chrome/browser/ui/views/profiles/profile_picker_dice_reauth_provider.h"
#include "base/functional/bind.h"
#include "base/metrics/histogram_functions.h"
#include "base/time/time.h"
#include "chrome/browser/profiles/keep_alive/profile_keep_alive_types.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/dice_response_handler.h"
#include "chrome/browser/signin/dice_tab_helper.h"
#include "chrome/browser/signin/force_signin_verifier.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/signin/signin_promo.h"
#include "chrome/browser/ui/views/profiles/profile_picker_view.h"
#include "chrome/browser/ui/views/profiles/profile_picker_web_contents_host.h"
#include "chrome/browser/ui/webui/signin/signin_ui_error.h"
#include "chrome/common/webui_url_constants.h"
#include "components/signin/public/base/signin_switches.h"
#include "components/signin/public/identity_manager/accounts_mutator.h"
#include "components/signin/public/identity_manager/identity_manager.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/web_contents.h"
#include "google_apis/gaia/gaia_urls.h"
namespace {
void RecordReauthResult(ProfilePickerReauthResult result) { … }
GURL GetLoadingScreenURL() { … }
GURL GetReauthURL(const std::string& email_to_reauth, GURL continue_url) { … }
ReauthUIError ComputeReauthUIError(ProfilePickerReauthResult result) { … }
}
ProfilePickerDiceReauthProvider::ProfilePickerDiceReauthProvider(
ProfilePickerWebContentsHost* host,
Profile* profile,
const std::string& gaia_id_to_reauth,
const std::string& email_to_reauth,
base::OnceCallback<void(bool, ReauthUIError)> on_reauth_completed)
: … { … }
ProfilePickerDiceReauthProvider::~ProfilePickerDiceReauthProvider() = default;
void ProfilePickerDiceReauthProvider::SwitchToReauth() { … }
void ProfilePickerDiceReauthProvider::OnRefreshTokensLoaded() { … }
void ProfilePickerDiceReauthProvider::OnForceSigninVerifierTimeOut() { … }
void ProfilePickerDiceReauthProvider::TryCreateForceSigninVerifier() { … }
void ProfilePickerDiceReauthProvider::OnTokenFetchComplete(
bool token_is_valid) { … }
void ProfilePickerDiceReauthProvider::ShowReauth() { … }
void ProfilePickerDiceReauthProvider::OnDiceSigninHeaderReceived() { … }
void ProfilePickerDiceReauthProvider::OnSigninError(
Profile* profile,
content::WebContents* web_contents,
const SigninUIError& error) { … }
void ProfilePickerDiceReauthProvider::DidFinishNavigation(
content::NavigationHandle* navigation_handle) { … }
void ProfilePickerDiceReauthProvider::OnRefreshTokenUpdatedForAccount(
const CoreAccountInfo& account_info) { … }
void ProfilePickerDiceReauthProvider::Finish(bool success,
ProfilePickerReauthResult result) { … }