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

Unified Diff: chrome/browser/ui/webui/signin/user_manager_screen_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
« no previous file with comments | « chrome/browser/ui/webui/options/browser_options_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/signin/user_manager_screen_handler.cc
diff --git a/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc b/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc
index 91a5bce179edad88405345fd32f252e11d843bb6..a61819078fe3cacf1f764f3dd8ccd8e6b2622de3 100644
--- a/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc
+++ b/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc
@@ -45,6 +45,10 @@
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/image/image_util.h"
+#if defined(USE_ASH)
+#include "ash/shell.h"
+#endif
+
namespace {
// User dictionary keys.
const char kKeyUsername[] = "username";
@@ -633,9 +637,14 @@ void UserManagerScreenHandler::SendUserList() {
base::ListValue users_list;
const ProfileInfoCache& info_cache =
g_browser_process->profile_manager()->GetProfileInfoCache();
-
user_auth_type_map_.clear();
+ // Profile deletion is not allowed in Metro mode.
+ bool can_remove = true;
+#if defined(USE_ASH)
+ can_remove = !ash::Shell::HasInstance();
+#endif
+
for (size_t i = 0; i < info_cache.GetNumberOfProfiles(); ++i) {
base::DictionaryValue* profile_value = new base::DictionaryValue();
base::FilePath profile_path = info_cache.GetPathOfProfileAtIndex(i);
@@ -657,7 +666,7 @@ void UserManagerScreenHandler::SendUserList() {
profile_value->SetBoolean(
kKeyNeedsSignin, info_cache.ProfileIsSigninRequiredAtIndex(i));
profile_value->SetBoolean(kKeyIsOwner, false);
- profile_value->SetBoolean(kKeyCanRemove, true);
+ profile_value->SetBoolean(kKeyCanRemove, can_remove);
profile_value->SetBoolean(kKeyIsDesktop, true);
profile_value->SetString(
kKeyAvatarUrl, GetAvatarImageAtIndex(i, info_cache));
« no previous file with comments | « chrome/browser/ui/webui/options/browser_options_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698