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

Unified Diff: chrome/browser/ui/webui/settings/people_handler.cc

Issue 2591093002: [MD Settings][People] Force sign out only in the case of unrecoverable error (Closed)
Patch Set: Fixed compilation error Created 4 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/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 642b7c8ee54d78c273b51efd755a72dc77ff204b..35e1d2d647d54b174c0d7ead91622acbcbad0087 100644
--- a/chrome/browser/ui/webui/settings/people_handler.cc
+++ b/chrome/browser/ui/webui/settings/people_handler.cc
@@ -156,6 +156,8 @@ std::string GetSyncErrorAction(sync_ui_util::ActionType action_type) {
switch (action_type) {
case sync_ui_util::REAUTHENTICATE:
return "reauthenticate";
+ case sync_ui_util::SIGNOUT_AND_SIGNIN:
+ return "signOutAndSignIn";
case sync_ui_util::UPGRADE_CLIENT:
return "upgradeClient";
case sync_ui_util::ENTER_PASSPHRASE:
@@ -505,7 +507,7 @@ void PeopleHandler::HandleShowSetupUI(const base::ListValue* args) {
return;
}
- OpenSyncSetup(false /* creating_supervised_user */);
+ OpenSyncSetup();
}
#if defined(OS_CHROMEOS)
@@ -521,11 +523,12 @@ void PeopleHandler::HandleAttemptUserExit(const base::ListValue* args) {
void PeopleHandler::HandleStartSignin(const base::ListValue* args) {
AllowJavascript();
- // Should only be called if the user is not already signed in.
- DCHECK(!SigninManagerFactory::GetForProfile(profile_)->IsAuthenticated());
- bool creating_supervised_user = false;
- args->GetBoolean(0, &creating_supervised_user);
- OpenSyncSetup(creating_supervised_user);
+ // Should only be called if the user is not already signed in or has an auth
+ // error.
+ DCHECK(!SigninManagerFactory::GetForProfile(profile_)->IsAuthenticated() ||
+ SigninErrorControllerFactory::GetForProfile(profile_)->HasError());
+
+ OpenSyncSetup();
}
void PeopleHandler::HandleStopSyncing(const base::ListValue* args) {
@@ -623,7 +626,7 @@ void PeopleHandler::CloseSyncSetup() {
configuring_sync_ = false;
}
-void PeopleHandler::OpenSyncSetup(bool creating_supervised_user) {
+void PeopleHandler::OpenSyncSetup() {
// Notify services that login UI is now active.
GetLoginUIService()->SetLoginUI(this);
@@ -643,18 +646,14 @@ void PeopleHandler::OpenSyncSetup(bool creating_supervised_user) {
// sync configure UI, not login UI).
// 7) User re-enables sync after disabling it via advanced settings.
#if !defined(OS_CHROMEOS)
- SigninManagerBase* signin = SigninManagerFactory::GetForProfile(profile_);
- if (!signin->IsAuthenticated() ||
+ if (!SigninManagerFactory::GetForProfile(profile_)->IsAuthenticated() ||
SigninErrorControllerFactory::GetForProfile(profile_)->HasError()) {
// User is not logged in (cases 1-2), or login has been specially requested
// because previously working credentials have expired (case 3). Close sync
// 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(
- creating_supervised_user ?
- signin_metrics::AccessPoint::ACCESS_POINT_SUPERVISED_USER :
- signin_metrics::AccessPoint::ACCESS_POINT_SETTINGS);
+ DisplayGaiaLogin(signin_metrics::AccessPoint::ACCESS_POINT_SETTINGS);
return;
}
#endif
« no previous file with comments | « chrome/browser/ui/webui/settings/people_handler.h ('k') | chrome/browser/ui/webui/settings/people_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698