diff options
Diffstat (limited to 'chromium/chrome/browser/ui/webui/welcome')
-rw-r--r-- | chromium/chrome/browser/ui/webui/welcome/welcome_handler.cc | 30 | ||||
-rw-r--r-- | chromium/chrome/browser/ui/webui/welcome/welcome_handler.h | 29 |
2 files changed, 15 insertions, 44 deletions
diff --git a/chromium/chrome/browser/ui/webui/welcome/welcome_handler.cc b/chromium/chrome/browser/ui/webui/welcome/welcome_handler.cc index e27ea67e305..78991207d00 100644 --- a/chromium/chrome/browser/ui/webui/welcome/welcome_handler.cc +++ b/chromium/chrome/browser/ui/webui/welcome/welcome_handler.cc @@ -23,15 +23,11 @@ const char kWelcomeReturningUserUrl[] = "chrome://welcome/returning-user"; WelcomeHandler::WelcomeHandler(content::WebUI* web_ui) : profile_(Profile::FromWebUI(web_ui)), - login_ui_service_(LoginUIServiceFactory::GetForProfile(profile_)), result_(WelcomeResult::DEFAULT), is_redirected_welcome_impression_(false) { - login_ui_service_->AddObserver(this); } WelcomeHandler::~WelcomeHandler() { - login_ui_service_->RemoveObserver(this); - // If this instance is spawned due to being redirected back to welcome page // by the onboarding logic, there's no need to log sign-in metrics again. if (is_redirected_welcome_impression_) { @@ -55,24 +51,9 @@ bool WelcomeHandler::isValidRedirectUrl() { return current_url == kWelcomeReturningUserUrl; } -// Override from LoginUIService::Observer. -void WelcomeHandler::OnSyncConfirmationUIClosed( - LoginUIService::SyncConfirmationUIClosedResult result) { - if (result != LoginUIService::ABORT_SIGNIN) { - result_ = WelcomeResult::SIGNED_IN; - - // When signed in from welcome flow, it's possible to come back to - // chrome://welcome/... after closing sync-confirmation UI. If current URL - // matches such a case, do not navigate away. - if (!is_redirected_welcome_impression_) { - GoToNewTabPage(); - } - } -} - // Handles backend events necessary when user clicks "Sign in." void WelcomeHandler::HandleActivateSignIn(const base::ListValue* args) { - result_ = WelcomeResult::ATTEMPTED; + result_ = WelcomeResult::STARTED_SIGN_IN; base::RecordAction(base::UserMetricsAction("WelcomePage_SignInClicked")); if (IdentityManagerFactory::GetForProfile(profile_)->HasPrimaryAccount()) { @@ -97,14 +78,9 @@ void WelcomeHandler::HandleActivateSignIn(const base::ListValue* args) { } } -// Handles backend events necessary when user clicks "No thanks." +// Handles backend events necessary when user clicks "Get started." void WelcomeHandler::HandleUserDecline(const base::ListValue* args) { - // Set the appropriate decline result, based on whether or not the user - // attempted to sign in. - result_ = (result_ == WelcomeResult::ATTEMPTED) - ? WelcomeResult::ATTEMPTED_DECLINED - : WelcomeResult::DECLINED; - + result_ = WelcomeResult::DECLINED_SIGN_IN; GoToNewTabPage(); } diff --git a/chromium/chrome/browser/ui/webui/welcome/welcome_handler.h b/chromium/chrome/browser/ui/webui/welcome/welcome_handler.h index e34e4b8ac67..430f3790d9c 100644 --- a/chromium/chrome/browser/ui/webui/welcome/welcome_handler.h +++ b/chromium/chrome/browser/ui/webui/welcome/welcome_handler.h @@ -14,16 +14,11 @@ class Profile; class GURL; // Handles actions on Welcome page. -class WelcomeHandler : public content::WebUIMessageHandler, - public LoginUIService::Observer { +class WelcomeHandler : public content::WebUIMessageHandler { public: explicit WelcomeHandler(content::WebUI* web_ui); ~WelcomeHandler() override; - // LoginUIService::Observer: - void OnSyncConfirmationUIClosed( - LoginUIService::SyncConfirmationUIClosedResult result) override; - // content::WebUIMessageHandler: void RegisterMessages() override; @@ -31,17 +26,18 @@ class WelcomeHandler : public content::WebUIMessageHandler, enum WelcomeResult { // User navigated away from page. DEFAULT = 0, - // User clicked the "No Thanks" button. - DECLINED = 1, - // User completed sign-in flow. - SIGNED_IN = 2, - // User attempted sign-in flow, then navigated away. - ATTEMPTED = 3, - // User attempted sign-in flow, then clicked "No Thanks." - ATTEMPTED_DECLINED = 4, - + // User clicked the "Get Started" button. + DECLINED_SIGN_IN = 1, + // DEPRECATED: User completed sign-in flow. + // SIGNED_IN = 2, + // DEPRECATED: User attempted sign-in flow, then navigated away. + // ATTEMPTED = 3, + // DEPRECATED: User attempted sign-in flow, then clicked "No Thanks." + // ATTEMPTED_DECLINED = 4, + // User started the sign-in flow. + STARTED_SIGN_IN = 5, // New results must be added before this line, and should correspond to - // values in tools/metrics/histograms/histograms.xml. + // values in tools/metrics/histograms/enums.xml. WELCOME_RESULT_MAX }; @@ -54,7 +50,6 @@ class WelcomeHandler : public content::WebUIMessageHandler, Browser* GetBrowser(); Profile* profile_; - LoginUIService* login_ui_service_; WelcomeResult result_; // Indicates whether this WelcomeHandler instance is spawned due to users |