| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/scoped_vector.h" | 11 #include "base/memory/scoped_vector.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 class ManagePasswordsBubbleModel; | 15 class ManagePasswordsBubbleModel; |
| 16 | 16 |
| 17 // A custom view of individual credentials. The view is represented as a table | 17 // A custom view of individual credentials. The view is represented as a table |
| 18 // where each row can be in three distinct states: | 18 // where each row can be in three distinct states: |
| 19 // | 19 // |
| 20 // * Present credentials to the user which she may choose to save. | 20 // * Present credentials the user may choose to save. |
| 21 // * Present already-saved credentials to the user for management. | 21 // * Present already-saved credentials to the user for management. |
| 22 // * Offer the user the ability to undo a deletion action. | 22 // * Offer the user the ability to undo a deletion action. |
| 23 class ManagePasswordItemsView : public views::View { | 23 class ManagePasswordItemsView : public views::View { |
| 24 public: | 24 public: |
| 25 ManagePasswordItemsView( | 25 ManagePasswordItemsView( |
| 26 ManagePasswordsBubbleModel* manage_passwords_bubble_model, | 26 ManagePasswordsBubbleModel* manage_passwords_bubble_model, |
| 27 const std::vector<const autofill::PasswordForm*>& password_forms); | 27 const std::vector<const autofill::PasswordForm*>& password_forms); |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 class PasswordFormRow; | 30 class PasswordFormRow; |
| 31 | 31 |
| 32 ~ManagePasswordItemsView() override; | 32 ~ManagePasswordItemsView() override; |
| 33 | 33 |
| 34 void AddRows(); | 34 void AddRows(); |
| 35 void NotifyPasswordFormStatusChanged( | 35 void NotifyPasswordFormStatusChanged( |
| 36 const autofill::PasswordForm& password_form, bool deleted); | 36 const autofill::PasswordForm& password_form, bool deleted); |
| 37 | 37 |
| 38 // Changes the views according to the state of |password_forms_rows_|. | 38 // Changes the views according to the state of |password_forms_rows_|. |
| 39 void Refresh(); | 39 void Refresh(); |
| 40 | 40 |
| 41 ScopedVector<PasswordFormRow> password_forms_rows_; | 41 ScopedVector<PasswordFormRow> password_forms_rows_; |
| 42 ManagePasswordsBubbleModel* model_; | 42 ManagePasswordsBubbleModel* model_; |
| 43 | 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(ManagePasswordItemsView); | 44 DISALLOW_COPY_AND_ASSIGN(ManagePasswordItemsView); |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORD_ITEMS_VIEW_H_ | 47 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORD_ITEMS_VIEW_H_ |
| OLD | NEW |