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

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

Issue 8790010: Adding in metrics for GAIA photo info. Also, fixing avatar logging to only log when the user chan... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years 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
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/file_path.h" 7 #include "base/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 13 matching lines...) Expand all
24 user_data_dir = manager->user_data_dir(); 24 user_data_dir = manager->user_data_dir();
25 } 25 }
26 if (profile_path == user_data_dir.AppendASCII(chrome::kInitialProfile)) { 26 if (profile_path == user_data_dir.AppendASCII(chrome::kInitialProfile)) {
27 metric = ProfileMetrics::ORIGINAL; 27 metric = ProfileMetrics::ORIGINAL;
28 } 28 }
29 return metric; 29 return metric;
30 } 30 }
31 31
32 } // namespace 32 } // namespace
33 33
34 enum ProfileAvatar {
35 AVATAR_GENERIC = 0, // The names for avatar icons
36 AVATAR_GENERIC_AQUA,
37 AVATAR_GENERIC_BLUE,
38 AVATAR_GENERIC_GREEN,
39 AVATAR_GENERIC_ORANGE,
40 AVATAR_GENERIC_PURPLE,
41 AVATAR_GENERIC_RED,
42 AVATAR_GENERIC_YELLOW,
43 AVATAR_SECRET_AGENT,
44 AVATAR_SUPERHERO,
45 AVATAR_VOLLEYBALL, // 10
46 AVATAR_BUSINESSMAN,
47 AVATAR_NINJA,
48 AVATAR_ALIEN,
49 AVATAR_AWESOME,
50 AVATAR_FLOWER,
51 AVATAR_PIZZA,
52 AVATAR_SOCCER,
53 AVATAR_BURGER,
54 AVATAR_CAT,
55 AVATAR_CUPCAKE, // 20
56 AVATAR_DOG,
57 AVATAR_HORSE,
58 AVATAR_MARGARITA,
59 AVATAR_NOTE,
60 AVATAR_SUN_CLOUD,
61 AVATAR_UNKNOWN, // 26
62 AVATAR_GAIA, // 27
63 NUM_PROFILE_AVATAR_METRICS
64 };
65
34 void ProfileMetrics::LogProfileAvatarSelection(size_t icon_index) { 66 void ProfileMetrics::LogProfileAvatarSelection(size_t icon_index) {
35 DCHECK(icon_index < NUM_PROFILE_AVATAR_METRICS); 67 DCHECK(icon_index < NUM_PROFILE_AVATAR_METRICS);
36 ProfileAvatar icon_name; 68 ProfileAvatar icon_name = AVATAR_UNKNOWN;
37 switch (icon_index) { 69 switch (icon_index) {
38 case 0: 70 case 0:
39 icon_name = AVATAR_GENERIC; 71 icon_name = AVATAR_GENERIC;
40 break; 72 break;
41 case 1: 73 case 1:
42 icon_name = AVATAR_GENERIC_AQUA; 74 icon_name = AVATAR_GENERIC_AQUA;
43 break; 75 break;
44 case 2: 76 case 2:
45 icon_name = AVATAR_GENERIC_BLUE; 77 icon_name = AVATAR_GENERIC_BLUE;
46 break; 78 break;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 break; 138 break;
107 case 23: 139 case 23:
108 icon_name = AVATAR_MARGARITA; 140 icon_name = AVATAR_MARGARITA;
109 break; 141 break;
110 case 24: 142 case 24:
111 icon_name = AVATAR_NOTE; 143 icon_name = AVATAR_NOTE;
112 break; 144 break;
113 case 25: 145 case 25:
114 icon_name = AVATAR_SUN_CLOUD; 146 icon_name = AVATAR_SUN_CLOUD;
115 break; 147 break;
116 default: // We should never actually get here, but just in case 148 case 27:
117 icon_name = AVATAR_UNKNOWN; 149 icon_name = AVATAR_GAIA;
150 break;
151 default: // We should never actually get here.
152 NOTREACHED();
118 break; 153 break;
119 } 154 }
120 UMA_HISTOGRAM_ENUMERATION("Profile.Avatar", icon_name, 155 UMA_HISTOGRAM_ENUMERATION("Profile.Avatar", icon_name,
121 NUM_PROFILE_AVATAR_METRICS); 156 NUM_PROFILE_AVATAR_METRICS);
122 } 157 }
123 158
124 void ProfileMetrics::LogProfileOpenMethod(ProfileOpen metric) { 159 void ProfileMetrics::LogProfileOpenMethod(ProfileOpen metric) {
125 DCHECK(metric < NUM_PROFILE_OPEN_METRICS); 160 DCHECK(metric < NUM_PROFILE_OPEN_METRICS);
126 UMA_HISTOGRAM_ENUMERATION("Profile.OpenMethod", metric, 161 UMA_HISTOGRAM_ENUMERATION("Profile.OpenMethod", metric,
127 NUM_PROFILE_OPEN_METRICS); 162 NUM_PROFILE_OPEN_METRICS);
(...skipping 29 matching lines...) Expand all
157 UMA_HISTOGRAM_ENUMERATION("Profile.Update", 192 UMA_HISTOGRAM_ENUMERATION("Profile.Update",
158 GetProfileType(profile_path), 193 GetProfileType(profile_path),
159 NUM_PROFILE_TYPE_METRICS); 194 NUM_PROFILE_TYPE_METRICS);
160 } 195 }
161 196
162 void ProfileMetrics::LogProfileSyncSignIn(FilePath& profile_path) { 197 void ProfileMetrics::LogProfileSyncSignIn(FilePath& profile_path) {
163 UMA_HISTOGRAM_ENUMERATION("Profile.SyncSignIn", 198 UMA_HISTOGRAM_ENUMERATION("Profile.SyncSignIn",
164 GetProfileType(profile_path), 199 GetProfileType(profile_path),
165 NUM_PROFILE_TYPE_METRICS); 200 NUM_PROFILE_TYPE_METRICS);
166 } 201 }
202
203 void ProfileMetrics::LogProfileSwitchGaia(ProfileGaia metric) {
204 if (metric == GAIA_OPT_IN)
205 LogProfileAvatarSelection(AVATAR_GAIA);
206 UMA_HISTOGRAM_ENUMERATION("Profile.SwitchGaiaPhotoSettings",
207 metric,
208 NUM_PROFILE_GAIA_METRICS);
209 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_metrics.h ('k') | chrome/browser/ui/webui/options/manage_profile_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698