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

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

Issue 863063002: Don't allow profile deletion in Metro mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: js nits Created 5 years, 11 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/options/browser_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc
index 68c75870c2c0ca005a756ec3969a37775e537350..165f46e9ea225e114c93b1e48e9c5cbd4ab3ae60 100644
--- a/chrome/browser/ui/webui/options/browser_options_handler.cc
+++ b/chrome/browser/ui/webui/options/browser_options_handler.cc
@@ -138,6 +138,10 @@
#include "chrome/browser/local_discovery/privet_notifications.h"
#endif
+#if defined(USE_ASH)
+#include "ash/shell.h"
+#endif
+
using base::UserMetricsAction;
using content::BrowserContext;
using content::BrowserThread;
@@ -608,6 +612,14 @@ void BrowserOptionsHandler::GetLocalizedValues(base::DictionaryValue* values) {
if (ShouldShowMultiProfilesUserList())
values->Set("profilesInfo", GetProfilesInfoList().release());
+ // Profile deletion is not allowed for supervised users, or any users
+ // using Metro mode.
+ bool allow_deletion = !Profile::FromWebUI(web_ui())->IsSupervised();
+#if defined(USE_ASH)
+ allow_deletion = allow_deletion && !ash::Shell::HasInstance();
+#endif
+ values->SetBoolean("allowProfileDeletion", allow_deletion);
+
values->SetBoolean("profileIsGuest",
Profile::FromWebUI(web_ui())->IsOffTheRecord());

Powered by Google App Engine
This is Rietveld 408576698