Chromium Code Reviews| 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..1378e6a42730356a1f7d66722af94431a7fdb761 100644 |
| --- a/chrome/browser/profiles/profile_metrics.cc |
| +++ b/chrome/browser/profiles/profile_metrics.cc |
| @@ -68,6 +68,21 @@ void LogLockedProfileInformation(ProfileManager* manager) { |
| } |
| } |
| +bool HasProfileAtIndexBeenActiveSince(const ProfileInfoCache& info_cache, |
| + int index, |
| + const base::Time& active_limit) { |
| + if (info_cache.GetProfileActiveTimeAtIndex(index) < active_limit) { |
|
bcwhite
2014/07/18 16:38:44
Can the entire condition test be moved inside the
Mike Lerman
2014/07/18 17:44:52
You can! Done.
|
| +// TODO(mlerman): iOS and Android should set an ActiveTime in the |
|
bcwhite
2014/07/18 16:38:44
Put the comment inside the appropriate #ifdef and
Mike Lerman
2014/07/18 17:44:52
Acknowledged.
|
| +// ProfileInfoCache. (see ProfileManager::OnBrowserSetLastActive) |
| +#if defined(OS_ANDROID) || defined(OS_IOS) |
| + return true; |
| +#else |
| + return false; |
| +#endif |
| + } |
| + return true; |
| +} |
| + |
| } // namespace |
| enum ProfileAvatar { |
| @@ -118,7 +133,7 @@ bool ProfileMetrics::CountProfileInformation(ProfileManager* manager, |
| base::TimeDelta::FromDays(kMaximumDaysOfDisuse); |
| for (size_t i = 0; i < number_of_profiles; ++i) { |
| - if (info_cache.GetProfileActiveTimeAtIndex(i) < oldest) { |
| + if (HasProfileAtIndexBeenActiveSince(info_cache, i, oldest)) { |
| counts->unused++; |
| } else { |
| if (info_cache.ProfileIsSupervisedAtIndex(i)) |