diff options
-rw-r--r-- | chrome/browser/autocomplete_history_manager.cc | 7 | ||||
-rw-r--r-- | chrome/browser/autocomplete_history_manager.h | 14 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_view_host.cc | 26 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_view_host_delegate.cc | 4 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_view_host_delegate.h | 30 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.cc | 3 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.h | 3 |
7 files changed, 42 insertions, 45 deletions
diff --git a/chrome/browser/autocomplete_history_manager.cc b/chrome/browser/autocomplete_history_manager.cc index 63d2aaf..c0ea8c4 100644 --- a/chrome/browser/autocomplete_history_manager.cc +++ b/chrome/browser/autocomplete_history_manager.cc @@ -53,9 +53,8 @@ void AutocompleteHistoryManager::FormFieldValuesSubmitted( StoreFormEntriesInWebDatabase(form); } -bool AutocompleteHistoryManager::GetFormFieldHistorySuggestions(int query_id, - const string16& name, - const string16& prefix) { +bool AutocompleteHistoryManager::GetAutocompleteSuggestions( + int query_id, const string16& name, const string16& prefix) { if (!*form_autofill_enabled_) return false; @@ -75,7 +74,7 @@ bool AutocompleteHistoryManager::GetFormFieldHistorySuggestions(int query_id, return true; } -void AutocompleteHistoryManager::RemoveFormFieldHistoryEntry( +void AutocompleteHistoryManager::RemoveAutocompleteEntry( const string16& name, const string16& value) { WebDataService* web_data_service = profile()->GetWebDataService(Profile::EXPLICIT_ACCESS); diff --git a/chrome/browser/autocomplete_history_manager.h b/chrome/browser/autocomplete_history_manager.h index 1629f23..1d6966f 100644 --- a/chrome/browser/autocomplete_history_manager.h +++ b/chrome/browser/autocomplete_history_manager.h @@ -21,7 +21,7 @@ class TabContents; // Per-tab Autocomplete history manager. Handles receiving form data from the // renderer and the storing and retrieving of form data through WebDataService. class AutocompleteHistoryManager - : public RenderViewHostDelegate::FormFieldHistory, + : public RenderViewHostDelegate::Autocomplete, public WebDataServiceConsumer { public: explicit AutocompleteHistoryManager(TabContents* tab_contents); @@ -29,14 +29,14 @@ class AutocompleteHistoryManager Profile* profile(); - // RenderViewHostDelegate::FormFieldHistory implementation. + // RenderViewHostDelegate::Autocomplete implementation. virtual void FormFieldValuesSubmitted( const webkit_glue::FormFieldValues& form); - virtual bool GetFormFieldHistorySuggestions(int query_id, - const string16& name, - const string16& prefix); - virtual void RemoveFormFieldHistoryEntry(const string16& name, - const string16& value); + virtual bool GetAutocompleteSuggestions(int query_id, + const string16& name, + const string16& prefix); + virtual void RemoveAutocompleteEntry(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 da86877..4731684 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -1375,10 +1375,10 @@ void RenderViewHost::OnMsgPasswordFormsSeen( void RenderViewHost::OnMsgFormFieldValuesSubmitted( const webkit_glue::FormFieldValues& form) { - RenderViewHostDelegate::FormFieldHistory* formfield_history_delegate = - delegate_->GetFormFieldHistoryDelegate(); - if (formfield_history_delegate) - formfield_history_delegate->FormFieldValuesSubmitted(form); + RenderViewHostDelegate::Autocomplete* autocomplete_delegate = + delegate_->GetAutocompleteDelegate(); + if (autocomplete_delegate) + autocomplete_delegate->FormFieldValuesSubmitted(form); RenderViewHostDelegate::AutoFill* autofill_delegate = delegate_->GetAutoFillDelegate(); @@ -1580,16 +1580,16 @@ void RenderViewHost::OnQueryFormFieldAutofill( RenderViewHostDelegate::AutoFill* autofill_delegate = delegate_->GetAutoFillDelegate(); // If the AutoFill delegate has results to return, we don't need any results - // from the FormFieldHistory delegate. + // from the Autocomplete delegate. if (autofill_delegate && autofill_delegate->GetAutoFillSuggestions(query_id, field)) { return; } - RenderViewHostDelegate::FormFieldHistory* formfield_history_delegate = - delegate_->GetFormFieldHistoryDelegate(); - if (formfield_history_delegate && - formfield_history_delegate->GetFormFieldHistorySuggestions( + RenderViewHostDelegate::Autocomplete* autocomplete_delegate = + delegate_->GetAutocompleteDelegate(); + if (autocomplete_delegate && + autocomplete_delegate->GetAutocompleteSuggestions( query_id, field.name(), field.value())) { return; } @@ -1600,10 +1600,10 @@ void RenderViewHost::OnQueryFormFieldAutofill( void RenderViewHost::OnRemoveAutofillEntry(const string16& field_name, const string16& value) { - RenderViewHostDelegate::FormFieldHistory* formfield_history_delegate = - delegate_->GetFormFieldHistoryDelegate(); - if (formfield_history_delegate) - formfield_history_delegate->RemoveFormFieldHistoryEntry(field_name, value); + RenderViewHostDelegate::Autocomplete* autocomplete_delegate = + delegate_->GetAutocompleteDelegate(); + if (autocomplete_delegate) + autocomplete_delegate->RemoveAutocompleteEntry(field_name, value); } void RenderViewHost::OnFillAutoFillFormData(int query_id, diff --git a/chrome/browser/renderer_host/render_view_host_delegate.cc b/chrome/browser/renderer_host/render_view_host_delegate.cc index dcf26f5..eb4c8ca 100644 --- a/chrome/browser/renderer_host/render_view_host_delegate.cc +++ b/chrome/browser/renderer_host/render_view_host_delegate.cc @@ -47,8 +47,8 @@ RenderViewHostDelegate::GetFavIconDelegate() { return NULL; } -RenderViewHostDelegate::FormFieldHistory* -RenderViewHostDelegate::GetFormFieldHistoryDelegate() { +RenderViewHostDelegate::Autocomplete* +RenderViewHostDelegate::GetAutocompleteDelegate() { 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 f4e088e..d908e1f 100644 --- a/chrome/browser/renderer_host/render_view_host_delegate.h +++ b/chrome/browser/renderer_host/render_view_host_delegate.h @@ -359,31 +359,31 @@ class RenderViewHostDelegate { const GURL& icon_url) = 0; }; - // FormFieldHistory ---------------------------------------------------------- - // Interface for FormFieldHistory-related functions. + // Autocomplete -------------------------------------------------------------- + // Interface for Autocomplete-related functions. - class FormFieldHistory { + class Autocomplete { public: - // Forms fillable by FormFieldHistory have been detected in the page. + // Forms fillable by Autocomplete 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 thread to perform the - // query. When the database thread is finished, the FormFieldHistory manager - // retrieves the calling RenderViewHost and then passes the vector of - // suggestions to RenderViewHost::AutocompleteSuggestionsReturned. - // Return true to indicate that FormFieldHistorySuggestionsReturned will be + // query. When the database thread is finished, the AutocompleteHistory + // manager retrieves the calling RenderViewHost and then passes the vector + // of suggestions to RenderViewHost::AutocompleteSuggestionsReturned. + // Returns true to indicate that FormFieldHistorySuggestionsReturned will be // called. - virtual bool GetFormFieldHistorySuggestions(int query_id, - const string16& field_name, - const string16& user_text) = 0; + virtual bool GetAutocompleteSuggestions(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 - // FormFieldHistory suggestion from the database. - virtual void RemoveFormFieldHistoryEntry(const string16& field_name, - const string16& value) = 0; + // Autocomplete suggestion from the database. + virtual void RemoveAutocompleteEntry(const string16& field_name, + const string16& value) = 0; }; // AutoFill ------------------------------------------------------------------ @@ -449,7 +449,7 @@ class RenderViewHostDelegate { virtual Save* GetSaveDelegate(); virtual Printing* GetPrintingDelegate(); virtual FavIcon* GetFavIconDelegate(); - virtual FormFieldHistory* GetFormFieldHistoryDelegate(); + virtual Autocomplete* GetAutocompleteDelegate(); virtual AutoFill* GetAutoFillDelegate(); virtual BookmarkDrag* GetBookmarkDragDelegate(); diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index 8d93d2e..775572b 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -2037,8 +2037,7 @@ RenderViewHostDelegate::FavIcon* TabContents::GetFavIconDelegate() { return &fav_icon_helper_; } -RenderViewHostDelegate::FormFieldHistory* -TabContents::GetFormFieldHistoryDelegate() { +RenderViewHostDelegate::Autocomplete* TabContents::GetAutocompleteDelegate() { if (autocomplete_history_manager_.get() == NULL) autocomplete_history_manager_.reset(new AutocompleteHistoryManager(this)); return autocomplete_history_manager_.get(); diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h index 15dd13a..d6d688d 100644 --- a/chrome/browser/tab_contents/tab_contents.h +++ b/chrome/browser/tab_contents/tab_contents.h @@ -847,8 +847,7 @@ class TabContents : public PageNavigator, virtual RenderViewHostDelegate::Save* GetSaveDelegate(); virtual RenderViewHostDelegate::Printing* GetPrintingDelegate(); virtual RenderViewHostDelegate::FavIcon* GetFavIconDelegate(); - virtual RenderViewHostDelegate::FormFieldHistory* - GetFormFieldHistoryDelegate(); + virtual RenderViewHostDelegate::Autocomplete* GetAutocompleteDelegate(); virtual RenderViewHostDelegate::AutoFill* GetAutoFillDelegate(); virtual TabContents* GetAsTabContents(); virtual ViewType::Type GetRenderViewType() const; |