Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Side by Side Diff: components/autofill/content/browser/autofill_driver_impl.cc

Issue 148413002: Add "previewing on hover" support for single-field autocomplete input (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update test code Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/autofill_driver_impl.h" 5 #include "components/autofill/content/browser/autofill_driver_impl.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
149 host->Send(new AutofillMsg_ClearForm(host->GetRoutingID())); 149 host->Send(new AutofillMsg_ClearForm(host->GetRoutingID()));
150 } 150 }
151 151
152 void AutofillDriverImpl::RendererShouldClearPreviewedForm() { 152 void AutofillDriverImpl::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 AutofillDriverImpl::RendererShouldSetNodeText( 159 void AutofillDriverImpl::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
167 void AutofillDriverImpl::RendererShouldPreviewFieldWithValue(
168 const base::string16& value) {
169 if (!RendererIsAvailable())
170 return;
171 content::RenderViewHost* host = web_contents()->GetRenderViewHost();
172 host->Send(new AutofillMsg_PreviewFieldWithValue(host->GetRoutingID(),
173 value));
165 } 174 }
166 175
167 bool AutofillDriverImpl::OnMessageReceived(const IPC::Message& message) { 176 bool AutofillDriverImpl::OnMessageReceived(const IPC::Message& message) {
168 bool handled = true; 177 bool handled = true;
169 IPC_BEGIN_MESSAGE_MAP(AutofillDriverImpl, message) 178 IPC_BEGIN_MESSAGE_MAP(AutofillDriverImpl, message)
170 IPC_MESSAGE_FORWARD(AutofillHostMsg_FormsSeen, autofill_manager_.get(), 179 IPC_MESSAGE_FORWARD(AutofillHostMsg_FormsSeen, autofill_manager_.get(),
171 AutofillManager::OnFormsSeen) 180 AutofillManager::OnFormsSeen)
172 IPC_MESSAGE_FORWARD(AutofillHostMsg_FormSubmitted, autofill_manager_.get(), 181 IPC_MESSAGE_FORWARD(AutofillHostMsg_FormSubmitted, autofill_manager_.get(),
173 AutofillManager::OnFormSubmitted) 182 AutofillManager::OnFormSubmitted)
174 IPC_MESSAGE_FORWARD(AutofillHostMsg_TextFieldDidChange, 183 IPC_MESSAGE_FORWARD(AutofillHostMsg_TextFieldDidChange,
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 void AutofillDriverImpl::NavigationEntryCommitted( 229 void AutofillDriverImpl::NavigationEntryCommitted(
221 const content::LoadCommittedDetails& load_details) { 230 const content::LoadCommittedDetails& load_details) {
222 autofill_manager_->delegate()->HideAutofillPopup(); 231 autofill_manager_->delegate()->HideAutofillPopup();
223 } 232 }
224 233
225 void AutofillDriverImpl::WasHidden() { 234 void AutofillDriverImpl::WasHidden() {
226 autofill_manager_->delegate()->HideAutofillPopup(); 235 autofill_manager_->delegate()->HideAutofillPopup();
227 } 236 }
228 237
229 } // namespace autofill 238 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698