Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: chrome/browser/profiles/profile_metrics.cc

Issue 288493008: UMA Metrics for the user menu, including vasquette-detection (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/profiles/profile_metrics.h ('k') | chrome/browser/signin/signin_global_error.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/browser/profiles/profile_info_cache.h" 12 #include "chrome/browser/profiles/profile_info_cache.h"
13 #include "chrome/browser/profiles/profile_manager.h" 13 #include "chrome/browser/profiles/profile_manager.h"
14 #include "chrome/browser/signin/signin_header_helper.h"
14 #include "chrome/common/chrome_constants.h" 15 #include "chrome/common/chrome_constants.h"
15 #include "chrome/installer/util/google_update_settings.h" 16 #include "chrome/installer/util/google_update_settings.h"
16 #include "content/public/browser/browser_thread.h" 17 #include "content/public/browser/browser_thread.h"
17 #include "content/public/browser/user_metrics.h" 18 #include "content/public/browser/user_metrics.h"
18 19
19 namespace { 20 namespace {
20 21
21 const int kMaximumReportedProfileCount = 5; 22 const int kMaximumReportedProfileCount = 5;
22 const int kMaximumDaysOfDisuse = 4 * 7; // Should be integral number of weeks. 23 const int kMaximumDaysOfDisuse = 4 * 7; // Should be integral number of weeks.
23 24
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 UMA_HISTOGRAM_ENUMERATION("Profile.AuthResult", metric, 289 UMA_HISTOGRAM_ENUMERATION("Profile.AuthResult", metric,
289 NUM_PROFILE_AUTH_METRICS); 290 NUM_PROFILE_AUTH_METRICS);
290 } 291 }
291 292
292 void ProfileMetrics::LogProfileUpgradeEnrollment( 293 void ProfileMetrics::LogProfileUpgradeEnrollment(
293 ProfileUpgradeEnrollment metric) { 294 ProfileUpgradeEnrollment metric) {
294 UMA_HISTOGRAM_ENUMERATION("Profile.UpgradeEnrollment", metric, 295 UMA_HISTOGRAM_ENUMERATION("Profile.UpgradeEnrollment", metric,
295 NUM_PROFILE_ENROLLMENT_METRICS); 296 NUM_PROFILE_ENROLLMENT_METRICS);
296 } 297 }
297 298
299 void ProfileMetrics::LogProfileDesktopMenu(
300 ProfileDesktopMenu metric,
301 signin::GAIAServiceType gaia_service) {
302 // The first parameter to the histogram needs to be literal, because of the
303 // optimized implementation of |UMA_HISTOGRAM_ENUMERATION|. Do not attempt
304 // to refactor.
305 switch (gaia_service) {
306 case signin::GAIA_SERVICE_TYPE_NONE:
307 UMA_HISTOGRAM_ENUMERATION("Profile.DesktopMenu.NonGAIA", metric,
308 NUM_PROFILE_DESKTOP_MENU_METRICS);
309 break;
310 case signin::GAIA_SERVICE_TYPE_SIGNOUT:
311 UMA_HISTOGRAM_ENUMERATION("Profile.DesktopMenu.GAIASignout", metric,
312 NUM_PROFILE_DESKTOP_MENU_METRICS);
313 break;
314 case signin::GAIA_SERVICE_TYPE_SIGNOUTOPTIONS_INCOGNITO:
315 UMA_HISTOGRAM_ENUMERATION("Profile.DesktopMenu.GAIASignoutIncognito",
316 metric, NUM_PROFILE_DESKTOP_MENU_METRICS);
317 break;
318 case signin::GAIA_SERVICE_TYPE_ADDSESSION:
319 UMA_HISTOGRAM_ENUMERATION("Profile.DesktopMenu.GAIAAddSession", metric,
320 NUM_PROFILE_DESKTOP_MENU_METRICS);
321 break;
322 case signin::GAIA_SERVICE_TYPE_REAUTH:
323 UMA_HISTOGRAM_ENUMERATION("Profile.DesktopMenu.GAIAReAuth", metric,
324 NUM_PROFILE_DESKTOP_MENU_METRICS);
325 break;
326 case signin::GAIA_SERVICE_TYPE_DEFAULT:
327 UMA_HISTOGRAM_ENUMERATION("Profile.DesktopMenu.GAIADefault", metric,
328 NUM_PROFILE_DESKTOP_MENU_METRICS);
329 break;
330 }
331 }
332
298 void ProfileMetrics::LogProfileLaunch(Profile* profile) { 333 void ProfileMetrics::LogProfileLaunch(Profile* profile) {
299 base::FilePath profile_path = profile->GetPath(); 334 base::FilePath profile_path = profile->GetPath();
300 UMA_HISTOGRAM_ENUMERATION("Profile.LaunchBrowser", 335 UMA_HISTOGRAM_ENUMERATION("Profile.LaunchBrowser",
301 GetProfileType(profile_path), 336 GetProfileType(profile_path),
302 NUM_PROFILE_TYPE_METRICS); 337 NUM_PROFILE_TYPE_METRICS);
303 338
304 if (profile->IsManaged()) { 339 if (profile->IsManaged()) {
305 content::RecordAction( 340 content::RecordAction(
306 base::UserMetricsAction("ManagedMode_NewManagedUserWindow")); 341 base::UserMetricsAction("ManagedMode_NewManagedUserWindow"));
307 } 342 }
308 } 343 }
309 344
310 void ProfileMetrics::LogProfileSyncSignIn(const base::FilePath& profile_path) { 345 void ProfileMetrics::LogProfileSyncSignIn(const base::FilePath& profile_path) {
311 UMA_HISTOGRAM_ENUMERATION("Profile.SyncSignIn", 346 UMA_HISTOGRAM_ENUMERATION("Profile.SyncSignIn",
312 GetProfileType(profile_path), 347 GetProfileType(profile_path),
313 NUM_PROFILE_TYPE_METRICS); 348 NUM_PROFILE_TYPE_METRICS);
314 } 349 }
315 350
316 void ProfileMetrics::LogProfileUpdate(const base::FilePath& profile_path) { 351 void ProfileMetrics::LogProfileUpdate(const base::FilePath& profile_path) {
317 UMA_HISTOGRAM_ENUMERATION("Profile.Update", 352 UMA_HISTOGRAM_ENUMERATION("Profile.Update",
318 GetProfileType(profile_path), 353 GetProfileType(profile_path),
319 NUM_PROFILE_TYPE_METRICS); 354 NUM_PROFILE_TYPE_METRICS);
320 } 355 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_metrics.h ('k') | chrome/browser/signin/signin_global_error.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698