Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: chrome/browser/password_manager/update_password_infobar_delegate_android.cc

Issue 2253233005: Change ScopedVector to vector<unique_ptr> in the password's UI code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: android+ Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698