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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 UMA_HISTOGRAM_ENUMERATION("Profile.DesktopMenu.GAIAReAuth", metric, | 323 UMA_HISTOGRAM_ENUMERATION("Profile.DesktopMenu.GAIAReAuth", metric, |
324 NUM_PROFILE_DESKTOP_MENU_METRICS); | 324 NUM_PROFILE_DESKTOP_MENU_METRICS); |
325 break; | 325 break; |
326 case signin::GAIA_SERVICE_TYPE_DEFAULT: | 326 case signin::GAIA_SERVICE_TYPE_DEFAULT: |
327 UMA_HISTOGRAM_ENUMERATION("Profile.DesktopMenu.GAIADefault", metric, | 327 UMA_HISTOGRAM_ENUMERATION("Profile.DesktopMenu.GAIADefault", metric, |
328 NUM_PROFILE_DESKTOP_MENU_METRICS); | 328 NUM_PROFILE_DESKTOP_MENU_METRICS); |
329 break; | 329 break; |
330 } | 330 } |
331 } | 331 } |
332 | 332 |
| 333 #if defined(OS_ANDROID) |
| 334 void ProfileMetrics::LogProfileAndroidAccountManagementMenu( |
| 335 ProfileAndroidAccountManagementMenu metric, |
| 336 signin::GAIAServiceType gaia_service) { |
| 337 // The first parameter to the histogram needs to be literal, because of the |
| 338 // optimized implementation of |UMA_HISTOGRAM_ENUMERATION|. Do not attempt |
| 339 // to refactor. |
| 340 switch (gaia_service) { |
| 341 case signin::GAIA_SERVICE_TYPE_NONE: |
| 342 UMA_HISTOGRAM_ENUMERATION( |
| 343 "Profile.AndroidAccountManagementMenu.NonGAIA", |
| 344 metric, |
| 345 NUM_PROFILE_ANDROID_ACCOUNT_MANAGEMENT_MENU_METRICS); |
| 346 break; |
| 347 case signin::GAIA_SERVICE_TYPE_SIGNOUT: |
| 348 UMA_HISTOGRAM_ENUMERATION( |
| 349 "Profile.AndroidAccountManagementMenu.GAIASignout", |
| 350 metric, |
| 351 NUM_PROFILE_ANDROID_ACCOUNT_MANAGEMENT_MENU_METRICS); |
| 352 break; |
| 353 case signin::GAIA_SERVICE_TYPE_SIGNOUTOPTIONS_INCOGNITO: |
| 354 UMA_HISTOGRAM_ENUMERATION( |
| 355 "Profile.AndroidAccountManagementMenu.GAIASignoutIncognito", |
| 356 metric, |
| 357 NUM_PROFILE_ANDROID_ACCOUNT_MANAGEMENT_MENU_METRICS); |
| 358 break; |
| 359 case signin::GAIA_SERVICE_TYPE_ADDSESSION: |
| 360 UMA_HISTOGRAM_ENUMERATION( |
| 361 "Profile.AndroidAccountManagementMenu.GAIAAddSession", |
| 362 metric, |
| 363 NUM_PROFILE_ANDROID_ACCOUNT_MANAGEMENT_MENU_METRICS); |
| 364 break; |
| 365 case signin::GAIA_SERVICE_TYPE_REAUTH: |
| 366 UMA_HISTOGRAM_ENUMERATION( |
| 367 "Profile.AndroidAccountManagementMenu.GAIAReAuth", |
| 368 metric, |
| 369 NUM_PROFILE_ANDROID_ACCOUNT_MANAGEMENT_MENU_METRICS); |
| 370 break; |
| 371 case signin::GAIA_SERVICE_TYPE_DEFAULT: |
| 372 UMA_HISTOGRAM_ENUMERATION( |
| 373 "Profile.AndroidAccountManagementMenu.GAIADefault", |
| 374 metric, |
| 375 NUM_PROFILE_ANDROID_ACCOUNT_MANAGEMENT_MENU_METRICS); |
| 376 break; |
| 377 } |
| 378 } |
| 379 #endif // defined(OS_ANDROID) |
| 380 |
333 void ProfileMetrics::LogProfileLaunch(Profile* profile) { | 381 void ProfileMetrics::LogProfileLaunch(Profile* profile) { |
334 base::FilePath profile_path = profile->GetPath(); | 382 base::FilePath profile_path = profile->GetPath(); |
335 UMA_HISTOGRAM_ENUMERATION("Profile.LaunchBrowser", | 383 UMA_HISTOGRAM_ENUMERATION("Profile.LaunchBrowser", |
336 GetProfileType(profile_path), | 384 GetProfileType(profile_path), |
337 NUM_PROFILE_TYPE_METRICS); | 385 NUM_PROFILE_TYPE_METRICS); |
338 | 386 |
339 if (profile->IsManaged()) { | 387 if (profile->IsManaged()) { |
340 content::RecordAction( | 388 content::RecordAction( |
341 base::UserMetricsAction("ManagedMode_NewManagedUserWindow")); | 389 base::UserMetricsAction("ManagedMode_NewManagedUserWindow")); |
342 } | 390 } |
343 } | 391 } |
344 | 392 |
345 void ProfileMetrics::LogProfileSyncSignIn(const base::FilePath& profile_path) { | 393 void ProfileMetrics::LogProfileSyncSignIn(const base::FilePath& profile_path) { |
346 UMA_HISTOGRAM_ENUMERATION("Profile.SyncSignIn", | 394 UMA_HISTOGRAM_ENUMERATION("Profile.SyncSignIn", |
347 GetProfileType(profile_path), | 395 GetProfileType(profile_path), |
348 NUM_PROFILE_TYPE_METRICS); | 396 NUM_PROFILE_TYPE_METRICS); |
349 } | 397 } |
350 | 398 |
351 void ProfileMetrics::LogProfileUpdate(const base::FilePath& profile_path) { | 399 void ProfileMetrics::LogProfileUpdate(const base::FilePath& profile_path) { |
352 UMA_HISTOGRAM_ENUMERATION("Profile.Update", | 400 UMA_HISTOGRAM_ENUMERATION("Profile.Update", |
353 GetProfileType(profile_path), | 401 GetProfileType(profile_path), |
354 NUM_PROFILE_TYPE_METRICS); | 402 NUM_PROFILE_TYPE_METRICS); |
355 } | 403 } |
OLD | NEW |