| 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/autofill/content/browser/content_autofill_driver.h" | 5 #include "components/autofill/content/browser/content_autofill_driver.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/threading/sequenced_worker_pool.h" | 8 #include "base/threading/sequenced_worker_pool.h" |
| 9 #include "components/autofill/content/common/autofill_messages.h" | 9 #include "components/autofill/content/common/autofill_messages.h" |
| 10 #include "components/autofill/core/browser/autofill_external_delegate.h" | 10 #include "components/autofill/core/browser/autofill_external_delegate.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 126 |
| 127 void ContentAutofillDriver::RendererShouldAcceptDataListSuggestion( | 127 void ContentAutofillDriver::RendererShouldAcceptDataListSuggestion( |
| 128 const base::string16& value) { | 128 const base::string16& value) { |
| 129 if (!RendererIsAvailable()) | 129 if (!RendererIsAvailable()) |
| 130 return; | 130 return; |
| 131 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); | 131 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); |
| 132 host->Send( | 132 host->Send( |
| 133 new AutofillMsg_AcceptDataListSuggestion(host->GetRoutingID(), value)); | 133 new AutofillMsg_AcceptDataListSuggestion(host->GetRoutingID(), value)); |
| 134 } | 134 } |
| 135 | 135 |
| 136 void ContentAutofillDriver::RendererShouldAcceptPasswordAutofillSuggestion( | |
| 137 const base::string16& username) { | |
| 138 if (!RendererIsAvailable()) | |
| 139 return; | |
| 140 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); | |
| 141 host->Send(new AutofillMsg_AcceptPasswordAutofillSuggestion( | |
| 142 host->GetRoutingID(), username)); | |
| 143 } | |
| 144 | |
| 145 void ContentAutofillDriver::RendererShouldClearFilledForm() { | 136 void ContentAutofillDriver::RendererShouldClearFilledForm() { |
| 146 if (!RendererIsAvailable()) | 137 if (!RendererIsAvailable()) |
| 147 return; | 138 return; |
| 148 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); | 139 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); |
| 149 host->Send(new AutofillMsg_ClearForm(host->GetRoutingID())); | 140 host->Send(new AutofillMsg_ClearForm(host->GetRoutingID())); |
| 150 } | 141 } |
| 151 | 142 |
| 152 void ContentAutofillDriver::RendererShouldClearPreviewedForm() { | 143 void ContentAutofillDriver::RendererShouldClearPreviewedForm() { |
| 153 if (!RendererIsAvailable()) | 144 if (!RendererIsAvailable()) |
| 154 return; | 145 return; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 AutofillManager::OnDidPreviewAutofillFormData) | 183 AutofillManager::OnDidPreviewAutofillFormData) |
| 193 IPC_MESSAGE_FORWARD(AutofillHostMsg_DidFillAutofillFormData, | 184 IPC_MESSAGE_FORWARD(AutofillHostMsg_DidFillAutofillFormData, |
| 194 autofill_manager_.get(), | 185 autofill_manager_.get(), |
| 195 AutofillManager::OnDidFillAutofillFormData) | 186 AutofillManager::OnDidFillAutofillFormData) |
| 196 IPC_MESSAGE_FORWARD(AutofillHostMsg_DidEndTextFieldEditing, | 187 IPC_MESSAGE_FORWARD(AutofillHostMsg_DidEndTextFieldEditing, |
| 197 autofill_manager_.get(), | 188 autofill_manager_.get(), |
| 198 AutofillManager::OnDidEndTextFieldEditing) | 189 AutofillManager::OnDidEndTextFieldEditing) |
| 199 IPC_MESSAGE_FORWARD(AutofillHostMsg_HidePopup, | 190 IPC_MESSAGE_FORWARD(AutofillHostMsg_HidePopup, |
| 200 autofill_manager_.get(), | 191 autofill_manager_.get(), |
| 201 AutofillManager::OnHidePopup) | 192 AutofillManager::OnHidePopup) |
| 202 IPC_MESSAGE_FORWARD(AutofillHostMsg_AddPasswordFormMapping, | |
| 203 autofill_manager_.get(), | |
| 204 AutofillManager::OnAddPasswordFormMapping) | |
| 205 IPC_MESSAGE_FORWARD(AutofillHostMsg_ShowPasswordSuggestions, | |
| 206 autofill_manager_.get(), | |
| 207 AutofillManager::OnShowPasswordSuggestions) | |
| 208 IPC_MESSAGE_FORWARD(AutofillHostMsg_SetDataList, | 193 IPC_MESSAGE_FORWARD(AutofillHostMsg_SetDataList, |
| 209 autofill_manager_.get(), | 194 autofill_manager_.get(), |
| 210 AutofillManager::OnSetDataList) | 195 AutofillManager::OnSetDataList) |
| 211 IPC_MESSAGE_FORWARD(AutofillHostMsg_RequestAutocomplete, | 196 IPC_MESSAGE_FORWARD(AutofillHostMsg_RequestAutocomplete, |
| 212 &request_autocomplete_manager_, | 197 &request_autocomplete_manager_, |
| 213 RequestAutocompleteManager::OnRequestAutocomplete) | 198 RequestAutocompleteManager::OnRequestAutocomplete) |
| 214 IPC_MESSAGE_FORWARD(AutofillHostMsg_CancelRequestAutocomplete, | 199 IPC_MESSAGE_FORWARD(AutofillHostMsg_CancelRequestAutocomplete, |
| 215 &request_autocomplete_manager_, | 200 &request_autocomplete_manager_, |
| 216 RequestAutocompleteManager::OnCancelRequestAutocomplete) | 201 RequestAutocompleteManager::OnCancelRequestAutocomplete) |
| 217 IPC_MESSAGE_UNHANDLED(handled = false) | 202 IPC_MESSAGE_UNHANDLED(handled = false) |
| (...skipping 17 matching lines...) Expand all Loading... |
| 235 void ContentAutofillDriver::NavigationEntryCommitted( | 220 void ContentAutofillDriver::NavigationEntryCommitted( |
| 236 const content::LoadCommittedDetails& load_details) { | 221 const content::LoadCommittedDetails& load_details) { |
| 237 autofill_manager_->delegate()->HideAutofillPopup(); | 222 autofill_manager_->delegate()->HideAutofillPopup(); |
| 238 } | 223 } |
| 239 | 224 |
| 240 void ContentAutofillDriver::WasHidden() { | 225 void ContentAutofillDriver::WasHidden() { |
| 241 autofill_manager_->delegate()->HideAutofillPopup(); | 226 autofill_manager_->delegate()->HideAutofillPopup(); |
| 242 } | 227 } |
| 243 | 228 |
| 244 } // namespace autofill | 229 } // namespace autofill |
| OLD | NEW |