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

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

Issue 1579433002: Make profile statistics tasks inspectable by tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renamed ProfileAttributesStorage related functions in profile_statistics.* Created 4 years, 9 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/profiles/profile_statistics_unittest.cc ('k') | chrome/chrome_browser.gypi » ('j') | 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 1ea5094075688eb8a8884c1633eb413345b45afa..9d1dd7a9a380287dbed00b5d491dd7190f4529da 100644
--- a/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc
+++ b/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc
@@ -27,6 +27,7 @@
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profile_metrics.h"
#include "chrome/browser/profiles/profile_statistics.h"
+#include "chrome/browser/profiles/profile_statistics_factory.h"
#include "chrome/browser/profiles/profile_window.h"
#include "chrome/browser/profiles/profiles_state.h"
#include "chrome/browser/signin/local_auth.h"
@@ -566,7 +567,8 @@ void UserManagerScreenHandler::HandleRemoveUserWarningLoadStats(
// statistics are queried instead.
base::DictionaryValue return_value;
profiles::ProfileCategoryStats stats =
- profiles::GetProfileStatisticsFromCache(profile_path);
+ ProfileStatistics::GetProfileStatisticsFromAttributesStorage(
+ profile_path);
bool stats_success = true;
for (const auto& item : stats) {
scoped_ptr<base::DictionaryValue> stat(new base::DictionaryValue);
@@ -583,12 +585,10 @@ void UserManagerScreenHandler::HandleRemoveUserWarningLoadStats(
}
}
- profiles::GatherProfileStatistics(
- profile,
+ ProfileStatisticsFactory::GetForProfile(profile)->GatherStatistics(
base::Bind(
&UserManagerScreenHandler::RemoveUserDialogLoadStatsCallback,
- weak_ptr_factory_.GetWeakPtr(), profile_path),
- &tracker_);
+ weak_ptr_factory_.GetWeakPtr(), profile_path));
}
void UserManagerScreenHandler::RemoveUserDialogLoadStatsCallback(
@@ -872,7 +872,8 @@ void UserManagerScreenHandler::SendUserList() {
profile_value->SetString(kKeyAvatarUrl, GetAvatarImage(entry));
profiles::ProfileCategoryStats stats =
- profiles::GetProfileStatisticsFromCache(profile_path);
+ ProfileStatistics::GetProfileStatisticsFromAttributesStorage(
+ profile_path);
scoped_ptr<base::DictionaryValue> stats_dict(new base::DictionaryValue);
for (const auto& item : stats) {
scoped_ptr<base::DictionaryValue> stat(new base::DictionaryValue);
« no previous file with comments | « chrome/browser/profiles/profile_statistics_unittest.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698