diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-10 18:57:53 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-10 18:57:53 +0000 |
commit | 403415accf228400fc1365d5de9696348509beb8 (patch) | |
tree | cb63da5dbef81b6baa0dea28bf0d9e964185bc80 /chrome/browser/tab_contents | |
parent | 8ef0b11afeb11f96028f3382a08447866a7687a4 (diff) | |
download | chromium_src-403415accf228400fc1365d5de9696348509beb8.zip chromium_src-403415accf228400fc1365d5de9696348509beb8.tar.gz chromium_src-403415accf228400fc1365d5de9696348509beb8.tar.bz2 |
Make RenderViewHost not know about AutoFill and AutoComplete.
This only takes care of the browser side portion, the renderer change will be done separately once the WebKit change it depends on is rolled.
Review URL: http://codereview.chromium.org/5958021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70914 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.cc | 29 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.h | 17 |
2 files changed, 20 insertions, 26 deletions
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index 698d691..563279e 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -433,6 +433,11 @@ TabContents::TabContents(Profile* profile, // Set-up the showing of the omnibox search infobar if applicable. if (OmniboxSearchHint::IsEnabled(profile)) omnibox_search_hint_.reset(new OmniboxSearchHint(this)); + + autofill_manager_.reset(new AutoFillManager(this)); + message_filters_.push_back(autofill_manager_.get()); + autocomplete_history_manager_.reset(new AutocompleteHistoryManager(this)); + message_filters_.push_back(autocomplete_history_manager_.get()); } TabContents::~TabContents() { @@ -552,6 +557,11 @@ void TabContents::RegisterUserPrefs(PrefService* prefs) { } bool TabContents::OnMessageReceived(const IPC::Message& message) { + for (size_t i = 0; i < message_filters_.size(); ++i) { + if (message_filters_[i]->OnMessageReceived(message)) + return true; + } + bool handled = true; bool message_is_ok = true; IPC_BEGIN_MESSAGE_MAP_EX(TabContents, message, message_is_ok) @@ -586,12 +596,6 @@ bool TabContents::HostsExtension() const { return GetURL().SchemeIs(chrome::kExtensionScheme); } -AutoFillManager* TabContents::GetAutoFillManager() { - if (autofill_manager_.get() == NULL) - autofill_manager_.reset(new AutoFillManager(this)); - return autofill_manager_.get(); -} - PluginInstaller* TabContents::GetPluginInstaller() { if (plugin_installer_.get() == NULL) plugin_installer_.reset(new PluginInstaller(this)); @@ -1959,8 +1963,7 @@ void TabContents::DidNavigateMainFramePostCommit( DidNavigateMainFramePostCommit(details, params)); // Clear the cache of forms in AutoFill. - if (autofill_manager_.get()) - autofill_manager_->Reset(); + autofill_manager_->Reset(); } void TabContents::DidNavigateAnyFramePostCommit( @@ -2415,16 +2418,6 @@ RenderViewHostDelegate::FavIcon* TabContents::GetFavIconDelegate() { return &fav_icon_helper_; } -RenderViewHostDelegate::Autocomplete* TabContents::GetAutocompleteDelegate() { - if (autocomplete_history_manager_.get() == NULL) - autocomplete_history_manager_.reset(new AutocompleteHistoryManager(this)); - return autocomplete_history_manager_.get(); -} - -RenderViewHostDelegate::AutoFill* TabContents::GetAutoFillDelegate() { - return GetAutoFillManager(); -} - RenderViewHostDelegate::SSL* TabContents::GetSSLDelegate() { return GetSSLHelper(); } diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h index 7ef622c..d21095f 100644 --- a/chrome/browser/tab_contents/tab_contents.h +++ b/chrome/browser/tab_contents/tab_contents.h @@ -150,9 +150,6 @@ class TabContents : public PageNavigator, // Returns true if contains content rendered by an extension. bool HostsExtension() const; - // Returns the AutoFillManager, creating it if necessary. - AutoFillManager* GetAutoFillManager(); - // Returns the PluginInstaller, creating it if necessary. PluginInstaller* GetPluginInstaller(); @@ -752,6 +749,11 @@ class TabContents : public PageNavigator, int content_restrictions() const { return content_restrictions_; } + AutocompleteHistoryManager* autocomplete_history_manager() { + return autocomplete_history_manager_.get(); + } + AutoFillManager* autofill_manager() { return autofill_manager_.get(); } + private: friend class NavigationController; // Used to access the child_windows_ (ConstrainedWindowList) for testing @@ -950,8 +952,6 @@ class TabContents : public PageNavigator, virtual RenderViewHostDelegate::Save* GetSaveDelegate(); virtual RenderViewHostDelegate::Printing* GetPrintingDelegate(); virtual RenderViewHostDelegate::FavIcon* GetFavIconDelegate(); - virtual RenderViewHostDelegate::Autocomplete* GetAutocompleteDelegate(); - virtual RenderViewHostDelegate::AutoFill* GetAutoFillDelegate(); virtual RenderViewHostDelegate::SSL* GetSSLDelegate(); virtual RenderViewHostDelegate::FileSelect* GetFileSelectDelegate(); virtual AutomationResourceRoutingDelegate* @@ -1117,10 +1117,10 @@ class TabContents : public PageNavigator, // SavePackage, lazily created. scoped_refptr<SavePackage> save_package_; - // AutocompleteHistoryManager, lazily created. + // AutocompleteHistoryManager. scoped_ptr<AutocompleteHistoryManager> autocomplete_history_manager_; - // AutoFillManager, lazily created. + // AutoFillManager. scoped_ptr<AutoFillManager> autofill_manager_; // PluginInstaller, lazily created. @@ -1340,7 +1340,8 @@ class TabContents : public PageNavigator, // (full-page plugins for now only) permissions. int content_restrictions_; - // --------------------------------------------------------------------------- + // All the IPC message filters for this render view. + std::vector<IPC::Channel::Listener*> message_filters_; DISALLOW_COPY_AND_ASSIGN(TabContents); }; |