OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_PASSWORD_MANAGER_UPDATE_PASSWORD_INFOBAR_DELEGATE_ANDROID
_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_UPDATE_PASSWORD_INFOBAR_DELEGATE_ANDROID
_H_ |
6 #define CHROME_BROWSER_PASSWORD_MANAGER_UPDATE_PASSWORD_INFOBAR_DELEGATE_ANDROID
_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_UPDATE_PASSWORD_INFOBAR_DELEGATE_ANDROID
_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 base::string16 GetBranding() const; | 33 base::string16 GetBranding() const; |
34 bool is_smartlock_branding_enabled() const { | 34 bool is_smartlock_branding_enabled() const { |
35 return is_smartlock_branding_enabled_; | 35 return is_smartlock_branding_enabled_; |
36 } | 36 } |
37 | 37 |
38 // Returns whether the user has multiple saved credentials, of which the | 38 // Returns whether the user has multiple saved credentials, of which the |
39 // infobar affects just one. In this case the infobar should clarify which | 39 // infobar affects just one. In this case the infobar should clarify which |
40 // credential is being affected. | 40 // credential is being affected. |
41 bool ShowMultipleAccounts() const; | 41 bool ShowMultipleAccounts() const; |
42 | 42 |
43 const std::vector<const autofill::PasswordForm*>& GetCurrentForms() const; | 43 const std::vector<std::unique_ptr<autofill::PasswordForm>>& |
| 44 GetCurrentForms() const; |
44 | 45 |
45 // Returns the username of the saved credentials in the case when there is | 46 // Returns the username of the saved credentials in the case when there is |
46 // only one credential pair stored. | 47 // only one credential pair stored. |
47 base::string16 get_username_for_single_account() { | 48 base::string16 get_username_for_single_account() { |
48 return passwords_state_.form_manager() | 49 return passwords_state_.form_manager() |
49 ->pending_credentials() | 50 ->pending_credentials() |
50 .username_value; | 51 .username_value; |
51 } | 52 } |
52 | 53 |
53 private: | 54 private: |
54 UpdatePasswordInfoBarDelegate( | 55 UpdatePasswordInfoBarDelegate( |
55 content::WebContents* web_contents, | 56 content::WebContents* web_contents, |
56 std::unique_ptr<password_manager::PasswordFormManager> form_to_update, | 57 std::unique_ptr<password_manager::PasswordFormManager> form_to_update, |
57 bool is_smartlock_branding_enabled); | 58 bool is_smartlock_branding_enabled); |
58 | 59 |
59 // ConfirmInfoBarDelegate: | 60 // ConfirmInfoBarDelegate: |
60 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; | 61 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; |
61 base::string16 GetButtonLabel(InfoBarButton button) const override; | 62 base::string16 GetButtonLabel(InfoBarButton button) const override; |
62 bool Accept() override; | 63 bool Accept() override; |
63 bool Cancel() override; | 64 bool Cancel() override; |
64 | 65 |
65 ManagePasswordsState passwords_state_; | 66 ManagePasswordsState passwords_state_; |
66 base::string16 branding_; | 67 base::string16 branding_; |
67 bool is_smartlock_branding_enabled_; | 68 bool is_smartlock_branding_enabled_; |
68 | 69 |
69 DISALLOW_COPY_AND_ASSIGN(UpdatePasswordInfoBarDelegate); | 70 DISALLOW_COPY_AND_ASSIGN(UpdatePasswordInfoBarDelegate); |
70 }; | 71 }; |
71 | 72 |
72 #endif // CHROME_BROWSER_PASSWORD_MANAGER_UPDATE_PASSWORD_INFOBAR_DELEGATE_ANDR
OID_H_ | 73 #endif // CHROME_BROWSER_PASSWORD_MANAGER_UPDATE_PASSWORD_INFOBAR_DELEGATE_ANDR
OID_H_ |
OLD | NEW |