| 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 form_manager_.reset(new CredentialManagerPasswordFormManager( |
| 70 new CredentialManagerPasswordFormManager(client_, *form, this)); | 72 client_, |
| 73 ContentPasswordManagerDriverFactory::FromWebContents(web_contents()) |
| 74 ->GetDriverForFrame(web_contents()->GetMainFrame()), |
| 75 *form, this)); |
| 71 | 76 |
| 72 web_contents()->GetRenderViewHost()->Send( | 77 web_contents()->GetRenderViewHost()->Send( |
| 73 new CredentialManagerMsg_AcknowledgeSignedIn( | 78 new CredentialManagerMsg_AcknowledgeSignedIn( |
| 74 web_contents()->GetRenderViewHost()->GetRoutingID(), request_id)); | 79 web_contents()->GetRenderViewHost()->GetRoutingID(), request_id)); |
| 75 } | 80 } |
| 76 | 81 |
| 77 void ContentCredentialManagerDispatcher::OnProvisionalSaveComplete() { | 82 void ContentCredentialManagerDispatcher::OnProvisionalSaveComplete() { |
| 78 DCHECK(form_manager_); | 83 DCHECK(form_manager_); |
| 79 client_->PromptUserToSavePassword(form_manager_.Pass()); | 84 client_->PromptUserToSavePassword(form_manager_.Pass()); |
| 80 } | 85 } |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 pending_request_id_, | 140 pending_request_id_, |
| 136 info)); | 141 info)); |
| 137 pending_request_id_ = 0; | 142 pending_request_id_ = 0; |
| 138 } | 143 } |
| 139 | 144 |
| 140 PasswordStore* ContentCredentialManagerDispatcher::GetPasswordStore() { | 145 PasswordStore* ContentCredentialManagerDispatcher::GetPasswordStore() { |
| 141 return client_ ? client_->GetPasswordStore() : nullptr; | 146 return client_ ? client_->GetPasswordStore() : nullptr; |
| 142 } | 147 } |
| 143 | 148 |
| 144 } // namespace password_manager | 149 } // namespace password_manager |
| OLD | NEW |