Chromium Code Reviews| Index: chrome/browser/ui/password_generation_status.h |
| diff --git a/chrome/browser/ui/password_generation_status.h b/chrome/browser/ui/password_generation_status.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b075100c0b4de5e746a3d018d505582f937dc144 |
| --- /dev/null |
| +++ b/chrome/browser/ui/password_generation_status.h |
| @@ -0,0 +1,74 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_UI_PASSWORD_GENERATION_STATUS_H_ |
| +#define CHROME_BROWSER_UI_PASSWORD_GENERATION_STATUS_H_ |
| + |
| +namespace password_generation { |
| + |
| +// Enumerates various events related to the password generation process. |
| +enum PasswordGenerationEvent { |
| + // Account creation form is detected. |
| + SIGN_UP_DETECTED, |
| + |
| + // Password generation icon is shown inside the first password field. |
| + ICON_SHOWN, |
| + |
| + // Password generation bubble is shown after user clicks on the icon. |
| + BUBBLE_SHOWN, |
| + |
| + // Generated password is submitted. |
| + SUBMITTED, |
| + |
| + // Number of enum entries, used for UMA histogram reporting macros. |
| + EVENT_ENUM_COUNT, |
| +}; |
| + |
| +// Enumerates user actions after password generation bubble is shown. |
| +enum UserAction { |
| + // User closes the bubble without any meaningful actions (e.g. use backspace |
| + // key, close the bubble, click outside the bubble, etc). |
| + IGNORE, |
| + |
| + // User navigates to the learn more page. Note that in the current |
| + // implementation this will result to closing the bubble so this action |
|
Ilya Sherman
2012/07/18 20:48:56
nit: "will result to" -> "will result in"
zysxqn
2012/07/18 22:46:17
Done.
|
| + // doesn't overlap with the following two actions. |
| + LEARN_MORE, |
| + |
| + // User accepts the generated password without manually editing it (but |
| + // including changing it through the regenerate button). |
| + ACCEPT_ORIGINAL_PASSWORD, |
| + |
| + // User accepts the gererated password after manually editing it. |
| + ACCEPT_AFTER_EDITING, |
| + |
| + // Number of enum entries, used for UMA histogram reporting macros. |
| + ACTION_ENUM_COUNT, |
| +}; |
|
Ilya Sherman
2012/07/18 20:48:56
nit: Can this enum be tucked into an anonymous nam
zysxqn
2012/07/18 22:46:17
Feel that putting it in the header file will make
Ilya Sherman
2012/07/18 23:13:23
The primary description for the histogram actually
zysxqn
2012/07/18 23:21:29
Done.
|
| + |
| +// Data structure to store various password generation status . |
|
Ilya Sherman
2012/07/18 20:48:57
Optional nit: Perhaps something more like "Wrapper
zysxqn
2012/07/18 22:46:17
hmm, changed to "Wrapper to store user
interaction
|
| +struct PasswordGenerationActions { |
| + // Whether the user has clicked on the learn more link. |
| + bool learn_more_visited; |
| + |
| + // Whether the user has accepted the generated password. |
| + bool password_accepted; |
| + |
| + // Whether the user has manually edited password entry. |
| + bool password_edited; |
| + |
| + // Whether the user has clicked on the regereated button. |
|
Ilya Sherman
2012/07/18 20:48:57
nit: "regereated" -> "regenerate"
zysxqn
2012/07/18 22:46:17
Done.
|
| + bool password_regenerated; |
| + |
| + PasswordGenerationActions(); |
| + ~PasswordGenerationActions(); |
| +}; |
| + |
| +void UpdateUserActionsHistogram(PasswordGenerationActions actions); |
|
Ilya Sherman
2012/07/18 20:48:57
Optional nit: Perhaps "LogPasswordGenerationUserAc
zysxqn
2012/07/18 22:46:17
Done.
|
| + |
| +void UpdateEventsHistogram(PasswordGenerationEvent event); |
|
Ilya Sherman
2012/07/18 20:48:57
Optional nit: Perhaps "LogPasswordGenerationEvent"
zysxqn
2012/07/18 22:46:17
Done.
|
| + |
| +} // namespace password_generation |
| + |
| +#endif // CHROME_BROWSER_UI_PASSWORD_GENERATION_STATUS_H_ |