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

Unified Diff: chrome/browser/ui/webui/options/manage_profile_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: First draft 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/options/manage_profile_handler.cc
diff --git a/chrome/browser/ui/webui/options/manage_profile_handler.cc b/chrome/browser/ui/webui/options/manage_profile_handler.cc
index ac857391b06abc4e3e7c2d51b20719219140cd9d..260499d25c4679592f6d9316ed26b6e30676d724 100644
--- a/chrome/browser/ui/webui/options/manage_profile_handler.cc
+++ b/chrome/browser/ui/webui/options/manage_profile_handler.cc
@@ -192,6 +192,10 @@ void ManageProfileHandler::RegisterMessages() {
base::Unretained(this)));
web_ui()->RegisterMessageCallback("logDeleteUserDialogShown",
base::Bind(&HandleLogDeleteUserDialogShown));
+ web_ui()->RegisterMessageCallback(
+ "deleteUserDialogLoadStats",
+ base::Bind(&ManageProfileHandler::DeleteUserDialogLoadStats,
+ base::Unretained(this)));
}
void ManageProfileHandler::Uninitialize() {
@@ -562,4 +566,38 @@ void ManageProfileHandler::RefreshGaiaPicture(const base::ListValue* args) {
profiles::UpdateGaiaProfileInfoIfNeeded(Profile::FromWebUI(web_ui()));
}
+void ManageProfileHandler::DeleteUserDialogLoadStats(
+ const base::ListValue* args) {
+ base::FilePath* profile_path = new base::FilePath();
+ if (!GetProfilePathFromArgs(args, profile_path))
+ return;
+
+ Profile* profile = g_browser_process->profile_manager()->
+ GetProfileByPath(*profile_path);
+
+ if (!profile) return;
+
+ // Store the task tracker and temporary states.
+ profile_statistics_service_.reset(new profiles::ProfileStatisticsService(
+ profile,
+ base::Bind(
+ &ManageProfileHandler::DeleteUserDialogLoadStatsCallback,
+ weak_factory_.GetWeakPtr(),
+ base::Owned(profile_path))));
+}
+
+void ManageProfileHandler::DeleteUserDialogLoadStatsCallback(
+ const base::FilePath* profile_path,
+ profiles::ProfileStatisticsService::ProfileStatisticsValues result) {
+ // Copy result into return_value.
+ base::StringValue return_profile_path(profile_path->value());
+ base::DictionaryValue return_value;
+ for (profiles::ProfileStatisticsService::ProfileStatisticsValues::iterator
+ iter = result.begin(); iter != result.end(); iter++) {
+ return_value.SetIntegerWithoutPathExpansion(iter->first, iter->second);
+ }
+ web_ui()->CallJavascriptFunction("ManageProfileOverlay.updateDeleteDialog",
+ return_profile_path, return_value);
+}
+
} // namespace options

Powered by Google App Engine
This is Rietveld 408576698