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

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

Issue 2102803002: Settings People Revamp: Add special Disconnect logic for domain profiles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address test feedback Created 4 years, 6 months 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 12333121c3ebc2a1bf2423020acd30304de34379..4840d92fa710e2ecd4345e7b97c509de8fea17ea 100644
--- a/chrome/browser/ui/webui/settings/people_handler.cc
+++ b/chrome/browser/ui/webui/settings/people_handler.cc
@@ -514,19 +514,21 @@ void PeopleHandler::HandleStartSignin(const base::ListValue* args) {
}
void PeopleHandler::HandleStopSyncing(const base::ListValue* args) {
- if (GetSyncService())
- ProfileSyncService::SyncEvent(ProfileSyncService::STOP_FROM_OPTIONS);
-
bool delete_profile = false;
args->GetBoolean(0, &delete_profile);
- signin_metrics::SignoutDelete delete_metric =
- delete_profile ? signin_metrics::SignoutDelete::DELETED
- : signin_metrics::SignoutDelete::KEEPING;
- SigninManagerFactory::GetForProfile(profile_)
- ->SignOut(signin_metrics::USER_CLICKED_SIGNOUT_SETTINGS, delete_metric);
+
+ if (!SigninManagerFactory::GetForProfile(profile_)->IsSignoutProhibited()) {
+ if (GetSyncService())
+ ProfileSyncService::SyncEvent(ProfileSyncService::STOP_FROM_OPTIONS);
+
+ signin_metrics::SignoutDelete delete_metric =
+ delete_profile ? signin_metrics::SignoutDelete::DELETED
+ : signin_metrics::SignoutDelete::KEEPING;
+ SigninManagerFactory::GetForProfile(profile_)
+ ->SignOut(signin_metrics::USER_CLICKED_SIGNOUT_SETTINGS, delete_metric);
+ }
if (delete_profile) {
- // Do as BrowserOptionsHandler::DeleteProfile().
webui::DeleteProfileAtPath(profile_->GetPath(),
web_ui(),
ProfileMetrics::DELETE_PROFILE_SETTINGS);

Powered by Google App Engine
This is Rietveld 408576698