summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/autofill_manager.cc12
-rw-r--r--chrome/browser/autofill_manager.h7
-rw-r--r--chrome/browser/renderer_host/render_view_host.cc13
-rw-r--r--chrome/browser/renderer_host/render_view_host.h6
-rw-r--r--chrome/browser/renderer_host/render_view_host_delegate.h7
-rw-r--r--chrome/browser/tab_contents/tab_contents.h1
-rw-r--r--chrome/browser/webdata/web_data_service.cc20
-rw-r--r--chrome/browser/webdata/web_data_service.h16
-rw-r--r--chrome/browser/webdata/web_database.cc17
-rw-r--r--chrome/browser/webdata/web_database.h14
-rw-r--r--chrome/browser/webdata/web_database_unittest.cc57
-rw-r--r--chrome/common/render_messages.h16
-rw-r--r--chrome/common/render_messages_internal.h4
-rw-r--r--chrome/renderer/render_view.cc18
14 files changed, 107 insertions, 101 deletions
diff --git a/chrome/browser/autofill_manager.cc b/chrome/browser/autofill_manager.cc
index 6c5c6c7..2d8491f 100644
--- a/chrome/browser/autofill_manager.cc
+++ b/chrome/browser/autofill_manager.cc
@@ -4,12 +4,14 @@
#include "chrome/browser/autofill_manager.h"
+#include <vector>
+
#include "base/string_util.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
-#include "webkit/glue/autofill_form.h"
+#include "webkit/glue/form_field_values.h"
// Limit on the number of suggestions to appear in the pop-up menu under an
// text input element in a form.
@@ -50,8 +52,8 @@ Profile* AutofillManager::profile() {
return tab_contents_->profile();
}
-void AutofillManager::AutofillFormSubmitted(
- const webkit_glue::AutofillForm& form) {
+void AutofillManager::FormFieldValuesSubmitted(
+ const webkit_glue::FormFieldValues& form) {
StoreFormEntriesInWebDatabase(form);
}
@@ -103,7 +105,7 @@ void AutofillManager::OnWebDataServiceRequestDone(WebDataService::Handle h,
}
void AutofillManager::StoreFormEntriesInWebDatabase(
- const webkit_glue::AutofillForm& form) {
+ const webkit_glue::FormFieldValues& form) {
if (!*form_autofill_enabled_)
return;
@@ -111,7 +113,7 @@ void AutofillManager::StoreFormEntriesInWebDatabase(
return;
profile()->GetWebDataService(Profile::EXPLICIT_ACCESS)->
- AddAutofillFormElements(form.elements);
+ AddFormFieldValues(form.elements);
}
void AutofillManager::SendSuggestions(const WDTypedResult* result) {
diff --git a/chrome/browser/autofill_manager.h b/chrome/browser/autofill_manager.h
index 66d21e2..ffe74c7 100644
--- a/chrome/browser/autofill_manager.h
+++ b/chrome/browser/autofill_manager.h
@@ -12,7 +12,7 @@
#include "chrome/common/pref_member.h"
namespace webkit_glue {
-class AutofillForm;
+class FormFieldValues;
}
class Profile;
@@ -29,7 +29,8 @@ class AutofillManager : public RenderViewHostDelegate::Autofill,
Profile* profile();
// RenderViewHostDelegate::Autofill implementation.
- virtual void AutofillFormSubmitted(const webkit_glue::AutofillForm& form);
+ virtual void FormFieldValuesSubmitted(
+ const webkit_glue::FormFieldValues& form);
virtual bool GetAutofillSuggestions(int query_id,
const string16& name,
const string16& prefix);
@@ -44,7 +45,7 @@ class AutofillManager : public RenderViewHostDelegate::Autofill,
private:
void CancelPendingQuery();
- void StoreFormEntriesInWebDatabase(const webkit_glue::AutofillForm& form);
+ void StoreFormEntriesInWebDatabase(const webkit_glue::FormFieldValues& form);
void SendSuggestions(const WDTypedResult* suggestions);
TabContents* tab_contents_;
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc
index 8465992..2db3c8d 100644
--- a/chrome/browser/renderer_host/render_view_host.cc
+++ b/chrome/browser/renderer_host/render_view_host.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/renderer_host/render_view_host.h"
#include <string>
+#include <utility>
#include <vector>
#include "app/gfx/native_widget_types.h"
@@ -39,7 +40,7 @@
#include "net/base/net_util.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "webkit/api/public/WebFindOptions.h"
-#include "webkit/glue/autofill_form.h"
+#include "webkit/glue/form_field_values.h"
#if defined(OS_WIN)
// TODO(port): accessibility not yet implemented. See http://crbug.com/8288.
@@ -781,8 +782,8 @@ void RenderViewHost::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_ShowModalHTMLDialog,
OnMsgShowModalHTMLDialog)
IPC_MESSAGE_HANDLER(ViewHostMsg_PasswordFormsSeen, OnMsgPasswordFormsSeen)
- IPC_MESSAGE_HANDLER(ViewHostMsg_AutofillFormSubmitted,
- OnMsgAutofillFormSubmitted)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_FormFieldValuesSubmitted,
+ OnMsgFormFieldValuesSubmitted)
IPC_MESSAGE_HANDLER(ViewHostMsg_StartDragging, OnMsgStartDragging)
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateDragCursor, OnUpdateDragCursor)
IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus)
@@ -1346,12 +1347,12 @@ void RenderViewHost::OnMsgPasswordFormsSeen(
delegate_->PasswordFormsSeen(forms);
}
-void RenderViewHost::OnMsgAutofillFormSubmitted(
- const webkit_glue::AutofillForm& form) {
+void RenderViewHost::OnMsgFormFieldValuesSubmitted(
+ const webkit_glue::FormFieldValues& form) {
RenderViewHostDelegate::Autofill* autofill_delegate =
delegate_->GetAutofillDelegate();
if (autofill_delegate)
- autofill_delegate->AutofillFormSubmitted(form);
+ autofill_delegate->FormFieldValuesSubmitted(form);
}
void RenderViewHost::OnMsgStartDragging(
diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h
index 6d6104a..c01033a 100644
--- a/chrome/browser/renderer_host/render_view_host.h
+++ b/chrome/browser/renderer_host/render_view_host.h
@@ -17,7 +17,7 @@
#include "webkit/api/public/WebConsoleMessage.h"
#include "webkit/api/public/WebDragOperation.h"
#include "webkit/api/public/WebTextDirection.h"
-#include "webkit/glue/autofill_form.h"
+#include "webkit/glue/form_field_values.h"
#include "webkit/glue/password_form_dom_manager.h"
#include "webkit/glue/window_open_disposition.h"
@@ -44,7 +44,7 @@ enum LoadState;
}
namespace webkit_glue {
-class AutofillForm;
+class FormFieldValues;
struct WebApplicationInfo;
}
@@ -532,7 +532,7 @@ class RenderViewHost : public RenderWidgetHost,
IPC::Message* reply_msg);
void OnMsgPasswordFormsSeen(
const std::vector<webkit_glue::PasswordForm>& forms);
- void OnMsgAutofillFormSubmitted(const webkit_glue::AutofillForm& forms);
+ void OnMsgFormFieldValuesSubmitted(const webkit_glue::FormFieldValues& forms);
void OnMsgStartDragging(const WebDropData& drop_data,
WebKit::WebDragOperationsMask operations_allowed);
void OnUpdateDragCursor(WebKit::WebDragOperation drag_operation);
diff --git a/chrome/browser/renderer_host/render_view_host_delegate.h b/chrome/browser/renderer_host/render_view_host_delegate.h
index 0e054d4..bc83144 100644
--- a/chrome/browser/renderer_host/render_view_host_delegate.h
+++ b/chrome/browser/renderer_host/render_view_host_delegate.h
@@ -15,7 +15,6 @@
#include "webkit/api/public/WebDragOperation.h"
#include "webkit/glue/window_open_disposition.h"
-class AutofillForm;
struct ContextMenuParams;
class FilePath;
class GURL;
@@ -50,7 +49,7 @@ class Message;
}
namespace webkit_glue {
-class AutofillForm;
+class FormFieldValues;
struct PasswordForm;
struct WebApplicationInfo;
}
@@ -344,8 +343,8 @@ class RenderViewHostDelegate {
class Autofill {
public:
// Forms fillable by autofill have been detected in the page.
- virtual void AutofillFormSubmitted(
- const webkit_glue::AutofillForm& form) = 0;
+ virtual void FormFieldValuesSubmitted(
+ const webkit_glue::FormFieldValues& form) = 0;
// Called to retrieve a list of suggestions from the web database given
// the name of the field |field_name| and what the user has already typed
diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h
index 7aa1f7f..2c18ece 100644
--- a/chrome/browser/tab_contents/tab_contents.h
+++ b/chrome/browser/tab_contents/tab_contents.h
@@ -61,7 +61,6 @@ class WaitableEvent;
}
namespace webkit_glue {
-class AutofillForm;
struct WebApplicationInfo;
}
diff --git a/chrome/browser/webdata/web_data_service.cc b/chrome/browser/webdata/web_data_service.cc
index cec4e99..cc52def 100644
--- a/chrome/browser/webdata/web_data_service.cc
+++ b/chrome/browser/webdata/web_data_service.cc
@@ -9,8 +9,8 @@
#include "base/scoped_ptr.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/common/chrome_constants.h"
+#include "webkit/glue/form_field_values.h"
#include "webkit/glue/password_form.h"
-#include "webkit/glue/autofill_form.h"
////////////////////////////////////////////////////////////////////////////////
//
@@ -19,7 +19,7 @@
////////////////////////////////////////////////////////////////////////////////
using base::Time;
-using webkit_glue::AutofillForm;
+using webkit_glue::FormFieldValues;
using webkit_glue::PasswordForm;
WebDataService::WebDataService() : thread_(NULL),
@@ -114,14 +114,14 @@ void WebDataService::CancelRequest(Handle h) {
i->second->Cancel();
}
-void WebDataService::AddAutofillFormElements(
- const std::vector<AutofillForm::Element>& element) {
- GenericRequest<std::vector<AutofillForm::Element> >* request =
- new GenericRequest<std::vector<AutofillForm::Element> >(
+void WebDataService::AddFormFieldValues(
+ const std::vector<FormFieldValues::Element>& element) {
+ GenericRequest<std::vector<FormFieldValues::Element> >* request =
+ new GenericRequest<std::vector<FormFieldValues::Element> >(
this, GetNextRequestHandle(), NULL, element);
RegisterRequest(request);
ScheduleTask(NewRunnableMethod(this,
- &WebDataService::AddAutofillFormElementsImpl,
+ &WebDataService::AddFormFieldValuesImpl,
request));
}
@@ -572,10 +572,10 @@ void WebDataService::GetBlacklistLoginsImpl(WebDataRequest* request) {
//
////////////////////////////////////////////////////////////////////////////////
-void WebDataService::AddAutofillFormElementsImpl(
- GenericRequest<std::vector<AutofillForm::Element> >* request) {
+void WebDataService::AddFormFieldValuesImpl(
+ GenericRequest<std::vector<FormFieldValues::Element> >* request) {
if (db_ && !request->IsCancelled()) {
- if (db_->AddAutofillFormElements(request->GetArgument()))
+ if (db_->AddFormFieldValues(request->GetArgument()))
ScheduleCommit();
}
request->RequestComplete();
diff --git a/chrome/browser/webdata/web_data_service.h b/chrome/browser/webdata/web_data_service.h
index 03b7766..7226122 100644
--- a/chrome/browser/webdata/web_data_service.h
+++ b/chrome/browser/webdata/web_data_service.h
@@ -15,7 +15,7 @@
#include "base/scoped_vector.h"
#include "base/thread.h"
#include "chrome/browser/webdata/web_database.h"
-#include "webkit/glue/autofill_form.h"
+#include "webkit/glue/form_field_values.h"
#if defined(OS_WIN)
struct IE7PasswordInfo;
@@ -93,7 +93,7 @@ class WDTypedResult {
}
protected:
- WDTypedResult(WDResultType type) : type_(type) {
+ explicit WDTypedResult(WDResultType type) : type_(type) {
}
private:
@@ -375,8 +375,8 @@ class WebDataService : public base::RefCountedThreadSafe<WebDataService> {
//////////////////////////////////////////////////////////////////////////////
// Schedules a task to add form elements to the web database.
- void AddAutofillFormElements(
- const std::vector<webkit_glue::AutofillForm::Element>& elements);
+ void AddFormFieldValues(
+ const std::vector<webkit_glue::FormFieldValues::Element>& elements);
// Initiates the request for a vector of values which have been entered in
// form input fields named |name|. The method OnWebDataServiceRequestDone of
@@ -464,8 +464,8 @@ class WebDataService : public base::RefCountedThreadSafe<WebDataService> {
// Autofill.
//
//////////////////////////////////////////////////////////////////////////////
- void AddAutofillFormElementsImpl(
- GenericRequest<std::vector<webkit_glue::AutofillForm::Element> >*
+ void AddFormFieldValuesImpl(
+ GenericRequest<std::vector<webkit_glue::FormFieldValues::Element> >*
request);
void GetFormValuesForElementNameImpl(WebDataRequest* request,
const string16& name, const string16& prefix, int limit);
@@ -480,9 +480,9 @@ class WebDataService : public base::RefCountedThreadSafe<WebDataService> {
//
//////////////////////////////////////////////////////////////////////////////
- void SetWebAppImageImpl(GenericRequest2<GURL,SkBitmap>* request);
+ void SetWebAppImageImpl(GenericRequest2<GURL, SkBitmap>* request);
- void SetWebAppHasAllImagesImpl(GenericRequest2<GURL,bool>* request);
+ void SetWebAppHasAllImagesImpl(GenericRequest2<GURL, bool>* request);
void RemoveWebAppImpl(GenericRequest<GURL>* request);
diff --git a/chrome/browser/webdata/web_database.cc b/chrome/browser/webdata/web_database.cc
index 3be6268..f611a93 100644
--- a/chrome/browser/webdata/web_database.cc
+++ b/chrome/browser/webdata/web_database.cc
@@ -6,6 +6,7 @@
#include <algorithm>
#include <limits>
+#include <set>
#include <vector>
#include "app/gfx/codec/png_codec.h"
@@ -98,7 +99,7 @@ using webkit_glue::PasswordForm;
////////////////////////////////////////////////////////////////////////////////
using base::Time;
-using webkit_glue::AutofillForm;
+using webkit_glue::FormFieldValues;
// Current version number.
static const int kCurrentVersionNumber = 22;
@@ -802,14 +803,14 @@ bool WebDatabase::GetAllLogins(std::vector<PasswordForm*>* forms,
return s.Succeeded();
}
-bool WebDatabase::AddAutofillFormElements(
- const std::vector<AutofillForm::Element>& elements) {
+bool WebDatabase::AddFormFieldValues(
+ const std::vector<FormFieldValues::Element>& elements) {
bool result = true;
- for (std::vector<AutofillForm::Element>::const_iterator
+ for (std::vector<FormFieldValues::Element>::const_iterator
itr = elements.begin();
itr != elements.end();
itr++) {
- result = result && AddAutofillFormElement(*itr);
+ result = result && AddFormFieldValue(*itr);
}
return result;
}
@@ -837,7 +838,7 @@ bool WebDatabase::ClearAutofillEmptyValueElements() {
}
bool WebDatabase::GetIDAndCountOfFormElement(
- const AutofillForm::Element& element,
+ const FormFieldValues::Element& element,
int64* pair_id,
int* count) {
sql::Statement s(db_.GetUniqueStatement(
@@ -878,7 +879,7 @@ bool WebDatabase::GetCountOfFormElement(int64 pair_id, int* count) {
return false;
}
-bool WebDatabase::InsertFormElement(const AutofillForm::Element& element,
+bool WebDatabase::InsertFormElement(const FormFieldValues::Element& element,
int64* pair_id) {
sql::Statement s(db_.GetUniqueStatement(
"INSERT INTO autofill (name, value, value_lower) VALUES (?,?,?)"));
@@ -939,7 +940,7 @@ bool WebDatabase::SetCountOfFormElement(int64 pair_id, int count) {
return true;
}
-bool WebDatabase::AddAutofillFormElement(const AutofillForm::Element& element) {
+bool WebDatabase::AddFormFieldValue(const FormFieldValues::Element& element) {
int count = 0;
int64 pair_id;
diff --git a/chrome/browser/webdata/web_database.h b/chrome/browser/webdata/web_database.h
index 1326c18..cc73e9b 100644
--- a/chrome/browser/webdata/web_database.h
+++ b/chrome/browser/webdata/web_database.h
@@ -14,7 +14,7 @@
#include "chrome/browser/search_engines/template_url.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "testing/gtest/include/gtest/gtest_prod.h"
-#include "webkit/glue/autofill_form.h"
+#include "webkit/glue/form_field_values.h"
class FilePath;
@@ -132,12 +132,12 @@ class WebDatabase {
// Records the form elements in |elements| in the database in the autofill
// table.
- bool AddAutofillFormElements(
- const std::vector<webkit_glue::AutofillForm::Element>& elements);
+ bool AddFormFieldValues(
+ const std::vector<webkit_glue::FormFieldValues::Element>& elements);
// Records a single form element in in the database in the autofill table.
- bool AddAutofillFormElement(
- const webkit_glue::AutofillForm::Element& element);
+ bool AddFormFieldValue(
+ const webkit_glue::FormFieldValues::Element& element);
// Retrieves a vector of all values which have been recorded in the autofill
// table as the value in a form element with name |name| and which start with
@@ -168,7 +168,7 @@ class WebDatabase {
// Gets the pair_id and count entries from name and value specified in
// |element|. Sets *count to 0 if there is no such row in the table.
bool GetIDAndCountOfFormElement(
- const webkit_glue::AutofillForm::Element& element,
+ const webkit_glue::FormFieldValues::Element& element,
int64* pair_id,
int* count);
@@ -181,7 +181,7 @@ class WebDatabase {
// Adds a new row to the autofill table with name and value given in
// |element|. Sets *pair_id to the pair_id of the new row.
bool InsertFormElement(
- const webkit_glue::AutofillForm::Element& element,
+ const webkit_glue::FormFieldValues::Element& element,
int64* pair_id);
// Adds a new row to the autofill_dates table.
diff --git a/chrome/browser/webdata/web_database_unittest.cc b/chrome/browser/webdata/web_database_unittest.cc
index 1d7569b..32001e5 100644
--- a/chrome/browser/webdata/web_database_unittest.cc
+++ b/chrome/browser/webdata/web_database_unittest.cc
@@ -13,12 +13,12 @@
#include "chrome/common/chrome_paths.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "webkit/glue/autofill_form.h"
+#include "webkit/glue/form_field_values.h"
#include "webkit/glue/password_form.h"
using base::Time;
using base::TimeDelta;
-using webkit_glue::AutofillForm;
+using webkit_glue::FormFieldValues;
using webkit_glue::PasswordForm;
class WebDatabaseTest : public testing::Test {
@@ -391,23 +391,24 @@ TEST_F(WebDatabaseTest, Autofill) {
// Simulate the submission of a handful of entries in a field called "Name",
// some more often than others.
- EXPECT_TRUE(db.AddAutofillFormElement(
- AutofillForm::Element(ASCIIToUTF16("Name"), ASCIIToUTF16("Superman"))));
+ EXPECT_TRUE(db.AddFormFieldValue(
+ FormFieldValues::Element(ASCIIToUTF16("Name"),
+ ASCIIToUTF16("Superman"))));
std::vector<string16> v;
for (int i = 0; i < 5; i++) {
- EXPECT_TRUE(db.AddAutofillFormElement(
- AutofillForm::Element(ASCIIToUTF16("Name"),
- ASCIIToUTF16("Clark Kent"))));
+ EXPECT_TRUE(db.AddFormFieldValue(
+ FormFieldValues::Element(ASCIIToUTF16("Name"),
+ ASCIIToUTF16("Clark Kent"))));
}
for (int i = 0; i < 3; i++) {
- EXPECT_TRUE(db.AddAutofillFormElement(
- AutofillForm::Element(ASCIIToUTF16("Name"),
- ASCIIToUTF16("Clark Sutter"))));
+ EXPECT_TRUE(db.AddFormFieldValue(
+ FormFieldValues::Element(ASCIIToUTF16("Name"),
+ ASCIIToUTF16("Clark Sutter"))));
}
for (int i = 0; i < 2; i++) {
- EXPECT_TRUE(db.AddAutofillFormElement(
- AutofillForm::Element(ASCIIToUTF16("Favorite Color"),
- ASCIIToUTF16("Green"))));
+ EXPECT_TRUE(db.AddFormFieldValue(
+ FormFieldValues::Element(ASCIIToUTF16("Favorite Color"),
+ ASCIIToUTF16("Green"))));
}
int count = 0;
@@ -416,7 +417,8 @@ TEST_F(WebDatabaseTest, Autofill) {
// We have added the name Clark Kent 5 times, so count should be 5 and pair_id
// should be somthing non-zero.
EXPECT_TRUE(db.GetIDAndCountOfFormElement(
- AutofillForm::Element(ASCIIToUTF16("Name"), ASCIIToUTF16("Clark Kent")),
+ FormFieldValues::Element(ASCIIToUTF16("Name"),
+ ASCIIToUTF16("Clark Kent")),
&pair_id, &count));
EXPECT_EQ(5, count);
EXPECT_NE(0, pair_id);
@@ -424,12 +426,13 @@ TEST_F(WebDatabaseTest, Autofill) {
// Storing in the data base should be case sensitive, so there should be no
// database entry for clark kent lowercase.
EXPECT_TRUE(db.GetIDAndCountOfFormElement(
- AutofillForm::Element(ASCIIToUTF16("Name"), ASCIIToUTF16("clark kent")),
+ FormFieldValues::Element(ASCIIToUTF16("Name"),
+ ASCIIToUTF16("clark kent")),
&pair_id, &count));
EXPECT_EQ(0, count);
EXPECT_TRUE(db.GetIDAndCountOfFormElement(
- AutofillForm::Element(ASCIIToUTF16("Favorite Color"),
+ FormFieldValues::Element(ASCIIToUTF16("Favorite Color"),
ASCIIToUTF16("Green")),
&pair_id, &count));
EXPECT_EQ(2, count);
@@ -471,7 +474,8 @@ TEST_F(WebDatabaseTest, Autofill) {
EXPECT_TRUE(db.RemoveFormElementsAddedBetween(t1, Time()));
EXPECT_TRUE(db.GetIDAndCountOfFormElement(
- AutofillForm::Element(ASCIIToUTF16("Name"), ASCIIToUTF16("Clark Kent")),
+ FormFieldValues::Element(ASCIIToUTF16("Name"),
+ ASCIIToUTF16("Clark Kent")),
&pair_id, &count));
EXPECT_EQ(0, count);
@@ -481,14 +485,14 @@ TEST_F(WebDatabaseTest, Autofill) {
// Now add some values with empty strings.
const string16 kValue = ASCIIToUTF16(" toto ");
- EXPECT_TRUE(db.AddAutofillFormElement(
- AutofillForm::Element(ASCIIToUTF16("blank"), string16())));
- EXPECT_TRUE(db.AddAutofillFormElement(
- AutofillForm::Element(ASCIIToUTF16("blank"), ASCIIToUTF16(" "))));
- EXPECT_TRUE(db.AddAutofillFormElement(
- AutofillForm::Element(ASCIIToUTF16("blank"), ASCIIToUTF16(" "))));
- EXPECT_TRUE(db.AddAutofillFormElement(
- AutofillForm::Element(ASCIIToUTF16("blank"), kValue)));
+ EXPECT_TRUE(db.AddFormFieldValue(
+ FormFieldValues::Element(ASCIIToUTF16("blank"), string16())));
+ EXPECT_TRUE(db.AddFormFieldValue(
+ FormFieldValues::Element(ASCIIToUTF16("blank"), ASCIIToUTF16(" "))));
+ EXPECT_TRUE(db.AddFormFieldValue(
+ FormFieldValues::Element(ASCIIToUTF16("blank"), ASCIIToUTF16(" "))));
+ EXPECT_TRUE(db.AddFormFieldValue(
+ FormFieldValues::Element(ASCIIToUTF16("blank"), kValue)));
// They should be stored normally as the DB layer does not check for empty
// values.
@@ -501,7 +505,8 @@ TEST_F(WebDatabaseTest, Autofill) {
db.ClearAutofillEmptyValueElements();
v.clear();
- EXPECT_TRUE(db.GetFormValuesForElementName(ASCIIToUTF16("blank"), string16(), &v, 10));
+ EXPECT_TRUE(db.GetFormValuesForElementName(ASCIIToUTF16("blank"),
+ string16(), &v, 10));
ASSERT_EQ(1U, v.size());
EXPECT_EQ(kValue, v[0]);
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index d4925a0..ccaa4e0 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -34,9 +34,9 @@
#include "net/base/upload_data.h"
#include "net/http/http_response_headers.h"
#include "webkit/appcache/appcache_interfaces.h"
-#include "webkit/glue/autofill_form.h"
#include "webkit/glue/context_menu.h"
#include "webkit/glue/form_data.h"
+#include "webkit/glue/form_field_values.h"
#include "webkit/glue/password_form.h"
#include "webkit/glue/password_form_dom_manager.h"
#include "webkit/glue/resource_loader_bridge.h"
@@ -733,16 +733,14 @@ struct ParamTraits<webkit_glue::PasswordForm> {
}
};
-// Traits for AutofillForm_Params structure to pack/unpack.
+// Traits for FormFieldValues_Params structure to pack/unpack.
template <>
-struct ParamTraits<webkit_glue::AutofillForm> {
- typedef webkit_glue::AutofillForm param_type;
+struct ParamTraits<webkit_glue::FormFieldValues> {
+ typedef webkit_glue::FormFieldValues param_type;
static void Write(Message* m, const param_type& p) {
WriteParam(m, p.elements.size());
- for (std::vector<webkit_glue::AutofillForm::Element>::const_iterator itr =
- p.elements.begin();
- itr != p.elements.end();
- itr++) {
+ std::vector<webkit_glue::FormFieldValues::Element>::const_iterator itr;
+ for (itr = p.elements.begin(); itr != p.elements.end(); itr++) {
WriteParam(m, itr->name);
WriteParam(m, itr->value);
}
@@ -759,7 +757,7 @@ struct ParamTraits<webkit_glue::AutofillForm> {
return result;
}
static void Log(const param_type& p, std::wstring* l) {
- l->append(L"<AutofillForm>");
+ l->append(L"<FormFieldValues>");
}
};
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index 908c7a4..a4dbf29 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -1258,8 +1258,8 @@ IPC_BEGIN_MESSAGES(ViewHost)
std::vector<webkit_glue::PasswordForm> /* forms */)
// Notification that a form has been submitted. The user hit the button.
- IPC_MESSAGE_ROUTED1(ViewHostMsg_AutofillFormSubmitted,
- webkit_glue::AutofillForm /* form */)
+ IPC_MESSAGE_ROUTED1(ViewHostMsg_FormFieldValuesSubmitted,
+ webkit_glue::FormFieldValues /* form */)
// Used to tell the parent the user started dragging in the content area. The
// WebDropData struct contains contextual information about the pieces of the
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 73ffe0b..14cef58 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -107,7 +107,7 @@
using base::Time;
using base::TimeDelta;
using webkit_glue::AltErrorPageResourceFetcher;
-using webkit_glue::AutofillForm;
+using webkit_glue::FormFieldValues;
using webkit_glue::ImageResourceFetcher;
using webkit_glue::PasswordForm;
using webkit_glue::PasswordFormDomManager;
@@ -1391,7 +1391,6 @@ void RenderView::didStopLoading() {
method_factory_.NewRunnableMethod(&RenderView::CapturePageInfo, page_id_,
false),
kDelayForCaptureMs);
-
}
bool RenderView::shouldBeginEditing(const WebRange& range) {
@@ -1955,9 +1954,10 @@ void RenderView::willSubmitForm(WebFrame* frame, const WebForm& form) {
PasswordFormDomManager::CreatePasswordForm(form));
if (form.isAutoCompleteEnabled()) {
- scoped_ptr<AutofillForm> autofill_form(AutofillForm::Create(form));
+ scoped_ptr<FormFieldValues> autofill_form(FormFieldValues::Create(form));
if (autofill_form.get())
- Send(new ViewHostMsg_AutofillFormSubmitted(routing_id_, *autofill_form));
+ Send(new ViewHostMsg_FormFieldValuesSubmitted(routing_id_,
+ *autofill_form));
}
}
@@ -2569,11 +2569,11 @@ bool RenderView::DownloadImage(int id, const GURL& image_url, int image_size) {
void RenderView::DidDownloadImage(ImageResourceFetcher* fetcher,
const SkBitmap& image) {
// Notify requester of image download status.
- Send(new ViewHostMsg_DidDownloadFavIcon(routing_id_,
- fetcher->id(),
- fetcher->image_url(),
- image.isNull(),
- image));
+ Send(new ViewHostMsg_DidDownloadFavIcon(routing_id_,
+ fetcher->id(),
+ fetcher->image_url(),
+ image.isNull(),
+ image));
// Dispose of the image fetcher.
DCHECK(image_fetchers_.find(fetcher) != image_fetchers_.end());
image_fetchers_.erase(fetcher);