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

Unified Diff: chrome/browser/profiles/profile_metrics.cc

Issue 1417903006: Componentize ProfileMetrics::Counts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add owners and fix Windows compile Created 5 years, 2 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_metrics.h ('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/profiles/profile_metrics.cc
diff --git a/chrome/browser/profiles/profile_metrics.cc b/chrome/browser/profiles/profile_metrics.cc
index a0143d58da48501e18ac062b280f0ca7f0afc505..1825c95bd804d36b9c5a69bfe9adafee35814aca 100644
--- a/chrome/browser/profiles/profile_metrics.cc
+++ b/chrome/browser/profiles/profile_metrics.cc
@@ -15,6 +15,7 @@
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/installer/util/google_update_settings.h"
+#include "components/profile_metrics/counts.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/user_metrics.h"
@@ -143,7 +144,7 @@ enum ProfileAvatar {
};
bool ProfileMetrics::CountProfileInformation(ProfileManager* manager,
- ProfileCounts* counts) {
+ profile_metrics::Counts* counts) {
const ProfileInfoCache& info_cache = manager->GetProfileInfoCache();
size_t number_of_profiles = info_cache.GetNumberOfProfiles();
counts->total = number_of_profiles;
@@ -176,7 +177,7 @@ bool ProfileMetrics::CountProfileInformation(ProfileManager* manager,
void ProfileMetrics::UpdateReportedProfilesStatistics(ProfileManager* manager) {
#if defined(OS_WIN) || defined(OS_MACOSX)
- ProfileCounts counts;
+ profile_metrics::Counts counts;
if (CountProfileInformation(manager, &counts)) {
size_t limited_total = counts.total;
size_t limited_signedin = counts.signedin;
@@ -207,25 +208,13 @@ void ProfileMetrics::UpdateReportedOSProfileStatistics(
#endif
void ProfileMetrics::LogNumberOfProfiles(ProfileManager* manager) {
- ProfileCounts counts;
+ profile_metrics::Counts counts;
bool success = CountProfileInformation(manager, &counts);
- UMA_HISTOGRAM_COUNTS_100("Profile.NumberOfProfiles", counts.total);
+
+ profile_metrics::LogProfileMetricsCounts(counts);
// Ignore other metrics if we have no profiles.
if (success) {
- UMA_HISTOGRAM_COUNTS_100("Profile.NumberOfManagedProfiles",
- counts.supervised);
- UMA_HISTOGRAM_COUNTS_100("Profile.PercentageOfManagedProfiles",
- 100 * counts.supervised / counts.total);
- UMA_HISTOGRAM_COUNTS_100("Profile.NumberOfSignedInProfiles",
- counts.signedin);
- UMA_HISTOGRAM_COUNTS_100("Profile.NumberOfUnusedProfiles",
- counts.unused);
- UMA_HISTOGRAM_COUNTS_100("Profile.NumberOfSignedInProfilesWithGAIAIcons",
- counts.gaia_icon);
- UMA_HISTOGRAM_COUNTS_100("Profile.NumberOfProfilesWithAuthErrors",
- counts.auth_errors);
-
LogLockedProfileInformation(manager);
#if defined(OS_WIN) || defined(OS_MACOSX)
« no previous file with comments | « chrome/browser/profiles/profile_metrics.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698