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/content_password_manager_d river.h" | |
11 #include "components/password_manager/content/browser/content_password_manager_d river_factory.h" | |
10 #include "components/password_manager/content/browser/credential_manager_passwor d_form_manager.h" | 12 #include "components/password_manager/content/browser/credential_manager_passwor d_form_manager.h" |
11 #include "components/password_manager/content/common/credential_manager_messages .h" | 13 #include "components/password_manager/content/common/credential_manager_messages .h" |
12 #include "components/password_manager/content/common/credential_manager_types.h" | 14 #include "components/password_manager/content/common/credential_manager_types.h" |
13 #include "components/password_manager/core/browser/password_manager_client.h" | 15 #include "components/password_manager/core/browser/password_manager_client.h" |
14 #include "components/password_manager/core/browser/password_store.h" | 16 #include "components/password_manager/core/browser/password_store.h" |
15 #include "content/public/browser/render_view_host.h" | 17 #include "content/public/browser/render_view_host.h" |
16 #include "content/public/browser/web_contents.h" | 18 #include "content/public/browser/web_contents.h" |
17 #include "ipc/ipc_message_macros.h" | 19 #include "ipc/ipc_message_macros.h" |
18 | 20 |
19 namespace password_manager { | 21 namespace password_manager { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
59 int request_id, | 61 int request_id, |
60 const password_manager::CredentialInfo& credential) { | 62 const password_manager::CredentialInfo& credential) { |
61 DCHECK(request_id); | 63 DCHECK(request_id); |
62 scoped_ptr<autofill::PasswordForm> form( | 64 scoped_ptr<autofill::PasswordForm> form( |
63 CreatePasswordFormFromCredentialInfo(credential, | 65 CreatePasswordFormFromCredentialInfo(credential, |
64 web_contents()->GetLastCommittedURL().GetOrigin())); | 66 web_contents()->GetLastCommittedURL().GetOrigin())); |
65 | 67 |
66 // TODO(mkwst): This is a stub; we should be checking the PasswordStore to | 68 // TODO(mkwst): This is a stub; we should be checking the PasswordStore to |
67 // determine whether or not the credential exists, and calling UpdateLogin | 69 // determine whether or not the credential exists, and calling UpdateLogin |
68 // accordingly. | 70 // accordingly. |
69 form_manager_.reset( | 71 // TODO(estade): should pass the proper PasswordManagerDriver. |
vabr (Chromium)
2014/11/17 15:08:49
Do you still need this TODO(estade)? Looks like th
Evan Stade
2014/11/17 20:34:39
correct, removed
| |
70 new CredentialManagerPasswordFormManager(client_, *form, this)); | 72 form_manager_.reset(new CredentialManagerPasswordFormManager( |
73 client_, | |
74 ContentPasswordManagerDriverFactory::FromWebContents(web_contents()) | |
75 ->GetDriverForFrame(web_contents()->GetMainFrame()), | |
76 *form, this)); | |
71 | 77 |
72 web_contents()->GetRenderViewHost()->Send( | 78 web_contents()->GetRenderViewHost()->Send( |
73 new CredentialManagerMsg_AcknowledgeSignedIn( | 79 new CredentialManagerMsg_AcknowledgeSignedIn( |
74 web_contents()->GetRenderViewHost()->GetRoutingID(), request_id)); | 80 web_contents()->GetRenderViewHost()->GetRoutingID(), request_id)); |
75 } | 81 } |
76 | 82 |
77 void ContentCredentialManagerDispatcher::OnProvisionalSaveComplete() { | 83 void ContentCredentialManagerDispatcher::OnProvisionalSaveComplete() { |
78 DCHECK(form_manager_); | 84 DCHECK(form_manager_); |
79 client_->PromptUserToSavePassword(form_manager_.Pass()); | 85 client_->PromptUserToSavePassword(form_manager_.Pass()); |
80 } | 86 } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
135 pending_request_id_, | 141 pending_request_id_, |
136 info)); | 142 info)); |
137 pending_request_id_ = 0; | 143 pending_request_id_ = 0; |
138 } | 144 } |
139 | 145 |
140 PasswordStore* ContentCredentialManagerDispatcher::GetPasswordStore() { | 146 PasswordStore* ContentCredentialManagerDispatcher::GetPasswordStore() { |
141 return client_ ? client_->GetPasswordStore() : nullptr; | 147 return client_ ? client_->GetPasswordStore() : nullptr; |
142 } | 148 } |
143 | 149 |
144 } // namespace password_manager | 150 } // namespace password_manager |
OLD | NEW |