Support for unpacked ARM packed relocations.
[chromium-blink-merge.git] / components / autofill / core / common / password_generation_util.h
blobdaf3c201e07f0ff65fb07b12ad923e0a4a954072
1 // Copyright 2013 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.
5 #ifndef COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_GENERATION_UTIL_H_
6 #define COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_GENERATION_UTIL_H_
8 namespace autofill {
9 namespace password_generation {
11 // Enumerates various events related to the password generation process.
12 // Do not remove items from this enum as they are used for UMA stats logging.
13 enum PasswordGenerationEvent {
14 // No Account creation form is detected.
15 NO_SIGN_UP_DETECTED,
17 // Account creation form is detected.
18 SIGN_UP_DETECTED,
20 // DEPRECATED: Password generation icon shown (old UI).
21 DEPRECATED_ICON_SHOWN,
23 // DEPRECATED: Password generation bubble shown (old UI).
24 DEPRECATED_BUBBLE_SHOWN,
26 // Password generation could be triggered if the user selects the appropriate
27 // element.
28 GENERATION_AVAILABLE,
30 // Password generation popup is shown after user focuses the appropriate
31 // password field.
32 GENERATION_POPUP_SHOWN,
34 // Generated password was accepted by the user.
35 PASSWORD_ACCEPTED,
37 // User focused the password field containing the generated password.
38 EDITING_POPUP_SHOWN,
40 // Password was changed after generation.
41 PASSWORD_EDITED,
43 // Generated password was deleted by the user
44 PASSWORD_DELETED,
46 // Number of enum entries, used for UMA histogram reporting macros.
47 EVENT_ENUM_COUNT
50 // Wrapper to store the user interactions with the password generation bubble.
51 struct PasswordGenerationActions {
52 // Whether the user has clicked on the learn more link.
53 bool learn_more_visited;
55 // Whether the user has accepted the generated password.
56 bool password_accepted;
58 // Whether the user has manually edited password entry.
59 bool password_edited;
61 // Whether the user has clicked on the regenerate button.
62 bool password_regenerated;
64 PasswordGenerationActions();
65 ~PasswordGenerationActions();
68 void LogUserActions(PasswordGenerationActions actions);
70 void LogPasswordGenerationEvent(PasswordGenerationEvent event);
72 // Enumerates user actions after password generation bubble is shown.
73 // These are visible for testing purposes.
74 enum UserAction {
75 // User closes the bubble without any meaningful actions (e.g. use backspace
76 // key, close the bubble, click outside the bubble, etc).
77 IGNORE_FEATURE,
79 // User navigates to the learn more page. Note that in the current
80 // implementation this will result in closing the bubble so this action
81 // doesn't overlap with the following two actions.
82 LEARN_MORE,
84 // User accepts the generated password without manually editing it (but
85 // including changing it through the regenerate button).
86 ACCEPT_ORIGINAL_PASSWORD,
88 // User accepts the gererated password after manually editing it.
89 ACCEPT_AFTER_EDITING,
91 // Number of enum entries, used for UMA histogram reporting macros.
92 ACTION_ENUM_COUNT
95 // Returns true if Password Generation is enabled according to the field
96 // trial result and the flags.
97 bool IsPasswordGenerationEnabled();
99 } // namespace password_generation
100 } // namespace autofill
102 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_GENERATION_UTIL_H_