Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 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 #ifndef CHROME_COMMON_PASSWORD_GENERATION_UTIL_H_ | |
| 6 #define CHROME_COMMON_PASSWORD_GENERATION_UTIL_H_ | |
| 7 | |
| 8 namespace password_generation { | |
| 9 | |
| 10 // Enumerates various events related to the password generation process. | |
| 11 enum PasswordGenerationEvent { | |
| 12 // Account creation form is detected. | |
| 13 SIGN_UP_DETECTED, | |
| 14 | |
| 15 // Password generation icon is shown inside the first password field. | |
| 16 ICON_SHOWN, | |
| 17 | |
| 18 // Password generation bubble is shown after user clicks on the icon. | |
| 19 BUBBLE_SHOWN, | |
| 20 | |
| 21 // Generated password is submitted. | |
| 22 SUBMITTED, | |
| 23 | |
| 24 // Number of enum entries, used for UMA histogram reporting macros. | |
| 25 EVENT_ENUM_COUNT, | |
| 26 }; | |
| 27 | |
| 28 // Enumerates user actions after password generation bubble is shown. | |
| 29 enum UserAction { | |
| 30 // User closes the bubble without any meaningful actions (e.g. use backspace | |
| 31 // key, close the bubble, click outside the bubble, etc). | |
| 32 IGNORE, | |
| 33 | |
| 34 // User navigates to the learn more page. Note that in the current | |
| 35 // implementation this will result in closing the bubble so this action | |
| 36 // doesn't overlap with the following two actions. | |
| 37 LEARN_MORE, | |
| 38 | |
| 39 // User accepts the generated password without manually editing it (but | |
| 40 // including changing it through the regenerate button). | |
| 41 ACCEPT_ORIGINAL_PASSWORD, | |
| 42 | |
| 43 // User accepts the gererated password after manually editing it. | |
| 44 ACCEPT_AFTER_EDITING, | |
| 45 | |
| 46 // Number of enum entries, used for UMA histogram reporting macros. | |
| 47 ACTION_ENUM_COUNT, | |
| 48 }; | |
| 49 | |
| 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; | |
| 54 | |
| 55 // Whether the user has accepted the generated password. | |
| 56 bool password_accepted; | |
| 57 | |
| 58 // Whether the user has manually edited password entry. | |
| 59 bool password_edited; | |
| 60 | |
| 61 // Whether the user has clicked on the regenerate button. | |
| 62 bool password_regenerated; | |
| 63 | |
| 64 PasswordGenerationActions(); | |
| 65 ~PasswordGenerationActions(); | |
| 66 }; | |
| 67 | |
| 68 void LogUserActions(PasswordGenerationActions actions); | |
| 69 | |
| 70 void LogPasswordGenerationEvents(PasswordGenerationEvent event); | |
|
Ilya Sherman
2012/07/18 23:13:23
nit: "Events" -> "Event"
zysxqn
2012/07/18 23:21:29
Done.
| |
| 71 | |
| 72 } // namespace password_generation | |
| 73 | |
| 74 #endif // CHROME_COMMON_PASSWORD_GENERATION_UTIL_H_ | |
| OLD | NEW |