summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authorisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-20 20:21:42 +0000
committerisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-20 20:21:42 +0000
commit679782384a0cb99c6a496bf0acbb7fee246ec5be (patch)
treee21c8328c78ebba1851f5b104073d94e7429f4e9 /chrome/renderer
parent58a1a3b622f6cdc7e62aa5106164d6fe45f9891d (diff)
downloadchromium_src-679782384a0cb99c6a496bf0acbb7fee246ec5be.zip
chromium_src-679782384a0cb99c6a496bf0acbb7fee246ec5be.tar.gz
chromium_src-679782384a0cb99c6a496bf0acbb7fee246ec5be.tar.bz2
Revert 89716 - Add a debugging flag to annotate web forms with their Autofill field type predictions.
BUG=none TEST=none Review URL: http://codereview.chromium.org/7187029 TBR=isherman@chromium.org Review URL: http://codereview.chromium.org/7204037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89720 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r--chrome/renderer/autofill/autofill_agent.cc11
-rw-r--r--chrome/renderer/autofill/autofill_agent.h8
-rw-r--r--chrome/renderer/autofill/form_manager.cc51
-rw-r--r--chrome/renderer/autofill/form_manager.h7
4 files changed, 2 insertions, 75 deletions
diff --git a/chrome/renderer/autofill/autofill_agent.cc b/chrome/renderer/autofill/autofill_agent.cc
index ab4c061..5418dca 100644
--- a/chrome/renderer/autofill/autofill_agent.cc
+++ b/chrome/renderer/autofill/autofill_agent.cc
@@ -20,7 +20,6 @@
#include "ui/base/keycodes/keyboard_codes.h"
#include "ui/base/l10n/l10n_util.h"
#include "webkit/glue/form_data.h"
-#include "webkit/glue/form_data_predictions.h"
#include "webkit/glue/form_field.h"
#include "webkit/glue/password_form.h"
@@ -32,7 +31,6 @@ using WebKit::WebKeyboardEvent;
using WebKit::WebNode;
using WebKit::WebString;
using webkit_glue::FormData;
-using webkit_glue::FormDataPredictions;
namespace {
@@ -66,8 +64,6 @@ bool AutofillAgent::OnMessageReceived(const IPC::Message& message) {
IPC_BEGIN_MESSAGE_MAP(AutofillAgent, message)
IPC_MESSAGE_HANDLER(AutofillMsg_SuggestionsReturned, OnSuggestionsReturned)
IPC_MESSAGE_HANDLER(AutofillMsg_FormDataFilled, OnFormDataFilled)
- IPC_MESSAGE_HANDLER(AutofillMsg_FieldTypePredictionsAvailable,
- OnFieldTypePredictionsAvailable)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -309,13 +305,6 @@ void AutofillAgent::OnFormDataFilled(int query_id,
Send(new AutofillHostMsg_DidFillAutofillFormData(routing_id()));
}
-void AutofillAgent::OnFieldTypePredictionsAvailable(
- const std::vector<FormDataPredictions>& forms) {
- for (size_t i = 0; i < forms.size(); ++i) {
- form_manager_.ShowPredictions(forms[i]);
- }
-}
-
void AutofillAgent::ShowSuggestions(const WebInputElement& element,
bool autofill_on_empty_values,
bool requires_caret_at_end,
diff --git a/chrome/renderer/autofill/autofill_agent.h b/chrome/renderer/autofill/autofill_agent.h
index 921744d..6996d31 100644
--- a/chrome/renderer/autofill/autofill_agent.h
+++ b/chrome/renderer/autofill/autofill_agent.h
@@ -16,12 +16,6 @@
#include "content/renderer/render_view_observer.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebAutoFillClient.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebNode.h"
-#include "webkit/glue/form_data.h"
-#include "webkit/glue/form_field.h"
-
-namespace webkit_glue {
-struct FormDataPredictions;
-}
namespace autofill {
@@ -93,8 +87,6 @@ class AutofillAgent : public RenderViewObserver,
const std::vector<string16>& icons,
const std::vector<int>& unique_ids);
void OnFormDataFilled(int query_id, const webkit_glue::FormData& form);
- void OnFieldTypePredictionsAvailable(
- const std::vector<webkit_glue::FormDataPredictions>& forms);
// Called in a posted task by textFieldDidChange() to work-around a WebKit bug
// http://bugs.webkit.org/show_bug.cgi?id=16976
diff --git a/chrome/renderer/autofill/form_manager.cc b/chrome/renderer/autofill/form_manager.cc
index 0adfbae..c94bfa0 100644
--- a/chrome/renderer/autofill/form_manager.cc
+++ b/chrome/renderer/autofill/form_manager.cc
@@ -9,7 +9,6 @@
#include "base/stl_util-inl.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
-#include "grit/generated_resources.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFormControlElement.h"
@@ -22,13 +21,12 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSelectElement.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h"
-#include "ui/base/l10n/l10n_util.h"
#include "webkit/glue/form_data.h"
-#include "webkit/glue/form_data_predictions.h"
#include "webkit/glue/form_field.h"
-#include "webkit/glue/form_field_predictions.h"
#include "webkit/glue/web_io_operators.h"
+using webkit_glue::FormData;
+using webkit_glue::FormField;
using WebKit::WebDocument;
using WebKit::WebElement;
using WebKit::WebFormControlElement;
@@ -42,10 +40,6 @@ using WebKit::WebOptionElement;
using WebKit::WebSelectElement;
using WebKit::WebString;
using WebKit::WebVector;
-using webkit_glue::FormData;
-using webkit_glue::FormDataPredictions;
-using webkit_glue::FormField;
-using webkit_glue::FormFieldPredictions;
namespace {
@@ -802,47 +796,6 @@ void FormManager::PreviewForm(const FormData& form, const WebNode& node) {
&PreviewFormField);
}
-bool FormManager::ShowPredictions(const FormDataPredictions& form) {
- FormElement* form_element = NULL;
- if (!FindCachedFormElement(form.data, &form_element))
- return false;
-
- DCHECK_EQ(form.data.fields.size(), form.fields.size());
- for (size_t i = 0, j = 0;
- i < form_element->control_elements.size() && j < form.fields.size();
- ++i) {
- WebFormControlElement* element = &form_element->control_elements[i];
- string16 element_name(element->nameForAutofill());
-
- // Search forward in the |form| for a corresponding field.
- size_t k = j;
- while (k < form.fields.size() && element_name != form.data.fields[k].name)
- k++;
-
- if (k >= form.fields.size())
- continue;
-
- DCHECK_EQ(form.data.fields[k].name, element_name);
-
- std::string placeholder = form.fields[k].overall_type;
- string16 title = l10n_util::GetStringFUTF16(
- IDS_AUTOFILL_SHOW_PREDICTIONS_TITLE,
- UTF8ToUTF16(form.fields[k].heuristic_type),
- UTF8ToUTF16(form.fields[k].server_type),
- UTF8ToUTF16(form.fields[k].signature),
- UTF8ToUTF16(form.signature),
- UTF8ToUTF16(form.experiment_id));
- if (!element->hasAttribute("placeholder"))
- element->setAttribute("placeholder", WebString(UTF8ToUTF16(placeholder)));
- element->setAttribute("title", WebString(title));
-
- // We found a matching form field so move on to the next.
- ++j;
- }
-
- return true;
-}
-
bool FormManager::ClearFormWithNode(const WebNode& node) {
FormElement* form_element = NULL;
if (!FindCachedFormElementWithNode(node, &form_element))
diff --git a/chrome/renderer/autofill/form_manager.h b/chrome/renderer/autofill/form_manager.h
index b32dcb5..8ef30ac 100644
--- a/chrome/renderer/autofill/form_manager.h
+++ b/chrome/renderer/autofill/form_manager.h
@@ -16,7 +16,6 @@
namespace webkit_glue {
struct FormData;
-struct FormDataPredictions;
struct FormField;
} // namespace webkit_glue
@@ -99,12 +98,6 @@ class FormManager {
void PreviewForm(const webkit_glue::FormData& form,
const WebKit::WebNode &node);
- // For each field in the |form|, sets the field's placeholder text to the
- // field's overall predicted type. Also sets the title to include the field's
- // heuristic type, server type, and signature; as well as the form's signature
- // and the experiment id for the server predictions.
- bool ShowPredictions(const webkit_glue::FormDataPredictions& form);
-
// Clears the values of all input elements in the form that contains |node|.
// Returns false if the form is not found.
bool ClearFormWithNode(const WebKit::WebNode& node);