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

Side by Side Diff: chrome/common/password_generation_util.cc

Issue 10787023: Adding UMA stats. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Some nits. Created 8 years, 5 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/common/password_generation_util.h"
6
7 #include "base/metrics/histogram.h"
8
9 namespace password_generation {
10
11 PasswordGenerationActions::PasswordGenerationActions()
12 : learn_more_visited(false),
13 password_accepted(false),
14 password_edited(false),
15 password_regenerated(false) {
16 }
17
18 PasswordGenerationActions::~PasswordGenerationActions() {
19 }
20
21 void LogUserActions(PasswordGenerationActions actions) {
22 UserAction action;
23 if (actions.password_accepted) {
24 if (actions.password_edited)
25 action = ACCEPT_AFTER_EDITING;
26 else
27 action = ACCEPT_ORIGINAL_PASSWORD;
28 } else if (actions.learn_more_visited) {
29 action = LEARN_MORE;
30 } else {
31 action = IGNORE;
32 }
33 UMA_HISTOGRAM_ENUMERATION("PasswordGeneration.UserActions",
34 action, ACTION_ENUM_COUNT);
35 }
36
37 void LogPasswordGenerationEvents(PasswordGenerationEvent event) {
38 UMA_HISTOGRAM_ENUMERATION("PasswordGeneration.Events",
39 event, EVENT_ENUM_COUNT);
40 }
41
42 } // namespace password_generation
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698