Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Unified Diff: chrome/browser/ui/webui/options/sync_setup_handler.cc

Issue 1473543002: Implement newly designed sign-in related histograms for desktop platorms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: format Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/options/sync_setup_handler.cc
diff --git a/chrome/browser/ui/webui/options/sync_setup_handler.cc b/chrome/browser/ui/webui/options/sync_setup_handler.cc
index 142ab3c489967a8aa7ebf42cb62576034ebe1a29..67ecc4370121c56fdd1af25b93ce26720c453278 100644
--- a/chrome/browser/ui/webui/options/sync_setup_handler.cc
+++ b/chrome/browser/ui/webui/options/sync_setup_handler.cc
@@ -335,16 +335,18 @@ void SyncSetupHandler::RegisterMessages() {
}
#if !defined(OS_CHROMEOS)
-void SyncSetupHandler::DisplayGaiaLogin() {
+void SyncSetupHandler::DisplayGaiaLogin(
+ signin_metrics::AccessPoint access_point) {
DCHECK(!sync_startup_tracker_);
// Advanced options are no longer being configured if the login screen is
// visible. If the user exits the signin wizard after this without
// configuring sync, CloseSyncSetup() will ensure they are logged out.
configuring_sync_ = false;
- DisplayGaiaLoginInNewTabOrWindow();
+ DisplayGaiaLoginInNewTabOrWindow(access_point);
}
-void SyncSetupHandler::DisplayGaiaLoginInNewTabOrWindow() {
+void SyncSetupHandler::DisplayGaiaLoginInNewTabOrWindow(
+ signin_metrics::AccessPoint access_point) {
Browser* browser = chrome::FindBrowserWithWebContents(
web_ui()->GetWebContents());
bool force_new_tab = false;
@@ -371,19 +373,21 @@ void SyncSetupHandler::DisplayGaiaLoginInNewTabOrWindow() {
if (!force_new_tab) {
browser->window()->ShowAvatarBubbleFromAvatarButton(
BrowserWindow::AVATAR_BUBBLE_MODE_REAUTH,
- signin::ManageAccountsParams());
+ signin::ManageAccountsParams(), access_point);
} else {
- url = signin::GetReauthURL(browser->profile(),
- error_controller->error_account_id());
+ url = signin::GetReauthURL(
+ access_point, signin_metrics::Reason::REASON_REAUTHENTICATION,
+ browser->profile(), error_controller->error_account_id());
}
} else {
- signin_metrics::LogSigninSource(signin_metrics::SOURCE_SETTINGS);
if (!force_new_tab) {
browser->window()->ShowAvatarBubbleFromAvatarButton(
BrowserWindow::AVATAR_BUBBLE_MODE_SIGNIN,
- signin::ManageAccountsParams());
+ signin::ManageAccountsParams(), access_point);
} else {
- url = signin::GetPromoURL(signin_metrics::SOURCE_SETTINGS, true);
+ url = signin::GetPromoURL(
+ access_point, signin_metrics::Reason::REASON_SIGNIN_PRIMARY_ACCOUNT,
+ true);
}
}
@@ -628,7 +632,7 @@ void SyncSetupHandler::HandleShowSetupUI(const base::ListValue* args) {
// If a setup wizard is present on this page or another, bring it to focus.
// Otherwise, display a new one on this page.
if (!FocusExistingWizardIfPresent())
- OpenSyncSetup();
+ OpenSyncSetup(args);
}
#if defined(OS_CHROMEOS)
@@ -645,7 +649,7 @@ void SyncSetupHandler::HandleStartSignin(const base::ListValue* args) {
// Should only be called if the user is not already signed in.
DCHECK(!SigninManagerFactory::GetForProfile(GetProfile())->
IsAuthenticated());
- OpenSyncSetup();
+ OpenSyncSetup(args);
}
void SyncSetupHandler::HandleStopSyncing(const base::ListValue* args) {
@@ -717,7 +721,7 @@ void SyncSetupHandler::CloseSyncSetup() {
configuring_sync_ = false;
}
-void SyncSetupHandler::OpenSyncSetup() {
+void SyncSetupHandler::OpenSyncSetup(const base::ListValue* args) {
if (!PrepareSyncSetup())
return;
@@ -743,7 +747,15 @@ void SyncSetupHandler::OpenSyncSetup() {
// setup including any visible overlays, and display the gaia auth page.
// Control will be returned to the sync settings page once auth is complete.
CloseUI();
- DisplayGaiaLogin();
+ if (args) {
+ std::string access_point = base::UTF16ToUTF8(ExtractStringValue(args));
+ if (access_point == "access-point-supervised-user") {
+ DisplayGaiaLogin(
+ signin_metrics::AccessPoint::ACCESS_POINT_SUPERVISED_USER);
+ return;
+ }
+ }
+ DisplayGaiaLogin(signin_metrics::AccessPoint::ACCESS_POINT_SETTINGS);
return;
}
#endif
« no previous file with comments | « chrome/browser/ui/webui/options/sync_setup_handler.h ('k') | chrome/browser/ui/webui/options/sync_setup_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698