| 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_dispatc
her.h" | 5 #include "components/password_manager/content/browser/credential_manager_dispatc
her.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 const password_manager::CredentialInfo& credential) { | 57 const password_manager::CredentialInfo& credential) { |
| 58 DCHECK(credential.type != CredentialType::CREDENTIAL_TYPE_EMPTY); | 58 DCHECK(credential.type != CredentialType::CREDENTIAL_TYPE_EMPTY); |
| 59 DCHECK(request_id); | 59 DCHECK(request_id); |
| 60 web_contents()->GetRenderViewHost()->Send( | 60 web_contents()->GetRenderViewHost()->Send( |
| 61 new CredentialManagerMsg_AcknowledgeStore( | 61 new CredentialManagerMsg_AcknowledgeStore( |
| 62 web_contents()->GetRenderViewHost()->GetRoutingID(), request_id)); | 62 web_contents()->GetRenderViewHost()->GetRoutingID(), request_id)); |
| 63 | 63 |
| 64 if (!client_->IsSavingAndFillingEnabledForCurrentPage()) | 64 if (!client_->IsSavingAndFillingEnabledForCurrentPage()) |
| 65 return; | 65 return; |
| 66 | 66 |
| 67 scoped_ptr<autofill::PasswordForm> form(CreatePasswordFormFromCredentialInfo( | 67 std::unique_ptr<autofill::PasswordForm> form( |
| 68 credential, web_contents()->GetLastCommittedURL().GetOrigin())); | 68 CreatePasswordFormFromCredentialInfo( |
| 69 credential, web_contents()->GetLastCommittedURL().GetOrigin())); |
| 69 form->skip_zero_click = !IsZeroClickAllowed(); | 70 form->skip_zero_click = !IsZeroClickAllowed(); |
| 70 | 71 |
| 71 form_manager_.reset(new CredentialManagerPasswordFormManager( | 72 form_manager_.reset(new CredentialManagerPasswordFormManager( |
| 72 client_, GetDriver(), *form, this)); | 73 client_, GetDriver(), *form, this)); |
| 73 } | 74 } |
| 74 | 75 |
| 75 void CredentialManagerDispatcher::OnProvisionalSaveComplete() { | 76 void CredentialManagerDispatcher::OnProvisionalSaveComplete() { |
| 76 DCHECK(form_manager_); | 77 DCHECK(form_manager_); |
| 77 DCHECK(client_->IsSavingAndFillingEnabledForCurrentPage()); | 78 DCHECK(client_->IsSavingAndFillingEnabledForCurrentPage()); |
| 78 | 79 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 DCHECK(pending_require_user_mediation_); | 274 DCHECK(pending_require_user_mediation_); |
| 274 pending_require_user_mediation_.reset(); | 275 pending_require_user_mediation_.reset(); |
| 275 } | 276 } |
| 276 | 277 |
| 277 bool CredentialManagerDispatcher::IsUpdatingCredentialAllowed() const { | 278 bool CredentialManagerDispatcher::IsUpdatingCredentialAllowed() const { |
| 278 return !client_->DidLastPageLoadEncounterSSLErrors() && | 279 return !client_->DidLastPageLoadEncounterSSLErrors() && |
| 279 !client_->IsOffTheRecord(); | 280 !client_->IsOffTheRecord(); |
| 280 } | 281 } |
| 281 | 282 |
| 282 } // namespace password_manager | 283 } // namespace password_manager |
| OLD | NEW |