diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-05 19:28:08 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-05 19:28:08 +0000 |
commit | 89ac46c97e6a3b2f2726bd11d52824d27ee26a24 (patch) | |
tree | c976f9689ff7fabd3c3e54e06ed051d1bd4544c7 /chrome/renderer/render_widget.cc | |
parent | 9ac105a1023bc696e619e5714c524e1a3ffdc2ef (diff) | |
download | chromium_src-89ac46c97e6a3b2f2726bd11d52824d27ee26a24.zip chromium_src-89ac46c97e6a3b2f2726bd11d52824d27ee26a24.tar.gz chromium_src-89ac46c97e6a3b2f2726bd11d52824d27ee26a24.tar.bz2 |
This CL adds the autofill UI in forms.
When the user types text in a text field in a form, the renderer queries the browser for suggestion based on the entered text and displays the suggestions in a popup.
Listeners are set on the form text field in a similar fashion than for password save.
The popup showing the suggestion uses the same mechanism as the select popup. Note that a difference between the select and the autofill popup is that the autofill should not take focus, so the page still has focus and the user can still type in while it shows.
The creation of the render widget was modified for that purpose so we can specify the popup should not be focused when shown.
Review URL: http://codereview.chromium.org/8885
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4804 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/render_widget.cc')
-rw-r--r-- | chrome/renderer/render_widget.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc index 874768b..c8d3070 100644 --- a/chrome/renderer/render_widget.cc +++ b/chrome/renderer/render_widget.cc @@ -69,7 +69,8 @@ DeferredCloses* DeferredCloses::current_ = NULL; /////////////////////////////////////////////////////////////////////////////// -RenderWidget::RenderWidget(RenderThreadBase* render_thread) +RenderWidget::RenderWidget(RenderThreadBase* render_thread, + bool focus_on_show) : routing_id_(MSG_ROUTING_NONE), opener_id_(MSG_ROUTING_NONE), render_thread_(render_thread), @@ -88,7 +89,8 @@ RenderWidget::RenderWidget(RenderThreadBase* render_thread) ime_control_x_(-1), ime_control_y_(-1), ime_control_new_state_(false), - ime_control_updated_(false) { + ime_control_updated_(false), + focus_on_show_(focus_on_show) { RenderProcess::AddRefProcess(); DCHECK(render_thread_); } @@ -107,9 +109,11 @@ RenderWidget::~RenderWidget() { /*static*/ RenderWidget* RenderWidget::Create(int32 opener_id, - RenderThreadBase* render_thread) { + RenderThreadBase* render_thread, + bool focus_on_show) { DCHECK(opener_id != MSG_ROUTING_NONE); - scoped_refptr<RenderWidget> widget = new RenderWidget(render_thread); + scoped_refptr<RenderWidget> widget = new RenderWidget(render_thread, + focus_on_show); widget->Init(opener_id); // adds reference return widget; } @@ -125,7 +129,7 @@ void RenderWidget::Init(int32 opener_id) { webwidget_.swap(&webwidget); bool result = render_thread_->Send( - new ViewHostMsg_CreateWidget(opener_id, &routing_id_)); + new ViewHostMsg_CreateWidget(opener_id, focus_on_show_, &routing_id_)); if (result) { render_thread_->AddRoute(routing_id_, this); // Take a reference on behalf of the RenderThread. This will be balanced |