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 |