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_BROWSER_UI_PASSWORD_GENERATION_STATUS_H_ | |
| 6 #define CHROME_BROWSER_UI_PASSWORD_GENERATION_STATUS_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 namespace password_generation { | |
| 11 | |
| 12 // Enumerates various events related to the password generation process. | |
| 13 enum PasswordGenerationEvent { | |
| 14 // Account creation form is detected. | |
| 15 SIGN_UP_DETECTED, | |
| 16 | |
| 17 // Password generation icon is shown inside the first password field. | |
| 18 ICON_SHOWN, | |
| 19 | |
| 20 // Password generation bubble is shown after user clicks on the icon. | |
| 21 BUBBLE_SHOWN, | |
| 22 | |
| 23 // Generated password is submitted. | |
| 24 SUBMITTED, | |
| 25 | |
| 26 // Number of enum entries, used for UMA histogram reporting macros. | |
| 27 EVENT_ENUM_COUNT, | |
| 28 }; | |
| 29 | |
| 30 // Enumerates user actions after password generation bubble is shown. | |
| 31 enum UserAction { | |
| 32 // User closes the bubble without any meaningful actions (e.g. use backspace | |
| 33 // key, close the bubble, click outside the bubble, etc). | |
| 34 IGNORE, | |
| 35 | |
| 36 // User navigates to the learn more page. Note that in the current | |
| 37 // implementation this will result to closing the bubble so this action | |
| 38 // doesn't overlap with the following two actions. | |
| 39 LEARN_MORE, | |
| 40 | |
| 41 // User accepts the generated password without manually editing it (but | |
| 42 // including changing it through the regenerate button). | |
| 43 ACCEPT_ORIGINAL_PASSWORD, | |
| 44 | |
| 45 // User accepts the gererated password after manually editing it. | |
| 46 ACCEPT_AFTER_EDITING, | |
| 47 | |
| 48 // Number of enum entries, used for UMA histogram reporting macros. | |
| 49 ACTION_ENUM_COUNT, | |
| 50 }; | |
| 51 | |
| 52 // Data structure to store various password generation status . | |
| 53 struct PasswordGenerationStatus { | |
|
Garrett Casto
2012/07/18 17:20:03
Given the other suggestions, can you drop the gene
zysxqn
2012/07/18 19:16:46
Done.
| |
| 54 // Store the generated password. | |
| 55 std::string generated_password; | |
| 56 | |
| 57 // Whether the user has clicked on the learn more link. | |
| 58 bool learn_more_visited; | |
| 59 | |
| 60 // Whether the user has accepted the generated password. | |
| 61 bool password_accepted; | |
| 62 | |
| 63 // Whether the user has manually edited password entry. | |
| 64 bool password_edited; | |
| 65 | |
| 66 // Whether the user has clicked on the regereated button. | |
| 67 bool password_regenerated; | |
| 68 | |
| 69 PasswordGenerationStatus(); | |
| 70 ~PasswordGenerationStatus(); | |
| 71 }; | |
| 72 | |
| 73 } // namespace password_generation | |
| 74 | |
| 75 #endif // CHROME_BROWSER_UI_PASSWORD_GENERATION_STATUS_H_ | |
| OLD | NEW |