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

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

Issue 405473004: Only track profile inactivity for non-mobile platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | no next file » | 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 b7023672c529c6cb7b783727d9943966ca7e4165..772b5976dc8dbaa35c373e3206a88efa489a9f7a 100644
--- a/chrome/browser/profiles/profile_metrics.cc
+++ b/chrome/browser/profiles/profile_metrics.cc
@@ -113,14 +113,21 @@ bool ProfileMetrics::CountProfileInformation(ProfileManager* manager,
if (!number_of_profiles)
return false;
- // Maximum age for "active" profile is 4 weeks.
- base::Time oldest = base::Time::Now() -
- base::TimeDelta::FromDays(kMaximumDaysOfDisuse);
+
for (size_t i = 0; i < number_of_profiles; ++i) {
+// IOS and ANDROID never set an ActiveTime in the ProfileManager.
+#if !defined(OS_ANDROID) && !defined(OS_IOS)
+ // Maximum age for "active" profile is 4 weeks.
+ base::Time oldest = base::Time::Now() -
bcwhite 2014/07/18 01:13:59 This is now calculating this value for every profi
+ base::TimeDelta::FromDays(kMaximumDaysOfDisuse);
+
if (info_cache.GetProfileActiveTimeAtIndex(i) < oldest) {
bcwhite 2014/07/18 01:13:59 I think the better choice would be to set the acti
counts->unused++;
} else {
+#else
+ {
bcwhite 2014/07/18 01:13:59 This duplicate open brace will break editors' auto
+#endif
if (info_cache.ProfileIsSupervisedAtIndex(i))
counts->supervised++;
if (!info_cache.GetUserNameOfProfileAtIndex(i).empty()) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698