| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORD_ITEMS_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORD_ITEMS_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORD_ITEMS_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORD_ITEMS_VIEW_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "components/autofill/core/common/password_form.h" | 12 #include "components/autofill/core/common/password_form.h" |
| 13 #include "ui/views/view.h" | 13 #include "ui/views/view.h" |
| 14 | 14 |
| 15 namespace views { |
| 16 class Textfield; |
| 17 class Label; |
| 18 } // namespace views |
| 19 |
| 15 class ManagePasswordsBubbleModel; | 20 class ManagePasswordsBubbleModel; |
| 16 | 21 |
| 22 // Standalone functions for creating username and password views. |
| 23 std::unique_ptr<views::Label> GenerateUsernameLabel( |
| 24 const autofill::PasswordForm& form); |
| 25 std::unique_ptr<views::Label> GeneratePasswordLabel( |
| 26 const autofill::PasswordForm& form); |
| 27 std::unique_ptr<views::Textfield> GenerateUsernameEditable( |
| 28 const autofill::PasswordForm& form); |
| 29 |
| 17 // A custom view of individual credentials. The view is represented as a table | 30 // A custom view of individual credentials. The view is represented as a table |
| 18 // where each row can be in three distinct states: | 31 // where each row can be in three distinct states: |
| 19 // | 32 // |
| 20 // * Present credentials the user may choose to save. | |
| 21 // * Present already-saved credentials to the user for management. | 33 // * Present already-saved credentials to the user for management. |
| 22 // * Offer the user the ability to undo a deletion action. | 34 // * Offer the user the ability to undo a deletion action. |
| 23 class ManagePasswordItemsView : public views::View { | 35 class ManagePasswordItemsView : public views::View { |
| 24 public: | 36 public: |
| 25 ManagePasswordItemsView( | 37 ManagePasswordItemsView( |
| 26 ManagePasswordsBubbleModel* manage_passwords_bubble_model, | 38 ManagePasswordsBubbleModel* manage_passwords_bubble_model, |
| 27 const std::vector<autofill::PasswordForm>* password_forms); | 39 const std::vector<autofill::PasswordForm>* password_forms); |
| 28 ManagePasswordItemsView( | 40 ManagePasswordItemsView( |
| 29 ManagePasswordsBubbleModel* manage_passwords_bubble_model, | 41 ManagePasswordsBubbleModel* manage_passwords_bubble_model, |
| 30 const autofill::PasswordForm* password_form); | 42 const autofill::PasswordForm* password_form); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 41 // Changes the views according to the state of |password_forms_rows_|. | 53 // Changes the views according to the state of |password_forms_rows_|. |
| 42 void Refresh(); | 54 void Refresh(); |
| 43 | 55 |
| 44 std::vector<std::unique_ptr<PasswordFormRow>> password_forms_rows_; | 56 std::vector<std::unique_ptr<PasswordFormRow>> password_forms_rows_; |
| 45 ManagePasswordsBubbleModel* model_; | 57 ManagePasswordsBubbleModel* model_; |
| 46 | 58 |
| 47 DISALLOW_COPY_AND_ASSIGN(ManagePasswordItemsView); | 59 DISALLOW_COPY_AND_ASSIGN(ManagePasswordItemsView); |
| 48 }; | 60 }; |
| 49 | 61 |
| 50 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORD_ITEMS_VIEW_H_ | 62 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORD_ITEMS_VIEW_H_ |
| OLD | NEW |