summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-09 22:56:34 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-09 22:56:34 +0000
commitcf28ec5f4f485d4758de3817cd116e47fdc3edeb (patch)
treee69ea0cac56aaabe71901a1f2bce2e33061dc88a /chrome/renderer
parent5b6699d3ed74c9382c5f9a2aa8c8f2500900c7f8 (diff)
downloadchromium_src-cf28ec5f4f485d4758de3817cd116e47fdc3edeb.zip
chromium_src-cf28ec5f4f485d4758de3817cd116e47fdc3edeb.tar.gz
chromium_src-cf28ec5f4f485d4758de3817cd116e47fdc3edeb.tar.bz2
AutoFill: Fill the default profile when the AutoFill accelerator combo is pressed (ctrl-shift-a).
BUG=39491 TEST=none Review URL: http://codereview.chromium.org/1521020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44149 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r--chrome/renderer/form_manager.cc7
-rw-r--r--chrome/renderer/form_manager.h3
-rw-r--r--chrome/renderer/render_view.cc6
-rw-r--r--chrome/renderer/render_view.h3
4 files changed, 19 insertions, 0 deletions
diff --git a/chrome/renderer/form_manager.cc b/chrome/renderer/form_manager.cc
index d2c80b8..0d202ab 100644
--- a/chrome/renderer/form_manager.cc
+++ b/chrome/renderer/form_manager.cc
@@ -404,6 +404,13 @@ bool FormManager::FillForm(const FormData& form) {
return true;
}
+void FormManager::FillForms(const std::vector<webkit_glue::FormData>& forms) {
+ for (std::vector<webkit_glue::FormData>::const_iterator iter = forms.begin();
+ iter != forms.end(); ++iter) {
+ FillForm(*iter);
+ }
+}
+
void FormManager::Reset() {
for (WebFrameFormElementMap::iterator iter = form_elements_map_.begin();
iter != form_elements_map_.end(); ++iter) {
diff --git a/chrome/renderer/form_manager.h b/chrome/renderer/form_manager.h
index e1176bc..c35da84 100644
--- a/chrome/renderer/form_manager.h
+++ b/chrome/renderer/form_manager.h
@@ -85,6 +85,9 @@ class FormManager {
// store multiple forms with the same names from different frames.
bool FillForm(const webkit_glue::FormData& form);
+ // Fills all of the forms in the cache with form data from |forms|.
+ void FillForms(const std::vector<webkit_glue::FormData>& forms);
+
// Resets the stored set of forms.
void Reset();
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 9dc6442..7b81bd9 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -602,6 +602,7 @@ void RenderView::OnMessageReceived(const IPC::Message& message) {
OnDisassociateFromPopupCount)
IPC_MESSAGE_HANDLER(ViewMsg_AutoFillSuggestionsReturned,
OnAutoFillSuggestionsReturned)
+ IPC_MESSAGE_HANDLER(ViewMsg_AutoFillForms, OnAutoFillForms)
IPC_MESSAGE_HANDLER(ViewMsg_AutocompleteSuggestionsReturned,
OnAutocompleteSuggestionsReturned)
IPC_MESSAGE_HANDLER(ViewMsg_AutoFillFormDataFilled,
@@ -1452,6 +1453,11 @@ void RenderView::OnAutoFillSuggestionsReturned(
autofill_query_node_.reset();
}
+void RenderView::OnAutoFillForms(
+ const std::vector<webkit_glue::FormData>& forms) {
+ form_manager_.FillForms(forms);
+}
+
void RenderView::OnAutocompleteSuggestionsReturned(
int query_id,
const std::vector<string16>& suggestions,
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h
index 6f67b4d..c3a0190 100644
--- a/chrome/renderer/render_view.h
+++ b/chrome/renderer/render_view.h
@@ -750,6 +750,9 @@ class RenderView : public RenderWidget,
const std::vector<string16>& labels,
int default_suggestions_index);
+ // Fills all the forms in this RenderView with the form data in |forms|.
+ void OnAutoFillForms(const std::vector<webkit_glue::FormData>& forms);
+
// Notification that we have received Autocomplete suggestions.
void OnAutocompleteSuggestionsReturned(
int query_id,