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

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

Issue 877613004: [Credential Manager API] Pass origin to Account chooser UI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@local_vs_federated
Patch Set: Created 5 years, 10 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/chrome_password_manager_client.h" 5 #include "chrome/browser/password_manager/chrome_password_manager_client.h"
6 6
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/singleton.h" 9 #include "base/memory/singleton.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 form_to_save->realm(), GetPrefs()))); 203 form_to_save->realm(), GetPrefs())));
204 SavePasswordInfoBarDelegate::Create( 204 SavePasswordInfoBarDelegate::Create(
205 web_contents(), form_to_save.Pass(), uma_histogram_suffix); 205 web_contents(), form_to_save.Pass(), uma_histogram_suffix);
206 } 206 }
207 return true; 207 return true;
208 } 208 }
209 209
210 bool ChromePasswordManagerClient::PromptUserToChooseCredentials( 210 bool ChromePasswordManagerClient::PromptUserToChooseCredentials(
211 const std::vector<autofill::PasswordForm*>& local_forms, 211 const std::vector<autofill::PasswordForm*>& local_forms,
212 const std::vector<autofill::PasswordForm*>& federated_forms, 212 const std::vector<autofill::PasswordForm*>& federated_forms,
213 const GURL& origin,
213 base::Callback<void(const password_manager::CredentialInfo&)> callback) { 214 base::Callback<void(const password_manager::CredentialInfo&)> callback) {
214 // Take ownership of all the password form objects in the forms vectors. 215 // Take ownership of all the password form objects in the forms vectors.
215 ScopedVector<autofill::PasswordForm> local_entries; 216 ScopedVector<autofill::PasswordForm> local_entries;
216 local_entries.assign(local_forms.begin(), local_forms.end()); 217 local_entries.assign(local_forms.begin(), local_forms.end());
217 ScopedVector<autofill::PasswordForm> federated_entries; 218 ScopedVector<autofill::PasswordForm> federated_entries;
218 federated_entries.assign(federated_forms.begin(), federated_forms.end()); 219 federated_entries.assign(federated_forms.begin(), federated_forms.end());
219 220
220 ManagePasswordsUIController* manage_passwords_ui_controller = 221 ManagePasswordsUIController* manage_passwords_ui_controller =
221 ManagePasswordsUIController::FromWebContents(web_contents()); 222 ManagePasswordsUIController::FromWebContents(web_contents());
222 return manage_passwords_ui_controller->OnChooseCredentials( 223 return manage_passwords_ui_controller->OnChooseCredentials(
223 local_entries.Pass(), federated_entries.Pass(), callback); 224 local_entries.Pass(), federated_entries.Pass(), origin, callback);
224 } 225 }
225 226
226 void ChromePasswordManagerClient::AutomaticPasswordSave( 227 void ChromePasswordManagerClient::AutomaticPasswordSave(
227 scoped_ptr<password_manager::PasswordFormManager> saved_form) { 228 scoped_ptr<password_manager::PasswordFormManager> saved_form) {
228 #if defined(OS_ANDROID) 229 #if defined(OS_ANDROID)
229 GeneratedPasswordSavedInfoBarDelegateAndroid::Create(web_contents()); 230 GeneratedPasswordSavedInfoBarDelegateAndroid::Create(web_contents());
230 #else 231 #else
231 if (IsTheHotNewBubbleUIEnabled()) { 232 if (IsTheHotNewBubbleUIEnabled()) {
232 ManagePasswordsUIController* manage_passwords_ui_controller = 233 ManagePasswordsUIController* manage_passwords_ui_controller =
233 ManagePasswordsUIController::FromWebContents(web_contents()); 234 ManagePasswordsUIController::FromWebContents(web_contents());
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS; 565 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS;
565 } else { 566 } else {
566 // Allow by default. 567 // Allow by default.
567 autofill_sync_state_ = ALLOW_SYNC_CREDENTIALS; 568 autofill_sync_state_ = ALLOW_SYNC_CREDENTIALS;
568 } 569 }
569 } 570 }
570 571
571 const GURL& ChromePasswordManagerClient::GetMainFrameURL() { 572 const GURL& ChromePasswordManagerClient::GetMainFrameURL() {
572 return web_contents()->GetVisibleURL(); 573 return web_contents()->GetVisibleURL();
573 } 574 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698