OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef CHROME_BROWSER_UI_VIEWS_PASSWORDS_CREDENTIALS_SELECTION_VIEW_H_ | 4 #ifndef CHROME_BROWSER_UI_VIEWS_PASSWORDS_CREDENTIALS_SELECTION_VIEW_H_ |
5 #define CHROME_BROWSER_UI_VIEWS_PASSWORDS_CREDENTIALS_SELECTION_VIEW_H_ | 5 #define CHROME_BROWSER_UI_VIEWS_PASSWORDS_CREDENTIALS_SELECTION_VIEW_H_ |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "components/autofill/core/common/password_form.h" | 10 #include "components/autofill/core/common/password_form.h" |
11 #include "ui/views/view.h" | 11 #include "ui/views/view.h" |
12 | 12 |
13 namespace views { | 13 namespace views { |
14 class Combobox; | 14 class Combobox; |
15 } | 15 } |
16 | 16 |
17 class ManagePasswordsBubbleModel; | 17 class ManagePasswordsBubbleModel; |
18 | 18 |
19 // A view where the user can select a credential. | 19 // A view where the user can select a credential. |
20 class CredentialsSelectionView : public views::View { | 20 class CredentialsSelectionView : public views::View { |
21 public: | 21 public: |
22 CredentialsSelectionView( | 22 CredentialsSelectionView( |
23 ManagePasswordsBubbleModel* manage_passwords_bubble_model, | 23 ManagePasswordsBubbleModel* manage_passwords_bubble_model, |
24 const std::vector<const autofill::PasswordForm*>& password_forms, | 24 const std::vector<const autofill::PasswordForm*>& password_forms, |
25 const base::string16& best_matched_username); | 25 const base::string16& best_matched_username); |
26 ~CredentialsSelectionView() override; | |
26 | 27 |
27 const autofill::PasswordForm* GetSelectedCredentials(); | 28 const autofill::PasswordForm* GetSelectedCredentials(); |
vasilii
2016/01/13 15:23:46
Comment that the method reports statistics like if
dvadym
2016/01/13 15:39:57
Done.
| |
28 | 29 |
29 private: | 30 private: |
31 views::Combobox* GenerateUsernameCombobox( | |
32 const std::vector<const autofill::PasswordForm*>& forms, | |
33 const base::string16& best_matched_username); | |
34 void ReportUserActionOnce(bool was_update_rejected, int selected_index); | |
35 | |
30 const std::vector<const autofill::PasswordForm*>& password_forms_; | 36 const std::vector<const autofill::PasswordForm*>& password_forms_; |
31 views::Combobox* combobox_; | 37 views::Combobox* combobox_; |
38 int default_index_; | |
39 bool is_default_best_match_; | |
40 bool is_default_preferred_; | |
41 bool action_reported_; | |
32 | 42 |
33 DISALLOW_COPY_AND_ASSIGN(CredentialsSelectionView); | 43 DISALLOW_COPY_AND_ASSIGN(CredentialsSelectionView); |
34 }; | 44 }; |
35 | 45 |
36 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_CREDENTIALS_SELECTION_VIEW_H_ | 46 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_CREDENTIALS_SELECTION_VIEW_H_ |
OLD | NEW |