OLD | NEW |
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 Loading... |
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 ScopedVector<autofill::PasswordForm> local_forms, | 211 ScopedVector<autofill::PasswordForm> local_forms, |
212 ScopedVector<autofill::PasswordForm> federated_forms, | 212 ScopedVector<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 ManagePasswordsUIController* manage_passwords_ui_controller = | 215 ManagePasswordsUIController* manage_passwords_ui_controller = |
215 ManagePasswordsUIController::FromWebContents(web_contents()); | 216 ManagePasswordsUIController::FromWebContents(web_contents()); |
216 return manage_passwords_ui_controller->OnChooseCredentials( | 217 return manage_passwords_ui_controller->OnChooseCredentials( |
217 local_forms.Pass(), federated_forms.Pass(), callback); | 218 local_forms.Pass(), federated_forms.Pass(), origin, callback); |
218 } | 219 } |
219 | 220 |
220 void ChromePasswordManagerClient::AutomaticPasswordSave( | 221 void ChromePasswordManagerClient::AutomaticPasswordSave( |
221 scoped_ptr<password_manager::PasswordFormManager> saved_form) { | 222 scoped_ptr<password_manager::PasswordFormManager> saved_form) { |
222 #if defined(OS_ANDROID) | 223 #if defined(OS_ANDROID) |
223 GeneratedPasswordSavedInfoBarDelegateAndroid::Create(web_contents()); | 224 GeneratedPasswordSavedInfoBarDelegateAndroid::Create(web_contents()); |
224 #else | 225 #else |
225 if (IsTheHotNewBubbleUIEnabled()) { | 226 if (IsTheHotNewBubbleUIEnabled()) { |
226 ManagePasswordsUIController* manage_passwords_ui_controller = | 227 ManagePasswordsUIController* manage_passwords_ui_controller = |
227 ManagePasswordsUIController::FromWebContents(web_contents()); | 228 ManagePasswordsUIController::FromWebContents(web_contents()); |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS; | 559 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS; |
559 } else { | 560 } else { |
560 // Allow by default. | 561 // Allow by default. |
561 autofill_sync_state_ = ALLOW_SYNC_CREDENTIALS; | 562 autofill_sync_state_ = ALLOW_SYNC_CREDENTIALS; |
562 } | 563 } |
563 } | 564 } |
564 | 565 |
565 const GURL& ChromePasswordManagerClient::GetMainFrameURL() { | 566 const GURL& ChromePasswordManagerClient::GetMainFrameURL() { |
566 return web_contents()->GetVisibleURL(); | 567 return web_contents()->GetVisibleURL(); |
567 } | 568 } |
OLD | NEW |