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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 host->Send(new AutofillMsg_ClearForm(host->GetRoutingID())); | 149 host->Send(new AutofillMsg_ClearForm(host->GetRoutingID())); |
150 } | 150 } |
151 | 151 |
152 void ContentAutofillDriver::RendererShouldClearPreviewedForm() { | 152 void ContentAutofillDriver::RendererShouldClearPreviewedForm() { |
153 if (!RendererIsAvailable()) | 153 if (!RendererIsAvailable()) |
154 return; | 154 return; |
155 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); | 155 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); |
156 host->Send(new AutofillMsg_ClearPreviewedForm(host->GetRoutingID())); | 156 host->Send(new AutofillMsg_ClearPreviewedForm(host->GetRoutingID())); |
157 } | 157 } |
158 | 158 |
159 void ContentAutofillDriver::RendererShouldSetNodeText( | 159 void ContentAutofillDriver::RendererShouldFillFieldWithValue( |
160 const base::string16& value) { | 160 const base::string16& value) { |
161 if (!RendererIsAvailable()) | 161 if (!RendererIsAvailable()) |
162 return; | 162 return; |
163 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); | 163 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); |
164 host->Send(new AutofillMsg_SetNodeText(host->GetRoutingID(), value)); | 164 host->Send(new AutofillMsg_FillFieldWithValue(host->GetRoutingID(), value)); |
| 165 } |
| 166 void ContentAutofillDriver::RendererShouldPreviewFieldWithValue( |
| 167 const base::string16& value) { |
| 168 if (!RendererIsAvailable()) |
| 169 return; |
| 170 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); |
| 171 host->Send(new AutofillMsg_PreviewFieldWithValue(host->GetRoutingID(), |
| 172 value)); |
165 } | 173 } |
166 | 174 |
167 bool ContentAutofillDriver::OnMessageReceived(const IPC::Message& message) { | 175 bool ContentAutofillDriver::OnMessageReceived(const IPC::Message& message) { |
168 bool handled = true; | 176 bool handled = true; |
169 IPC_BEGIN_MESSAGE_MAP(ContentAutofillDriver, message) | 177 IPC_BEGIN_MESSAGE_MAP(ContentAutofillDriver, message) |
170 IPC_MESSAGE_FORWARD(AutofillHostMsg_FormsSeen, | 178 IPC_MESSAGE_FORWARD(AutofillHostMsg_FormsSeen, |
171 autofill_manager_.get(), | 179 autofill_manager_.get(), |
172 AutofillManager::OnFormsSeen) | 180 AutofillManager::OnFormsSeen) |
173 IPC_MESSAGE_FORWARD(AutofillHostMsg_FormSubmitted, | 181 IPC_MESSAGE_FORWARD(AutofillHostMsg_FormSubmitted, |
174 autofill_manager_.get(), | 182 autofill_manager_.get(), |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 void ContentAutofillDriver::NavigationEntryCommitted( | 232 void ContentAutofillDriver::NavigationEntryCommitted( |
225 const content::LoadCommittedDetails& load_details) { | 233 const content::LoadCommittedDetails& load_details) { |
226 autofill_manager_->delegate()->HideAutofillPopup(); | 234 autofill_manager_->delegate()->HideAutofillPopup(); |
227 } | 235 } |
228 | 236 |
229 void ContentAutofillDriver::WasHidden() { | 237 void ContentAutofillDriver::WasHidden() { |
230 autofill_manager_->delegate()->HideAutofillPopup(); | 238 autofill_manager_->delegate()->HideAutofillPopup(); |
231 } | 239 } |
232 | 240 |
233 } // namespace autofill | 241 } // namespace autofill |
OLD | NEW |