summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-21 18:07:38 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-21 18:07:38 +0000
commitc54d269e0b8a057533c1a1455a2acea0659629b9 (patch)
tree6400ce0747d90128871b2fa30f01fea3734a68ee
parent00aef66f5257bebc0d0f4c313d27ec8d129be54a (diff)
downloadchromium_src-c54d269e0b8a057533c1a1455a2acea0659629b9.zip
chromium_src-c54d269e0b8a057533c1a1455a2acea0659629b9.tar.gz
chromium_src-c54d269e0b8a057533c1a1455a2acea0659629b9.tar.bz2
Rename RenderViewHostDelegate::Autofill to RenderViewHostDelegate::FormFieldHistory to better reflect the purpose of the interface.
BUG=none TEST=none Review URL: http://codereview.chromium.org/294030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29669 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/autofill_manager.cc14
-rw-r--r--chrome/browser/autofill_manager.h14
-rw-r--r--chrome/browser/renderer_host/render_view_host.cc28
-rw-r--r--chrome/browser/renderer_host/render_view_host.h7
-rw-r--r--chrome/browser/renderer_host/render_view_host_delegate.cc4
-rw-r--r--chrome/browser/renderer_host/render_view_host_delegate.h29
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc3
-rw-r--r--chrome/browser/tab_contents/tab_contents.h3
-rw-r--r--chrome/renderer/render_view.cc6
9 files changed, 56 insertions, 52 deletions
diff --git a/chrome/browser/autofill_manager.cc b/chrome/browser/autofill_manager.cc
index 2d8491f..622fd99 100644
--- a/chrome/browser/autofill_manager.cc
+++ b/chrome/browser/autofill_manager.cc
@@ -57,9 +57,9 @@ void AutofillManager::FormFieldValuesSubmitted(
StoreFormEntriesInWebDatabase(form);
}
-bool AutofillManager::GetAutofillSuggestions(int query_id,
- const string16& name,
- const string16& prefix) {
+bool AutofillManager::GetFormFieldHistorySuggestions(int query_id,
+ const string16& name,
+ const string16& prefix) {
if (!*form_autofill_enabled_)
return false;
@@ -79,8 +79,8 @@ bool AutofillManager::GetAutofillSuggestions(int query_id,
return true;
}
-void AutofillManager::RemoveAutofillEntry(const string16& name,
- const string16& value) {
+void AutofillManager::RemoveFormFieldHistoryEntry(const string16& name,
+ const string16& value) {
WebDataService* web_data_service =
profile()->GetWebDataService(Profile::EXPLICIT_ACCESS);
if (!web_data_service) {
@@ -124,10 +124,10 @@ void AutofillManager::SendSuggestions(const WDTypedResult* result) {
DCHECK(result->GetType() == AUTOFILL_VALUE_RESULT);
const WDResult<std::vector<string16> >* autofill_result =
static_cast<const WDResult<std::vector<string16> >*>(result);
- host->AutofillSuggestionsReturned(
+ host->FormFieldHistorySuggestionsReturned(
query_id_, autofill_result->GetValue(), -1);
} else {
- host->AutofillSuggestionsReturned(
+ host->FormFieldHistorySuggestionsReturned(
query_id_, std::vector<string16>(), -1);
}
}
diff --git a/chrome/browser/autofill_manager.h b/chrome/browser/autofill_manager.h
index ffe74c7..0dc3c0f 100644
--- a/chrome/browser/autofill_manager.h
+++ b/chrome/browser/autofill_manager.h
@@ -20,7 +20,7 @@ class TabContents;
// Per-tab autofill manager. Handles receiving form data from the renderer and
// the storing and retrieving of form data through WebDataService.
-class AutofillManager : public RenderViewHostDelegate::Autofill,
+class AutofillManager : public RenderViewHostDelegate::FormFieldHistory,
public WebDataServiceConsumer {
public:
explicit AutofillManager(TabContents* tab_contents);
@@ -28,14 +28,14 @@ class AutofillManager : public RenderViewHostDelegate::Autofill,
Profile* profile();
- // RenderViewHostDelegate::Autofill implementation.
+ // RenderViewHostDelegate::FormFieldHistory implementation.
virtual void FormFieldValuesSubmitted(
const webkit_glue::FormFieldValues& form);
- virtual bool GetAutofillSuggestions(int query_id,
- const string16& name,
- const string16& prefix);
- virtual void RemoveAutofillEntry(const string16& name,
- const string16& value);
+ virtual bool GetFormFieldHistorySuggestions(int query_id,
+ const string16& name,
+ const string16& prefix);
+ virtual void RemoveFormFieldHistoryEntry(const string16& name,
+ const string16& value);
// WebDataServiceConsumer implementation.
virtual void OnWebDataServiceRequestDone(WebDataService::Handle h,
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc
index 2db3c8d..054332b 100644
--- a/chrome/browser/renderer_host/render_view_host.cc
+++ b/chrome/browser/renderer_host/render_view_host.cc
@@ -1349,10 +1349,10 @@ void RenderViewHost::OnMsgPasswordFormsSeen(
void RenderViewHost::OnMsgFormFieldValuesSubmitted(
const webkit_glue::FormFieldValues& form) {
- RenderViewHostDelegate::Autofill* autofill_delegate =
- delegate_->GetAutofillDelegate();
- if (autofill_delegate)
- autofill_delegate->FormFieldValuesSubmitted(form);
+ RenderViewHostDelegate::FormFieldHistory* formfield_history_delegate =
+ delegate_->GetFormFieldHistoryDelegate();
+ if (formfield_history_delegate)
+ formfield_history_delegate->FormFieldValuesSubmitted(form);
}
void RenderViewHost::OnMsgStartDragging(
@@ -1542,26 +1542,26 @@ void RenderViewHost::OnMsgShouldCloseACK(bool proceed) {
void RenderViewHost::OnQueryFormFieldAutofill(int query_id,
const string16& field_name,
const string16& user_text) {
- RenderViewHostDelegate::Autofill* autofill_delegate =
- delegate_->GetAutofillDelegate();
+ RenderViewHostDelegate::FormFieldHistory* formfield_history_delegate =
+ delegate_->GetFormFieldHistoryDelegate();
bool ok = false;
- if (autofill_delegate) {
- ok = autofill_delegate->GetAutofillSuggestions(
+ if (formfield_history_delegate) {
+ ok = formfield_history_delegate->GetFormFieldHistorySuggestions(
query_id, field_name, user_text);
}
if (!ok)
- AutofillSuggestionsReturned(query_id, std::vector<string16>(), -1);
+ FormFieldHistorySuggestionsReturned(query_id, std::vector<string16>(), -1);
}
void RenderViewHost::OnRemoveAutofillEntry(const string16& field_name,
const string16& value) {
- RenderViewHostDelegate::Autofill* autofill_delegate =
- delegate_->GetAutofillDelegate();
- if (autofill_delegate)
- autofill_delegate->RemoveAutofillEntry(field_name, value);
+ RenderViewHostDelegate::FormFieldHistory* formfield_history_delegate =
+ delegate_->GetFormFieldHistoryDelegate();
+ if (formfield_history_delegate)
+ formfield_history_delegate->RemoveFormFieldHistoryEntry(field_name, value);
}
-void RenderViewHost::AutofillSuggestionsReturned(
+void RenderViewHost::FormFieldHistorySuggestionsReturned(
int query_id, const std::vector<string16>& suggestions,
int default_suggestion_index) {
Send(new ViewMsg_QueryFormFieldAutofill_ACK(
diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h
index c01033a..ced7a60 100644
--- a/chrome/browser/renderer_host/render_view_host.h
+++ b/chrome/browser/renderer_host/render_view_host.h
@@ -393,9 +393,10 @@ class RenderViewHost : public RenderWidgetHost,
void PopupNotificationVisibilityChanged(bool visible);
// Called by the AutofillManager when the list of suggestions is ready.
- void AutofillSuggestionsReturned(int query_id,
- const std::vector<string16>& suggestions,
- int default_suggestion_index);
+ void FormFieldHistorySuggestionsReturned(
+ int query_id,
+ const std::vector<string16>& suggestions,
+ int default_suggestion_index);
// Notifies the Renderer that a move or resize of its containing window has
// started (this is used to hide the autocomplete popups if any).
diff --git a/chrome/browser/renderer_host/render_view_host_delegate.cc b/chrome/browser/renderer_host/render_view_host_delegate.cc
index a97431c..99b8608 100644
--- a/chrome/browser/renderer_host/render_view_host_delegate.cc
+++ b/chrome/browser/renderer_host/render_view_host_delegate.cc
@@ -42,8 +42,8 @@ RenderViewHostDelegate::GetFavIconDelegate() {
return NULL;
}
-RenderViewHostDelegate::Autofill*
-RenderViewHostDelegate::GetAutofillDelegate() {
+RenderViewHostDelegate::FormFieldHistory*
+RenderViewHostDelegate::GetFormFieldHistoryDelegate() {
return NULL;
}
diff --git a/chrome/browser/renderer_host/render_view_host_delegate.h b/chrome/browser/renderer_host/render_view_host_delegate.h
index bc83144..5db400d 100644
--- a/chrome/browser/renderer_host/render_view_host_delegate.h
+++ b/chrome/browser/renderer_host/render_view_host_delegate.h
@@ -337,30 +337,31 @@ class RenderViewHostDelegate {
const GURL& icon_url) = 0;
};
- // AutoFill ------------------------------------------------------------------
- // Interface for autofill-related functions.
+ // FormFieldHistory ----------------------------------------------------------
+ // Interface for FormFieldHistory-related functions.
- class Autofill {
+ class FormFieldHistory {
public:
- // Forms fillable by autofill have been detected in the page.
+ // Forms fillable by FormFieldHistory have been detected in the page.
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
// in the field |user_text|. Appeals to the database thead to perform the
- // query. When the database thread is finished, the autofill manager
+ // query. When the database thread is finished, the FormFieldHistory manager
// retrieves the calling RenderViewHost and then passes the vector of
- // suggestions to RenderViewHost::AutofillSuggestionsReturned.
- // Return true to indicate that AutofillSuggestionsReturned will be called.
- virtual bool GetAutofillSuggestions(int query_id,
- const string16& field_name,
- const string16& user_text) = 0;
+ // suggestions to RenderViewHost::FormFieldHistorySuggestionsReturned.
+ // Return true to indicate that FormFieldHistorySuggestionsReturned will be
+ // called.
+ virtual bool GetFormFieldHistorySuggestions(int query_id,
+ const string16& field_name,
+ const string16& user_text) = 0;
// Called when the user has indicated that she wants to remove the specified
- // autofill suggestion from the database.
- virtual void RemoveAutofillEntry(const string16& field_name,
- const string16& value) = 0;
+ // FormFieldHistory suggestion from the database.
+ virtual void RemoveFormFieldHistoryEntry(const string16& field_name,
+ const string16& value) = 0;
};
// ---------------------------------------------------------------------------
@@ -374,7 +375,7 @@ class RenderViewHostDelegate {
virtual Save* GetSaveDelegate();
virtual Printing* GetPrintingDelegate();
virtual FavIcon* GetFavIconDelegate();
- virtual Autofill* GetAutofillDelegate();
+ virtual FormFieldHistory* GetFormFieldHistoryDelegate();
// Gets the URL that is currently being displayed, if there is one.
virtual const GURL& GetURL() const;
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index a5ffec0..7b6675b 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -1933,7 +1933,8 @@ RenderViewHostDelegate::FavIcon* TabContents::GetFavIconDelegate() {
return &fav_icon_helper_;
}
-RenderViewHostDelegate::Autofill* TabContents::GetAutofillDelegate() {
+RenderViewHostDelegate::FormFieldHistory*
+TabContents::GetFormFieldHistoryDelegate() {
if (autofill_manager_.get() == NULL)
autofill_manager_.reset(new AutofillManager(this));
return autofill_manager_.get();
diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h
index 2c18ece..9691801 100644
--- a/chrome/browser/tab_contents/tab_contents.h
+++ b/chrome/browser/tab_contents/tab_contents.h
@@ -853,7 +853,8 @@ class TabContents : public PageNavigator,
virtual RenderViewHostDelegate::Save* GetSaveDelegate();
virtual RenderViewHostDelegate::Printing* GetPrintingDelegate();
virtual RenderViewHostDelegate::FavIcon* GetFavIconDelegate();
- virtual RenderViewHostDelegate::Autofill* GetAutofillDelegate();
+ virtual RenderViewHostDelegate::FormFieldHistory*
+ GetFormFieldHistoryDelegate();
virtual TabContents* GetAsTabContents();
virtual void AddBlockedNotice(const GURL& url, const string16& reason);
virtual ViewType::Type GetRenderViewType() const;
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 14cef58..689b180 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -1954,10 +1954,10 @@ void RenderView::willSubmitForm(WebFrame* frame, const WebForm& form) {
PasswordFormDomManager::CreatePasswordForm(form));
if (form.isAutoCompleteEnabled()) {
- scoped_ptr<FormFieldValues> autofill_form(FormFieldValues::Create(form));
- if (autofill_form.get())
+ scoped_ptr<FormFieldValues> form_values(FormFieldValues::Create(form));
+ if (form_values.get())
Send(new ViewHostMsg_FormFieldValuesSubmitted(routing_id_,
- *autofill_form));
+ *form_values));
}
}