Chromium Code Reviews| Index: chrome/browser/ui/webui/settings/people_handler.cc |
| diff --git a/chrome/browser/ui/webui/settings/people_handler.cc b/chrome/browser/ui/webui/settings/people_handler.cc |
| index ffb02c86bbe84b5c77c26634ee626ccb6f7097a1..07daa40592258cdc0478d9e3bb2c3da14ba51dd9 100644 |
| --- a/chrome/browser/ui/webui/settings/people_handler.cc |
| +++ b/chrome/browser/ui/webui/settings/people_handler.cc |
| @@ -601,7 +601,7 @@ void PeopleHandler::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(args); |
| + OpenSyncSetup(false /* creating_supervised_user */); |
| } |
| #if defined(OS_CHROMEOS) |
| @@ -617,7 +617,11 @@ void PeopleHandler::HandleDoSignOutOnAuthError(const base::ListValue* args) { |
| void PeopleHandler::HandleStartSignin(const base::ListValue* args) { |
| // Should only be called if the user is not already signed in. |
| DCHECK(!SigninManagerFactory::GetForProfile(profile_)->IsAuthenticated()); |
| - OpenSyncSetup(args); |
| + bool creating_supervised_user = false; |
| + std::string access_point; |
| + if (args->GetString(0, &access_point)) |
| + creating_supervised_user = access_point == "access-point-supervised-user"; |
|
dschuyler
2016/01/20 02:16:21
(optional) What do you think of:
std::string acce
tommycli
2016/01/20 19:17:12
Done.
|
| + OpenSyncSetup(creating_supervised_user); |
| } |
| void PeopleHandler::HandleStopSyncing(const base::ListValue* args) { |
| @@ -699,7 +703,7 @@ void PeopleHandler::CloseSyncSetup() { |
| configuring_sync_ = false; |
| } |
| -void PeopleHandler::OpenSyncSetup(const base::ListValue* args) { |
| +void PeopleHandler::OpenSyncSetup(bool creating_supervised_user) { |
| if (!PrepareSyncSetup()) |
| return; |
| @@ -724,15 +728,9 @@ void PeopleHandler::OpenSyncSetup(const base::ListValue* args) { |
| // 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(); |
| - 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); |
| + DisplayGaiaLogin(creating_supervised_user ? |
| + signin_metrics::AccessPoint::ACCESS_POINT_SUPERVISED_USER : |
| + signin_metrics::AccessPoint::ACCESS_POINT_SETTINGS); |
| return; |
| } |
| #endif |