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/content_credential_manager _dispatcher.h" | 5 #include "components/password_manager/content/browser/content_credential_manager _dispatcher.h" |
6 | 6 |
7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "components/autofill/core/common/password_form.h" | 9 #include "components/autofill/core/common/password_form.h" |
10 #include "components/password_manager/content/browser/credential_manager_passwor d_form_manager.h" | 10 #include "components/password_manager/content/browser/credential_manager_passwor d_form_manager.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
59 int request_id, | 59 int request_id, |
60 const password_manager::CredentialInfo& credential) { | 60 const password_manager::CredentialInfo& credential) { |
61 DCHECK(request_id); | 61 DCHECK(request_id); |
62 scoped_ptr<autofill::PasswordForm> form( | 62 scoped_ptr<autofill::PasswordForm> form( |
63 CreatePasswordFormFromCredentialInfo(credential, | 63 CreatePasswordFormFromCredentialInfo(credential, |
64 web_contents()->GetLastCommittedURL().GetOrigin())); | 64 web_contents()->GetLastCommittedURL().GetOrigin())); |
65 | 65 |
66 // TODO(mkwst): This is a stub; we should be checking the PasswordStore to | 66 // TODO(mkwst): This is a stub; we should be checking the PasswordStore to |
67 // determine whether or not the credential exists, and calling UpdateLogin | 67 // determine whether or not the credential exists, and calling UpdateLogin |
68 // accordingly. | 68 // accordingly. |
69 form_manager_.reset( | 69 // TODO(estade): should pass the proper PasswordManagerDriver. |
vabr (Chromium)
2014/11/10 14:34:40
I checked with mkwst@ (author of the credential ma
Evan Stade
2014/11/14 23:25:50
thanks for figuring that out. Updated the code.
| |
70 new CredentialManagerPasswordFormManager(client_, *form, this)); | 70 form_manager_.reset(new CredentialManagerPasswordFormManager( |
71 client_, client_->GetDriver(), *form, this)); | |
71 | 72 |
72 web_contents()->GetRenderViewHost()->Send( | 73 web_contents()->GetRenderViewHost()->Send( |
73 new CredentialManagerMsg_AcknowledgeSignedIn( | 74 new CredentialManagerMsg_AcknowledgeSignedIn( |
74 web_contents()->GetRenderViewHost()->GetRoutingID(), request_id)); | 75 web_contents()->GetRenderViewHost()->GetRoutingID(), request_id)); |
75 } | 76 } |
76 | 77 |
77 void ContentCredentialManagerDispatcher::OnProvisionalSaveComplete() { | 78 void ContentCredentialManagerDispatcher::OnProvisionalSaveComplete() { |
78 DCHECK(form_manager_); | 79 DCHECK(form_manager_); |
79 client_->PromptUserToSavePassword(form_manager_.Pass()); | 80 client_->PromptUserToSavePassword(form_manager_.Pass()); |
80 } | 81 } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
135 pending_request_id_, | 136 pending_request_id_, |
136 info)); | 137 info)); |
137 pending_request_id_ = 0; | 138 pending_request_id_ = 0; |
138 } | 139 } |
139 | 140 |
140 PasswordStore* ContentCredentialManagerDispatcher::GetPasswordStore() { | 141 PasswordStore* ContentCredentialManagerDispatcher::GetPasswordStore() { |
141 return client_ ? client_->GetPasswordStore() : nullptr; | 142 return client_ ? client_->GetPasswordStore() : nullptr; |
142 } | 143 } |
143 | 144 |
144 } // namespace password_manager | 145 } // namespace password_manager |
OLD | NEW |