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 <vector> | 9 #include <vector> |
9 | 10 |
10 #include "base/macros.h" | 11 #include "base/macros.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 the user 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<autofill::PasswordForm>* password_forms); |
| 28 ManagePasswordItemsView( |
| 29 ManagePasswordsBubbleModel* manage_passwords_bubble_model, |
| 30 const autofill::PasswordForm* password_form); |
28 | 31 |
29 private: | 32 private: |
30 class PasswordFormRow; | 33 class PasswordFormRow; |
31 | 34 |
32 ~ManagePasswordItemsView() override; | 35 ~ManagePasswordItemsView() override; |
33 | 36 |
34 void AddRows(); | 37 void AddRows(); |
35 void NotifyPasswordFormStatusChanged( | 38 void NotifyPasswordFormStatusChanged( |
36 const autofill::PasswordForm& password_form, bool deleted); | 39 const autofill::PasswordForm& password_form, bool deleted); |
37 | 40 |
38 // Changes the views according to the state of |password_forms_rows_|. | 41 // Changes the views according to the state of |password_forms_rows_|. |
39 void Refresh(); | 42 void Refresh(); |
40 | 43 |
41 ScopedVector<PasswordFormRow> password_forms_rows_; | 44 std::vector<std::unique_ptr<PasswordFormRow>> password_forms_rows_; |
42 ManagePasswordsBubbleModel* model_; | 45 ManagePasswordsBubbleModel* model_; |
43 | 46 |
44 DISALLOW_COPY_AND_ASSIGN(ManagePasswordItemsView); | 47 DISALLOW_COPY_AND_ASSIGN(ManagePasswordItemsView); |
45 }; | 48 }; |
46 | 49 |
47 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORD_ITEMS_VIEW_H_ | 50 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORD_ITEMS_VIEW_H_ |
OLD | NEW |