| 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/common/autofill_messages.h" | 7 #include "components/autofill/content/common/autofill_messages.h" |
| 8 #include "components/autofill/core/common/form_data.h" | 8 #include "components/autofill/core/common/form_data.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/bad_message.h" | 10 #include "components/password_manager/content/browser/bad_message.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 } | 98 } |
| 99 | 99 |
| 100 void ContentPasswordManagerDriver::PreviewSuggestion( | 100 void ContentPasswordManagerDriver::PreviewSuggestion( |
| 101 const base::string16& username, | 101 const base::string16& username, |
| 102 const base::string16& password) { | 102 const base::string16& password) { |
| 103 content::RenderFrameHost* host = render_frame_host_; | 103 content::RenderFrameHost* host = render_frame_host_; |
| 104 host->Send(new AutofillMsg_PreviewPasswordSuggestion(host->GetRoutingID(), | 104 host->Send(new AutofillMsg_PreviewPasswordSuggestion(host->GetRoutingID(), |
| 105 username, password)); | 105 username, password)); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void ContentPasswordManagerDriver::ShowInitialPasswordAccountSuggestions( |
| 109 const autofill::PasswordFormFillData& form_data) { |
| 110 const int key = next_free_key_++; |
| 111 password_autofill_manager_.OnAddPasswordFormMapping(key, form_data); |
| 112 render_frame_host_->Send( |
| 113 new AutofillMsg_ShowInitialPasswordAccountSuggestions( |
| 114 render_frame_host_->GetRoutingID(), key, form_data)); |
| 115 } |
| 116 |
| 108 void ContentPasswordManagerDriver::ClearPreviewedForm() { | 117 void ContentPasswordManagerDriver::ClearPreviewedForm() { |
| 109 content::RenderFrameHost* host = render_frame_host_; | 118 content::RenderFrameHost* host = render_frame_host_; |
| 110 host->Send(new AutofillMsg_ClearPreviewedForm(host->GetRoutingID())); | 119 host->Send(new AutofillMsg_ClearPreviewedForm(host->GetRoutingID())); |
| 111 } | 120 } |
| 112 | 121 |
| 113 void ContentPasswordManagerDriver::ForceSavePassword() { | 122 void ContentPasswordManagerDriver::ForceSavePassword() { |
| 114 content::RenderFrameHost* host = render_frame_host_; | 123 content::RenderFrameHost* host = render_frame_host_; |
| 115 host->Send(new AutofillMsg_FindFocusedPasswordForm(host->GetRoutingID())); | 124 host->Send(new AutofillMsg_FindFocusedPasswordForm(host->GetRoutingID())); |
| 116 } | 125 } |
| 117 | 126 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 if (!policy->CanAccessDataForOrigin(render_frame_host_->GetProcess()->GetID(), | 269 if (!policy->CanAccessDataForOrigin(render_frame_host_->GetProcess()->GetID(), |
| 261 url)) { | 270 url)) { |
| 262 bad_message::ReceivedBadMessage(render_frame_host_->GetProcess(), reason); | 271 bad_message::ReceivedBadMessage(render_frame_host_->GetProcess(), reason); |
| 263 return false; | 272 return false; |
| 264 } | 273 } |
| 265 | 274 |
| 266 return true; | 275 return true; |
| 267 } | 276 } |
| 268 | 277 |
| 269 } // namespace password_manager | 278 } // namespace password_manager |
| OLD | NEW |