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

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: A typo. 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 {
10
11 // Enumerates user actions after password generation bubble is shown.
12 enum UserAction {
13 // User closes the bubble without any meaningful actions (e.g. use backspace
14 // key, close the bubble, click outside the bubble, etc).
15 IGNORE_FEATURE,
16
17 // User navigates to the learn more page. Note that in the current
18 // implementation this will result in closing the bubble so this action
19 // doesn't overlap with the following two actions.
20 LEARN_MORE,
21
22 // User accepts the generated password without manually editing it (but
23 // including changing it through the regenerate button).
24 ACCEPT_ORIGINAL_PASSWORD,
25
26 // User accepts the gererated password after manually editing it.
27 ACCEPT_AFTER_EDITING,
28
29 // Number of enum entries, used for UMA histogram reporting macros.
30 ACTION_ENUM_COUNT
31 };
32
33 } // anonymous namespace
34
35 namespace password_generation {
36
37 PasswordGenerationActions::PasswordGenerationActions()
38 : learn_more_visited(false),
39 password_accepted(false),
40 password_edited(false),
41 password_regenerated(false) {
42 }
43
44 PasswordGenerationActions::~PasswordGenerationActions() {
45 }
46
47 void LogUserActions(PasswordGenerationActions actions) {
48 UserAction action = IGNORE_FEATURE;
49 if (actions.password_accepted) {
50 if (actions.password_edited)
51 action = ACCEPT_AFTER_EDITING;
52 else
53 action = ACCEPT_ORIGINAL_PASSWORD;
54 } else if (actions.learn_more_visited) {
55 action = LEARN_MORE;
56 }
57 UMA_HISTOGRAM_ENUMERATION("PasswordGeneration.UserActions",
58 action, ACTION_ENUM_COUNT);
59 }
60
61 void LogPasswordGenerationEvent(PasswordGenerationEvent event) {
62 UMA_HISTOGRAM_ENUMERATION("PasswordGeneration.Event",
63 event, EVENT_ENUM_COUNT);
64 }
65
66 } // namespace password_generation
OLDNEW
« no previous file with comments | « chrome/common/password_generation_util.h ('k') | chrome/renderer/autofill/password_generation_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698