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

Unified Diff: chrome/browser/ui/webui/signin/user_manager_screen_handler.cc

Issue 1248613003: Issue 501916 : Add data type counts to profile deletion flow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Third draft - removed all password manager code Created 5 years, 5 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/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 6887224827e7b10446995c7b751d0b0e0774d125..67598733871e1bef56d2c7d389810e25cee64d45 100644
--- a/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc
+++ b/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc
@@ -81,7 +81,8 @@ const char kJsApiUserManagerRemoveUser[] = "removeUser";
const char kJsApiUserManagerAttemptUnlock[] = "attemptUnlock";
const char kJsApiUserManagerLogRemoveUserWarningShown[] =
"logRemoveUserWarningShown";
-
+const char kJsApiUserManagerRemoveUserWarningLoadStats[] =
+ "removeUserWarningLoadStats";
const size_t kAvatarIconSize = 180;
const int kMaxOAuthRetries = 3;
@@ -571,6 +572,46 @@ void UserManagerScreenHandler::HandleHardlockUserPod(
HideUserPodCustomIcon(email);
}
+void UserManagerScreenHandler::HandleRemoveUserWarningLoadStats(
+ const base::ListValue* args) {
+ const base::Value* profile_path_value;
+ if (!args->Get(0, &profile_path_value))
+ return;
+
+ base::FilePath* profile_path = new base::FilePath();
+ if (!base::GetValueAsFilePath(*profile_path_value, profile_path)) {
+ delete profile_path;
+ return;
+ }
+
+ Profile* profile = g_browser_process->profile_manager()->
+ GetProfileByPath(*profile_path);
+
+ if (!profile) {
+ delete profile_path;
+ return;
+ }
+
+ profiles::GetProfileStatistics(profile,
+ base::Bind(&UserManagerScreenHandler::RemoveUserDialogLoadStatsCallback,
+ weak_ptr_factory_.GetWeakPtr(), base::Owned(profile_path)),
+ &tracker);
+}
+
+void UserManagerScreenHandler::RemoveUserDialogLoadStatsCallback(
+ const base::FilePath* profile_path,
+ profiles::ProfileStatisticsValues result) {
+ // Copy result into return_value.
+ base::StringValue return_profile_path(profile_path->value());
+ base::DictionaryValue return_value;
+ for (profiles::ProfileStatisticsValues::const_iterator
+ iter = result.begin(); iter != result.end(); iter++) {
+ return_value.SetIntegerWithoutPathExpansion(iter->first, iter->second);
+ }
+ web_ui()->CallJavascriptFunction("updateRemoveWarningDialog",
+ return_profile_path, return_value);
+}
+
void UserManagerScreenHandler::OnGetTokenInfoResponse(
scoped_ptr<base::DictionaryValue> token_info) {
// Password is unchanged so user just mistyped it. Ask again.
@@ -665,6 +706,9 @@ void UserManagerScreenHandler::RegisterMessages() {
base::Unretained(this)));
web_ui()->RegisterMessageCallback(kJsApiUserManagerLogRemoveUserWarningShown,
base::Bind(&HandleLogRemoveUserWarningShown));
+ web_ui()->RegisterMessageCallback(kJsApiUserManagerRemoveUserWarningLoadStats,
+ base::Bind(&UserManagerScreenHandler::HandleRemoveUserWarningLoadStats,
+ base::Unretained(this)));
const content::WebUI::MessageCallback& kDoNothingCallback =
base::Bind(&HandleAndDoNothing);
@@ -723,6 +767,22 @@ void UserManagerScreenHandler::GetLocalizedValues(
l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_BUTTON));
localized_strings->SetString("removeUserWarningText",
l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING));
+ localized_strings->SetString("removeUserWarningTextNonSync",
+ l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_NONSYNC));
+ localized_strings->SetString("removeUserWarningTextHistory",
+ l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_HISTORY));
+ localized_strings->SetString("removeUserWarningTextPasswords",
+ l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_PASSWORDS));
+ localized_strings->SetString("removeUserWarningTextBookmarks",
+ l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_BOOKMARKS));
+ localized_strings->SetString("removeUserWarningTextSettings",
+ l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_SETTINGS));
+ localized_strings->SetString("removeUserWarningTextComputing",
+ l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_COMPUTING));
+ localized_strings->SetString("removeUserWarningTextSync",
+ l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_SYNC));
+ localized_strings->SetString("removeUserWarningTextSync2",
+ l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_SYNC2));
localized_strings->SetString("removeLegacySupervisedUserWarningText",
l10n_util::GetStringFUTF16(
IDS_LOGIN_POD_LEGACY_SUPERVISED_USER_REMOVE_WARNING,

Powered by Google App Engine
This is Rietveld 408576698