Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(330)

Unified Diff: chrome/browser/tab_contents/tab_contents.cc

Issue 6368011: Clean up WebNavigationObserver by taking out password specific callbacks, and... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/tab_contents/tab_contents.cc
===================================================================
--- chrome/browser/tab_contents/tab_contents.cc (revision 71973)
+++ chrome/browser/tab_contents/tab_contents.cc (working copy)
@@ -448,9 +448,9 @@
omnibox_search_hint_.reset(new OmniboxSearchHint(this));
autofill_manager_.reset(new AutoFillManager(this));
- message_filters_.push_back(autofill_manager_.get());
+ AddNavigationObserver(autofill_manager_.get());
autocomplete_history_manager_.reset(new AutocompleteHistoryManager(this));
- message_filters_.push_back(autocomplete_history_manager_.get());
+ AddNavigationObserver(autocomplete_history_manager_.get());
}
TabContents::~TabContents() {
@@ -570,10 +570,12 @@
}
bool TabContents::OnMessageReceived(const IPC::Message& message) {
- for (size_t i = 0; i < message_filters_.size(); ++i) {
- if (message_filters_[i]->OnMessageReceived(message))
+ ObserverListBase<WebNavigationObserver>::Iterator it(
+ web_navigation_observers_);
+ WebNavigationObserver* observer;
+ while ((observer = it.GetNext()) != NULL)
+ if (observer->OnMessageReceived(message))
return true;
- }
bool handled = true;
bool message_is_ok = true;
@@ -1612,6 +1614,11 @@
delegate_->ViewSourceForTab(this, active_entry->url());
}
+void TabContents::TranslateStarted() {
+ FOR_EACH_OBSERVER(WebNavigationObserver, web_navigation_observers_,
+ TranslateStarted());
+}
+
void TabContents::OnDidStartProvisionalLoadForFrame(int64 frame_id,
bool is_main_frame,
const GURL& url) {
@@ -1985,9 +1992,6 @@
// Notify observers about navigation.
FOR_EACH_OBSERVER(WebNavigationObserver, web_navigation_observers_,
DidNavigateMainFramePostCommit(details, params));
-
- // Clear the cache of forms in AutoFill.
- autofill_manager_->Reset();
}
void TabContents::DidNavigateAnyFramePostCommit(
@@ -2926,18 +2930,6 @@
}
}
-void TabContents::PasswordFormsFound(
- const std::vector<webkit_glue::PasswordForm>& forms) {
- FOR_EACH_OBSERVER(WebNavigationObserver, web_navigation_observers_,
- PasswordFormsFound(forms));
-}
-
-void TabContents::PasswordFormsVisible(
- const std::vector<webkit_glue::PasswordForm>& visible_forms) {
- FOR_EACH_OBSERVER(WebNavigationObserver, web_navigation_observers_,
- PasswordFormsVisible(visible_forms));
-}
-
// Checks to see if we should generate a keyword based on the OSDD, and if
// necessary uses TemplateURLFetcher to download the OSDD and create a keyword.
void TabContents::PageHasOSDD(

Powered by Google App Engine
This is Rietveld 408576698