| 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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 bool ChromePasswordManagerClient::PromptUserToChooseCredentials( | 242 bool ChromePasswordManagerClient::PromptUserToChooseCredentials( |
| 243 ScopedVector<autofill::PasswordForm> local_forms, | 243 ScopedVector<autofill::PasswordForm> local_forms, |
| 244 ScopedVector<autofill::PasswordForm> federated_forms, | 244 ScopedVector<autofill::PasswordForm> federated_forms, |
| 245 const GURL& origin, | 245 const GURL& origin, |
| 246 base::Callback<void(const password_manager::CredentialInfo&)> callback) { | 246 base::Callback<void(const password_manager::CredentialInfo&)> callback) { |
| 247 return ManagePasswordsUIController::FromWebContents(web_contents())-> | 247 return ManagePasswordsUIController::FromWebContents(web_contents())-> |
| 248 OnChooseCredentials(local_forms.Pass(), federated_forms.Pass(), origin, | 248 OnChooseCredentials(local_forms.Pass(), federated_forms.Pass(), origin, |
| 249 callback); | 249 callback); |
| 250 } | 250 } |
| 251 | 251 |
| 252 void ChromePasswordManagerClient::ForceSavePassword() { |
| 253 password_manager::ContentPasswordManagerDriver* driver = |
| 254 driver_factory_->GetDriverForFrame(web_contents()->GetFocusedFrame()); |
| 255 driver->ForceSavePassword(); |
| 256 } |
| 257 |
| 252 void ChromePasswordManagerClient::NotifyUserAutoSignin( | 258 void ChromePasswordManagerClient::NotifyUserAutoSignin( |
| 253 ScopedVector<autofill::PasswordForm> local_forms) { | 259 ScopedVector<autofill::PasswordForm> local_forms) { |
| 254 DCHECK(!local_forms.empty()); | 260 DCHECK(!local_forms.empty()); |
| 255 ManagePasswordsUIController::FromWebContents(web_contents())-> | 261 ManagePasswordsUIController::FromWebContents(web_contents())-> |
| 256 OnAutoSignin(local_forms.Pass()); | 262 OnAutoSignin(local_forms.Pass()); |
| 257 } | 263 } |
| 258 | 264 |
| 259 void ChromePasswordManagerClient::AutomaticPasswordSave( | 265 void ChromePasswordManagerClient::AutomaticPasswordSave( |
| 260 scoped_ptr<password_manager::PasswordFormManager> saved_form) { | 266 scoped_ptr<password_manager::PasswordFormManager> saved_form) { |
| 261 #if defined(OS_ANDROID) | 267 #if defined(OS_ANDROID) |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS; | 583 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS; |
| 578 } else { | 584 } else { |
| 579 // Allow by default. | 585 // Allow by default. |
| 580 autofill_sync_state_ = ALLOW_SYNC_CREDENTIALS; | 586 autofill_sync_state_ = ALLOW_SYNC_CREDENTIALS; |
| 581 } | 587 } |
| 582 } | 588 } |
| 583 | 589 |
| 584 const GURL& ChromePasswordManagerClient::GetMainFrameURL() const { | 590 const GURL& ChromePasswordManagerClient::GetMainFrameURL() const { |
| 585 return web_contents()->GetVisibleURL(); | 591 return web_contents()->GetVisibleURL(); |
| 586 } | 592 } |
| OLD | NEW |