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

Unified Diff: chrome/renderer/render_view.cc

Issue 8885: Implementation of the UI part of the autofill (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/render_view.h ('k') | chrome/renderer/render_widget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_view.cc
===================================================================
--- chrome/renderer/render_view.cc (revision 4621)
+++ chrome/renderer/render_view.cc (working copy)
@@ -142,7 +142,7 @@
///////////////////////////////////////////////////////////////////////////////
RenderView::RenderView()
- : RenderWidget(RenderThread::current()),
+ : RenderWidget(RenderThread::current(), true),
is_loading_(false),
page_id_(-1),
last_page_id_sent_to_browser_(-1),
@@ -161,7 +161,8 @@
has_unload_listener_(false),
decrement_shared_popup_at_destruction_(false),
greasemonkey_enabled_(false),
- waiting_for_create_window_ack_(false) {
+ waiting_for_create_window_ack_(false),
+ form_field_autofill_request_id_(0) {
resource_dispatcher_ = new ResourceDispatcher(this);
#ifdef CHROME_PERSONALIZATION
personalization_ = Personalization::CreateRendererPersonalization();
@@ -384,6 +385,8 @@
OnMessageFromExternalHost)
IPC_MESSAGE_HANDLER(ViewMsg_DisassociateFromPopupCount,
OnDisassociateFromPopupCount)
+ IPC_MESSAGE_HANDLER(ViewMsg_AutofillSuggestions,
+ OnReceivedAutofillSuggestions)
// Have the super handle all other messages.
IPC_MESSAGE_UNHANDLED(RenderWidget::OnMessageReceived(message))
IPC_END_MESSAGE_MAP()
@@ -1664,6 +1667,29 @@
}
}
+void RenderView::QueryFormFieldAutofill(const std::wstring& field_name,
+ const std::wstring& text,
+ int64 node_id) {
+ static int message_id_counter = 0;
+ form_field_autofill_request_id_ = message_id_counter++;
+ Send(new ViewHostMsg_QueryFormFieldAutofill(routing_id_,
+ field_name, text,
+ node_id,
+ form_field_autofill_request_id_));
+}
+
+void RenderView::OnReceivedAutofillSuggestions(
+ int64 node_id,
+ int request_id,
+ const std::vector<std::wstring> suggestions,
+ int default_suggestion_index) {
+ if (!webview() || request_id != form_field_autofill_request_id_)
+ return;
+
+ webview()->AutofillSuggestionsForNode(node_id, suggestions,
+ default_suggestion_index);
+}
+
void RenderView::ShowModalHTMLDialog(const GURL& url, int width, int height,
const std::string& json_arguments,
std::string* json_retval) {
@@ -1762,9 +1788,11 @@
return view->webview();
}
-WebWidget* RenderView::CreatePopupWidget(WebView* webview) {
+WebWidget* RenderView::CreatePopupWidget(WebView* webview,
+ bool focus_on_show) {
RenderWidget* widget = RenderWidget::Create(routing_id_,
- RenderThread::current());
+ RenderThread::current(),
+ focus_on_show);
return widget->webwidget();
}
« no previous file with comments | « chrome/renderer/render_view.h ('k') | chrome/renderer/render_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698