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..7111a83314705918c13b37f64818e87e5f4e6f4a |
| --- /dev/null |
| +++ b/chrome/browser/ui/password_generation_status.h |
| @@ -0,0 +1,75 @@ |
| +// 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_ |
| + |
| +#include <string> |
| + |
| +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 |
| + // 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, |
| +}; |
| + |
| +// Data structure to store various password generation status . |
| +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.
|
| + // Store the generated password. |
| + std::string generated_password; |
| + |
| + // 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. |
| + bool password_regenerated; |
| + |
| + PasswordGenerationStatus(); |
| + ~PasswordGenerationStatus(); |
| +}; |
| + |
| +} // namespace password_generation |
| + |
| +#endif // CHROME_BROWSER_UI_PASSWORD_GENERATION_STATUS_H_ |