| 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 "components/password_manager/content/browser/credential_manager_impl.h" | 5 #include "components/password_manager/content/browser/credential_manager_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 std::unique_ptr<autofill::PasswordForm> form( | 76 std::unique_ptr<autofill::PasswordForm> form( |
| 77 CreatePasswordFormFromCredentialInfo(credential, origin)); | 77 CreatePasswordFormFromCredentialInfo(credential, origin)); |
| 78 | 78 |
| 79 std::unique_ptr<autofill::PasswordForm> observed_form = | 79 std::unique_ptr<autofill::PasswordForm> observed_form = |
| 80 CreateObservedPasswordFormFromOrigin(origin); | 80 CreateObservedPasswordFormFromOrigin(origin); |
| 81 // Create a custom form fetcher without HTTP->HTTPS migration, as well as | 81 // Create a custom form fetcher without HTTP->HTTPS migration, as well as |
| 82 // without fetching of suppressed HTTPS credentials on HTTP origins as the API | 82 // without fetching of suppressed HTTPS credentials on HTTP origins as the API |
| 83 // is only available on HTTPS origins. | 83 // is only available on HTTPS origins. |
| 84 auto form_fetcher = base::MakeUnique<FormFetcherImpl>( | 84 auto form_fetcher = base::MakeUnique<FormFetcherImpl>( |
| 85 PasswordStore::FormDigest(*observed_form), client_, false, false); | 85 PasswordStore::FormDigest(*observed_form), client_, false, false); |
| 86 form_manager_ = base::MakeUnique<CredentialManagerPasswordFormManager>( | 86 form_manager_ = base::MakeRefCounted<CredentialManagerPasswordFormManager>( |
| 87 client_, GetDriver(), *observed_form, std::move(form), this, nullptr, | 87 client_, GetDriver(), *observed_form, std::move(form), this, nullptr, |
| 88 std::move(form_fetcher)); | 88 std::move(form_fetcher)); |
| 89 } | 89 } |
| 90 | 90 |
| 91 void CredentialManagerImpl::OnProvisionalSaveComplete() { | 91 void CredentialManagerImpl::OnProvisionalSaveComplete() { |
| 92 DCHECK(form_manager_); | 92 DCHECK(form_manager_); |
| 93 DCHECK(client_->IsSavingAndFillingEnabledForCurrentPage()); | 93 DCHECK(client_->IsSavingAndFillingEnabledForCurrentPage()); |
| 94 const autofill::PasswordForm& form = form_manager_->pending_credentials(); | 94 const autofill::PasswordForm& form = form_manager_->pending_credentials(); |
| 95 | 95 |
| 96 if (form_manager_->IsPendingCredentialsPublicSuffixMatch()) { | 96 if (form_manager_->IsPendingCredentialsPublicSuffixMatch()) { |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 PasswordStore::FormDigest CredentialManagerImpl::GetSynthesizedFormForOrigin() | 279 PasswordStore::FormDigest CredentialManagerImpl::GetSynthesizedFormForOrigin() |
| 280 const { | 280 const { |
| 281 PasswordStore::FormDigest digest = { | 281 PasswordStore::FormDigest digest = { |
| 282 autofill::PasswordForm::SCHEME_HTML, std::string(), | 282 autofill::PasswordForm::SCHEME_HTML, std::string(), |
| 283 web_contents()->GetLastCommittedURL().GetOrigin()}; | 283 web_contents()->GetLastCommittedURL().GetOrigin()}; |
| 284 digest.signon_realm = digest.origin.spec(); | 284 digest.signon_realm = digest.origin.spec(); |
| 285 return digest; | 285 return digest; |
| 286 } | 286 } |
| 287 | 287 |
| 288 } // namespace password_manager | 288 } // namespace password_manager |
| OLD | NEW |