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 |