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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
288 UMA_HISTOGRAM_ENUMERATION("Profile.AuthResult", metric, | 288 UMA_HISTOGRAM_ENUMERATION("Profile.AuthResult", metric, |
289 NUM_PROFILE_AUTH_METRICS); | 289 NUM_PROFILE_AUTH_METRICS); |
290 } | 290 } |
291 | 291 |
292 void ProfileMetrics::LogProfileUpgradeEnrollment( | 292 void ProfileMetrics::LogProfileUpgradeEnrollment( |
293 ProfileUpgradeEnrollment metric) { | 293 ProfileUpgradeEnrollment metric) { |
294 UMA_HISTOGRAM_ENUMERATION("Profile.UpgradeEnrollment", metric, | 294 UMA_HISTOGRAM_ENUMERATION("Profile.UpgradeEnrollment", metric, |
295 NUM_PROFILE_ENROLLMENT_METRICS); | 295 NUM_PROFILE_ENROLLMENT_METRICS); |
296 } | 296 } |
297 | 297 |
298 void ProfileMetrics::LogProfileDesktopSignout(ProfileDesktopSignout metric, | |
299 bool opened_from_content) { | |
300 // Only type of action be noted; whether Content-sourced or not is specified | |
301 // in |opened_from_content| | |
302 DCHECK(metric % 2 == 0); | |
Alexei Svitkine (slow)
2014/05/14 20:04:17
Nit: DCHECK_EQ?
Mike Lerman
2014/05/14 20:09:16
That would be better. Done.
| |
303 // If opened from the content area, increment the metric to log that | |
304 // this was opened from the content. | |
305 if (opened_from_content) { | |
Alexei Svitkine (slow)
2014/05/14 20:04:17
Nit: No {}'s
Mike Lerman
2014/05/14 20:09:16
Done.
| |
306 metric = static_cast<ProfileDesktopSignout>(metric + 1); | |
307 } | |
308 UMA_HISTOGRAM_ENUMERATION("Profile.DesktopSignout", metric, | |
309 NUM_PROFILE_DESKTOP_SIGNOUT_METRICS); | |
310 } | |
311 | |
298 void ProfileMetrics::LogProfileLaunch(Profile* profile) { | 312 void ProfileMetrics::LogProfileLaunch(Profile* profile) { |
299 base::FilePath profile_path = profile->GetPath(); | 313 base::FilePath profile_path = profile->GetPath(); |
300 UMA_HISTOGRAM_ENUMERATION("Profile.LaunchBrowser", | 314 UMA_HISTOGRAM_ENUMERATION("Profile.LaunchBrowser", |
301 GetProfileType(profile_path), | 315 GetProfileType(profile_path), |
302 NUM_PROFILE_TYPE_METRICS); | 316 NUM_PROFILE_TYPE_METRICS); |
303 | 317 |
304 if (profile->IsManaged()) { | 318 if (profile->IsManaged()) { |
305 content::RecordAction( | 319 content::RecordAction( |
306 base::UserMetricsAction("ManagedMode_NewManagedUserWindow")); | 320 base::UserMetricsAction("ManagedMode_NewManagedUserWindow")); |
307 } | 321 } |
308 } | 322 } |
309 | 323 |
310 void ProfileMetrics::LogProfileSyncSignIn(const base::FilePath& profile_path) { | 324 void ProfileMetrics::LogProfileSyncSignIn(const base::FilePath& profile_path) { |
311 UMA_HISTOGRAM_ENUMERATION("Profile.SyncSignIn", | 325 UMA_HISTOGRAM_ENUMERATION("Profile.SyncSignIn", |
312 GetProfileType(profile_path), | 326 GetProfileType(profile_path), |
313 NUM_PROFILE_TYPE_METRICS); | 327 NUM_PROFILE_TYPE_METRICS); |
314 } | 328 } |
315 | 329 |
316 void ProfileMetrics::LogProfileUpdate(const base::FilePath& profile_path) { | 330 void ProfileMetrics::LogProfileUpdate(const base::FilePath& profile_path) { |
317 UMA_HISTOGRAM_ENUMERATION("Profile.Update", | 331 UMA_HISTOGRAM_ENUMERATION("Profile.Update", |
318 GetProfileType(profile_path), | 332 GetProfileType(profile_path), |
319 NUM_PROFILE_TYPE_METRICS); | 333 NUM_PROFILE_TYPE_METRICS); |
320 } | 334 } |
OLD | NEW |