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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 return; | 72 return; |
73 | 73 |
74 client_->NotifyStorePasswordCalled(); | 74 client_->NotifyStorePasswordCalled(); |
75 | 75 |
76 GURL origin = web_contents()->GetLastCommittedURL().GetOrigin(); | 76 GURL origin = web_contents()->GetLastCommittedURL().GetOrigin(); |
77 std::unique_ptr<autofill::PasswordForm> form( | 77 std::unique_ptr<autofill::PasswordForm> form( |
78 CreatePasswordFormFromCredentialInfo(credential, origin)); | 78 CreatePasswordFormFromCredentialInfo(credential, origin)); |
79 | 79 |
80 std::unique_ptr<autofill::PasswordForm> observed_form = | 80 std::unique_ptr<autofill::PasswordForm> observed_form = |
81 CreateObservedPasswordFormFromOrigin(origin); | 81 CreateObservedPasswordFormFromOrigin(origin); |
82 // Create a custom form fetcher with suppressed HTTP->HTTPS migration. | 82 // Create a custom form fetcher without HTTP->HTTPS migration, as well as |
| 83 // without fetching of suppressed HTTPS credentials on HTTP origins as the API |
| 84 // is only available on HTTPS origins. |
83 auto form_fetcher = base::MakeUnique<FormFetcherImpl>( | 85 auto form_fetcher = base::MakeUnique<FormFetcherImpl>( |
84 PasswordStore::FormDigest(*observed_form), client_, false); | 86 PasswordStore::FormDigest(*observed_form), client_, false, false); |
85 form_manager_ = base::MakeUnique<CredentialManagerPasswordFormManager>( | 87 form_manager_ = base::MakeUnique<CredentialManagerPasswordFormManager>( |
86 client_, GetDriver(), *observed_form, std::move(form), this, nullptr, | 88 client_, GetDriver(), *observed_form, std::move(form), this, nullptr, |
87 std::move(form_fetcher)); | 89 std::move(form_fetcher)); |
88 } | 90 } |
89 | 91 |
90 void CredentialManagerImpl::OnProvisionalSaveComplete() { | 92 void CredentialManagerImpl::OnProvisionalSaveComplete() { |
91 DCHECK(form_manager_); | 93 DCHECK(form_manager_); |
92 DCHECK(client_->IsSavingAndFillingEnabledForCurrentPage()); | 94 DCHECK(client_->IsSavingAndFillingEnabledForCurrentPage()); |
93 const autofill::PasswordForm& form = form_manager_->pending_credentials(); | 95 const autofill::PasswordForm& form = form_manager_->pending_credentials(); |
94 | 96 |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 PasswordStore::FormDigest CredentialManagerImpl::GetSynthesizedFormForOrigin() | 283 PasswordStore::FormDigest CredentialManagerImpl::GetSynthesizedFormForOrigin() |
282 const { | 284 const { |
283 PasswordStore::FormDigest digest = { | 285 PasswordStore::FormDigest digest = { |
284 autofill::PasswordForm::SCHEME_HTML, std::string(), | 286 autofill::PasswordForm::SCHEME_HTML, std::string(), |
285 web_contents()->GetLastCommittedURL().GetOrigin()}; | 287 web_contents()->GetLastCommittedURL().GetOrigin()}; |
286 digest.signon_realm = digest.origin.spec(); | 288 digest.signon_realm = digest.origin.spec(); |
287 return digest; | 289 return digest; |
288 } | 290 } |
289 | 291 |
290 } // namespace password_manager | 292 } // namespace password_manager |
OLD | NEW |