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 #include "chrome/browser/password_manager/update_password_infobar_delegate_andro
id.h" | 5 #include "chrome/browser/password_manager/update_password_infobar_delegate_andro
id.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/numerics/safe_conversions.h" | 8 #include "base/numerics/safe_conversions.h" |
9 #include "chrome/browser/infobars/infobar_service.h" | 9 #include "chrome/browser/infobars/infobar_service.h" |
10 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 10 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 } | 45 } |
46 | 46 |
47 bool UpdatePasswordInfoBarDelegate::ShowMultipleAccounts() const { | 47 bool UpdatePasswordInfoBarDelegate::ShowMultipleAccounts() const { |
48 const password_manager::PasswordFormManager* form_manager = | 48 const password_manager::PasswordFormManager* form_manager = |
49 passwords_state_.form_manager(); | 49 passwords_state_.form_manager(); |
50 bool is_password_overriden = | 50 bool is_password_overriden = |
51 form_manager && form_manager->password_overridden(); | 51 form_manager && form_manager->password_overridden(); |
52 return GetCurrentForms().size() > 1 && !is_password_overriden; | 52 return GetCurrentForms().size() > 1 && !is_password_overriden; |
53 } | 53 } |
54 | 54 |
55 const std::vector<const autofill::PasswordForm*>& | 55 const std::vector<std::unique_ptr<autofill::PasswordForm>>& |
56 UpdatePasswordInfoBarDelegate::GetCurrentForms() const { | 56 UpdatePasswordInfoBarDelegate::GetCurrentForms() const { |
57 return passwords_state_.GetCurrentForms(); | 57 return passwords_state_.GetCurrentForms(); |
58 } | 58 } |
59 | 59 |
60 UpdatePasswordInfoBarDelegate::UpdatePasswordInfoBarDelegate( | 60 UpdatePasswordInfoBarDelegate::UpdatePasswordInfoBarDelegate( |
61 content::WebContents* web_contents, | 61 content::WebContents* web_contents, |
62 std::unique_ptr<password_manager::PasswordFormManager> form_to_update, | 62 std::unique_ptr<password_manager::PasswordFormManager> form_to_update, |
63 bool is_smartlock_branding_enabled) | 63 bool is_smartlock_branding_enabled) |
64 : is_smartlock_branding_enabled_(is_smartlock_branding_enabled) { | 64 : is_smartlock_branding_enabled_(is_smartlock_branding_enabled) { |
65 // TODO(melandory): Add histograms, crbug.com/577129 | 65 // TODO(melandory): Add histograms, crbug.com/577129 |
(...skipping 26 matching lines...) Expand all Loading... |
92 form_manager->Update(*GetCurrentForms()[form_index]); | 92 form_manager->Update(*GetCurrentForms()[form_index]); |
93 } else { | 93 } else { |
94 form_manager->Update(form_manager->pending_credentials()); | 94 form_manager->Update(form_manager->pending_credentials()); |
95 } | 95 } |
96 return true; | 96 return true; |
97 } | 97 } |
98 | 98 |
99 bool UpdatePasswordInfoBarDelegate::Cancel() { | 99 bool UpdatePasswordInfoBarDelegate::Cancel() { |
100 return true; | 100 return true; |
101 } | 101 } |
OLD | NEW |