Commit 110b4353 authored by mlerman@chromium.org's avatar mlerman@chromium.org

Only track profile inactivity for non-mobile platforms.

Profile_metrics doesn't log signed-in metrics for inactive profiles.
However, since mobile platforms never log active times, the signed-in
metrics never get logged.

Reference CLs: (introduced issue as of M35)
https://codereview.chromium.org/134863002/
https://codereview.chromium.org/141663004

BUG=392948

Review URL: https://codereview.chromium.org/405473004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284486 0039d316-1c4b-4281-b951-d872f2087c98
parent 9a538e52
...@@ -68,6 +68,18 @@ void LogLockedProfileInformation(ProfileManager* manager) { ...@@ -68,6 +68,18 @@ void LogLockedProfileInformation(ProfileManager* manager) {
} }
} }
bool HasProfileAtIndexBeenActiveSince(const ProfileInfoCache& info_cache,
int index,
const base::Time& active_limit) {
#if !defined(OS_ANDROID) && !defined(OS_IOS)
// TODO(mlerman): iOS and Android should set an ActiveTime in the
// ProfileInfoCache. (see ProfileManager::OnBrowserSetLastActive)
if (info_cache.GetProfileActiveTimeAtIndex(index) < active_limit)
return false;
#endif
return true;
}
} // namespace } // namespace
enum ProfileAvatar { enum ProfileAvatar {
...@@ -118,7 +130,7 @@ bool ProfileMetrics::CountProfileInformation(ProfileManager* manager, ...@@ -118,7 +130,7 @@ bool ProfileMetrics::CountProfileInformation(ProfileManager* manager,
base::TimeDelta::FromDays(kMaximumDaysOfDisuse); base::TimeDelta::FromDays(kMaximumDaysOfDisuse);
for (size_t i = 0; i < number_of_profiles; ++i) { for (size_t i = 0; i < number_of_profiles; ++i) {
if (info_cache.GetProfileActiveTimeAtIndex(i) < oldest) { if (!HasProfileAtIndexBeenActiveSince(info_cache, i, oldest)) {
counts->unused++; counts->unused++;
} else { } else {
if (info_cache.ProfileIsSupervisedAtIndex(i)) if (info_cache.ProfileIsSupervisedAtIndex(i))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment