| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/profiles/profile_metrics.h" | 5 #include "chrome/browser/profiles/profile_metrics.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 // Maximum age for "active" profile is 4 weeks. | 154 // Maximum age for "active" profile is 4 weeks. |
| 155 base::Time oldest = base::Time::Now() - | 155 base::Time oldest = base::Time::Now() - |
| 156 base::TimeDelta::FromDays(kMaximumDaysOfDisuse); | 156 base::TimeDelta::FromDays(kMaximumDaysOfDisuse); |
| 157 | 157 |
| 158 for (size_t i = 0; i < number_of_profiles; ++i) { | 158 for (size_t i = 0; i < number_of_profiles; ++i) { |
| 159 if (!HasProfileAtIndexBeenActiveSince(info_cache, i, oldest)) { | 159 if (!HasProfileAtIndexBeenActiveSince(info_cache, i, oldest)) { |
| 160 counts->unused++; | 160 counts->unused++; |
| 161 } else { | 161 } else { |
| 162 if (info_cache.ProfileIsSupervisedAtIndex(i)) | 162 if (info_cache.ProfileIsSupervisedAtIndex(i)) |
| 163 counts->supervised++; | 163 counts->supervised++; |
| 164 if (!info_cache.GetUserNameOfProfileAtIndex(i).empty()) { | 164 if (info_cache.ProfileIsAuthenticatedAtIndex(i)) { |
| 165 counts->signedin++; | 165 counts->signedin++; |
| 166 if (info_cache.IsUsingGAIAPictureOfProfileAtIndex(i)) | 166 if (info_cache.IsUsingGAIAPictureOfProfileAtIndex(i)) |
| 167 counts->gaia_icon++; | 167 counts->gaia_icon++; |
| 168 if (info_cache.ProfileIsAuthErrorAtIndex(i)) | 168 if (info_cache.ProfileIsAuthErrorAtIndex(i)) |
| 169 counts->auth_errors++; | 169 counts->auth_errors++; |
| 170 } | 170 } |
| 171 } | 171 } |
| 172 } | 172 } |
| 173 return true; | 173 return true; |
| 174 } | 174 } |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 UMA_HISTOGRAM_ENUMERATION("Profile.SyncSignIn", | 547 UMA_HISTOGRAM_ENUMERATION("Profile.SyncSignIn", |
| 548 GetProfileType(profile_path), | 548 GetProfileType(profile_path), |
| 549 NUM_PROFILE_TYPE_METRICS); | 549 NUM_PROFILE_TYPE_METRICS); |
| 550 } | 550 } |
| 551 | 551 |
| 552 void ProfileMetrics::LogProfileUpdate(const base::FilePath& profile_path) { | 552 void ProfileMetrics::LogProfileUpdate(const base::FilePath& profile_path) { |
| 553 UMA_HISTOGRAM_ENUMERATION("Profile.Update", | 553 UMA_HISTOGRAM_ENUMERATION("Profile.Update", |
| 554 GetProfileType(profile_path), | 554 GetProfileType(profile_path), |
| 555 NUM_PROFILE_TYPE_METRICS); | 555 NUM_PROFILE_TYPE_METRICS); |
| 556 } | 556 } |
| OLD | NEW |