| 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_password_manager_d
river.h" | 5 #include "components/password_manager/content/browser/content_password_manager_d
river.h" |
| 6 | 6 |
| 7 #include "components/autofill/content/browser/content_autofill_driver.h" | 7 #include "components/autofill/content/browser/content_autofill_driver.h" |
| 8 #include "components/autofill/content/common/autofill_messages.h" | 8 #include "components/autofill/content/common/autofill_messages.h" |
| 9 #include "components/autofill/core/common/form_data.h" | 9 #include "components/autofill/core/common/form_data.h" |
| 10 #include "components/autofill/core/common/password_form.h" | 10 #include "components/autofill/core/common/password_form.h" |
| 11 #include "components/password_manager/content/browser/bad_message.h" | 11 #include "components/password_manager/content/browser/bad_message.h" |
| 12 #include "components/password_manager/content/browser/content_password_manager_d
river_factory.h" | 12 #include "components/password_manager/content/browser/content_password_manager_d
river_factory.h" |
| 13 #include "components/password_manager/core/browser/log_manager.h" | 13 #include "components/password_manager/core/browser/log_manager.h" |
| 14 #include "components/password_manager/core/browser/password_manager.h" | 14 #include "components/password_manager/core/browser/password_manager.h" |
| 15 #include "components/password_manager/core/browser/password_manager_client.h" | 15 #include "components/password_manager/core/browser/password_manager_client.h" |
| 16 #include "content/public/browser/browser_context.h" | 16 #include "content/public/browser/browser_context.h" |
| 17 #include "content/public/browser/child_process_security_policy.h" | 17 #include "content/public/browser/child_process_security_policy.h" |
| 18 #include "content/public/browser/navigation_details.h" | 18 #include "content/public/browser/navigation_details.h" |
| 19 #include "content/public/browser/navigation_entry.h" | 19 #include "content/public/browser/navigation_entry.h" |
| 20 #include "content/public/browser/render_frame_host.h" | 20 #include "content/public/browser/render_frame_host.h" |
| 21 #include "content/public/browser/render_process_host.h" | 21 #include "content/public/browser/render_process_host.h" |
| 22 #include "content/public/browser/render_view_host.h" | 22 #include "content/public/browser/render_view_host.h" |
| 23 #include "content/public/browser/site_instance.h" | 23 #include "content/public/browser/site_instance.h" |
| 24 #include "content/public/browser/web_contents.h" | 24 #include "content/public/browser/web_contents.h" |
| 25 #include "content/public/common/ssl_status.h" | 25 #include "content/public/common/ssl_status.h" |
| 26 #include "ipc/ipc_message_macros.h" | 26 #include "ipc/ipc_message_macros.h" |
| 27 #include "mojo/common/common_type_converters.h" | |
| 28 #include "net/cert/cert_status_flags.h" | 27 #include "net/cert/cert_status_flags.h" |
| 29 | 28 |
| 30 namespace password_manager { | 29 namespace password_manager { |
| 31 | 30 |
| 32 ContentPasswordManagerDriver::ContentPasswordManagerDriver( | 31 ContentPasswordManagerDriver::ContentPasswordManagerDriver( |
| 33 content::RenderFrameHost* render_frame_host, | 32 content::RenderFrameHost* render_frame_host, |
| 34 PasswordManagerClient* client, | 33 PasswordManagerClient* client, |
| 35 autofill::AutofillClient* autofill_client) | 34 autofill::AutofillClient* autofill_client) |
| 36 : render_frame_host_(render_frame_host), | 35 : render_frame_host_(render_frame_host), |
| 37 client_(client), | 36 client_(client), |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 void ContentPasswordManagerDriver::GeneratedPasswordAccepted( | 86 void ContentPasswordManagerDriver::GeneratedPasswordAccepted( |
| 88 const base::string16& password) { | 87 const base::string16& password) { |
| 89 content::RenderFrameHost* host = render_frame_host_; | 88 content::RenderFrameHost* host = render_frame_host_; |
| 90 host->Send(new AutofillMsg_GeneratedPasswordAccepted(host->GetRoutingID(), | 89 host->Send(new AutofillMsg_GeneratedPasswordAccepted(host->GetRoutingID(), |
| 91 password)); | 90 password)); |
| 92 } | 91 } |
| 93 | 92 |
| 94 void ContentPasswordManagerDriver::FillSuggestion( | 93 void ContentPasswordManagerDriver::FillSuggestion( |
| 95 const base::string16& username, | 94 const base::string16& username, |
| 96 const base::string16& password) { | 95 const base::string16& password) { |
| 97 GetAutofillAgent()->FillPasswordSuggestion(mojo::String::From(username), | 96 GetAutofillAgent()->FillPasswordSuggestion(username, password); |
| 98 mojo::String::From(password)); | |
| 99 } | 97 } |
| 100 | 98 |
| 101 void ContentPasswordManagerDriver::PreviewSuggestion( | 99 void ContentPasswordManagerDriver::PreviewSuggestion( |
| 102 const base::string16& username, | 100 const base::string16& username, |
| 103 const base::string16& password) { | 101 const base::string16& password) { |
| 104 GetAutofillAgent()->PreviewPasswordSuggestion(mojo::String::From(username), | 102 GetAutofillAgent()->PreviewPasswordSuggestion(username, password); |
| 105 mojo::String::From(password)); | |
| 106 } | 103 } |
| 107 | 104 |
| 108 void ContentPasswordManagerDriver::ShowInitialPasswordAccountSuggestions( | 105 void ContentPasswordManagerDriver::ShowInitialPasswordAccountSuggestions( |
| 109 const autofill::PasswordFormFillData& form_data) { | 106 const autofill::PasswordFormFillData& form_data) { |
| 110 const int key = next_free_key_++; | 107 const int key = next_free_key_++; |
| 111 password_autofill_manager_.OnAddPasswordFormMapping(key, form_data); | 108 password_autofill_manager_.OnAddPasswordFormMapping(key, form_data); |
| 112 GetAutofillAgent()->ShowInitialPasswordAccountSuggestions(key, form_data); | 109 GetAutofillAgent()->ShowInitialPasswordAccountSuggestions(key, form_data); |
| 113 } | 110 } |
| 114 | 111 |
| 115 void ContentPasswordManagerDriver::ClearPreviewedForm() { | 112 void ContentPasswordManagerDriver::ClearPreviewedForm() { |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 const autofill::mojom::AutofillAgentPtr& | 292 const autofill::mojom::AutofillAgentPtr& |
| 296 ContentPasswordManagerDriver::GetAutofillAgent() { | 293 ContentPasswordManagerDriver::GetAutofillAgent() { |
| 297 autofill::ContentAutofillDriver* autofill_driver = | 294 autofill::ContentAutofillDriver* autofill_driver = |
| 298 autofill::ContentAutofillDriver::GetForRenderFrameHost( | 295 autofill::ContentAutofillDriver::GetForRenderFrameHost( |
| 299 render_frame_host_); | 296 render_frame_host_); |
| 300 DCHECK(autofill_driver); | 297 DCHECK(autofill_driver); |
| 301 return autofill_driver->GetAutofillAgent(); | 298 return autofill_driver->GetAutofillAgent(); |
| 302 } | 299 } |
| 303 | 300 |
| 304 } // namespace password_manager | 301 } // namespace password_manager |
| OLD | NEW |