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 client_->NotifyStorePasswordCalled(); |
| 68 |
67 GURL origin = web_contents()->GetLastCommittedURL().GetOrigin(); | 69 GURL origin = web_contents()->GetLastCommittedURL().GetOrigin(); |
68 std::unique_ptr<autofill::PasswordForm> form( | 70 std::unique_ptr<autofill::PasswordForm> form( |
69 CreatePasswordFormFromCredentialInfo(credential, origin)); | 71 CreatePasswordFormFromCredentialInfo(credential, origin)); |
70 form->skip_zero_click = !IsZeroClickAllowed(); | 72 form->skip_zero_click = !IsZeroClickAllowed(); |
71 | 73 |
72 form_manager_.reset(new CredentialManagerPasswordFormManager( | 74 form_manager_.reset(new CredentialManagerPasswordFormManager( |
73 client_, GetDriver(), *CreateObservedPasswordFormFromOrigin(origin), | 75 client_, GetDriver(), *CreateObservedPasswordFormFromOrigin(origin), |
74 std::move(form), this)); | 76 std::move(form), this)); |
75 } | 77 } |
76 | 78 |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 DCHECK(pending_require_user_mediation_); | 286 DCHECK(pending_require_user_mediation_); |
285 pending_require_user_mediation_.reset(); | 287 pending_require_user_mediation_.reset(); |
286 } | 288 } |
287 | 289 |
288 bool CredentialManagerDispatcher::IsUpdatingCredentialAllowed() const { | 290 bool CredentialManagerDispatcher::IsUpdatingCredentialAllowed() const { |
289 return !client_->DidLastPageLoadEncounterSSLErrors() && | 291 return !client_->DidLastPageLoadEncounterSSLErrors() && |
290 !client_->IsOffTheRecord(); | 292 !client_->IsOffTheRecord(); |
291 } | 293 } |
292 | 294 |
293 } // namespace password_manager | 295 } // namespace password_manager |
OLD | NEW |