diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-03 18:27:46 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-03 18:27:46 +0000 |
commit | cca0f1e9ca8aa46a9088028ceb1f08e0a3f792b2 (patch) | |
tree | 84e486002d42744cea34f59d1b83ab29a0dc5354 | |
parent | 2a3197bb6a8a4c6f3a7affadce28cda638906131 (diff) | |
download | chromium_src-cca0f1e9ca8aa46a9088028ceb1f08e0a3f792b2.zip chromium_src-cca0f1e9ca8aa46a9088028ceb1f08e0a3f792b2.tar.gz chromium_src-cca0f1e9ca8aa46a9088028ceb1f08e0a3f792b2.tar.bz2 |
Convert all the notifications which use NavigationController to content::NavigationController. After this is done, we can then make WebContents return a content::NavigationEntry instead of the impl.
BUG=98716
TBR=joi
Review URL: http://codereview.chromium.org/9016047
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116150 0039d316-1c4b-4281-b951-d872f2087c98
83 files changed, 439 insertions, 366 deletions
diff --git a/chrome/browser/alternate_nav_url_fetcher.cc b/chrome/browser/alternate_nav_url_fetcher.cc index 3676a4d..08462c7 100644 --- a/chrome/browser/alternate_nav_url_fetcher.cc +++ b/chrome/browser/alternate_nav_url_fetcher.cc @@ -119,15 +119,16 @@ void AlternateNavURLFetcher::Observe( // If we've already received a notification for the same controller, we // should delete ourselves as that indicates that the page is being // re-loaded so this instance is now stale. - NavigationController* controller = - content::Source<NavigationController>(source).ptr(); + content::NavigationController* controller = + content::Source<content::NavigationController>(source).ptr(); if (controller_ == controller) { delete this; } else if (!controller_) { // Start listening for the commit notification. DCHECK(controller->GetPendingEntry()); registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<NavigationController>(controller)); + content::Source<content::NavigationController>( + controller)); StartFetch(controller); } break; @@ -135,7 +136,7 @@ void AlternateNavURLFetcher::Observe( case chrome::NOTIFICATION_INSTANT_COMMITTED: { // See above. - NavigationController* controller = + content::NavigationController* controller = &content::Source<TabContentsWrapper>(source)-> web_contents()->GetController(); if (controller_ == controller) { @@ -150,7 +151,8 @@ void AlternateNavURLFetcher::Observe( case content::NOTIFICATION_NAV_ENTRY_COMMITTED: // The page was navigated, we can show the infobar now if necessary. registrar_.Remove(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<NavigationController>(controller_)); + content::Source<content::NavigationController>( + controller_)); navigated_to_entry_ = true; ShowInfobarIfPossible(); // WARNING: |this| may be deleted! @@ -177,10 +179,11 @@ void AlternateNavURLFetcher::OnURLFetchComplete( // WARNING: |this| may be deleted! } -void AlternateNavURLFetcher::StartFetch(NavigationController* controller) { +void AlternateNavURLFetcher::StartFetch( + content::NavigationController* controller) { controller_ = controller; registrar_.Add(this, content::NOTIFICATION_TAB_CLOSED, - content::Source<NavigationController>(controller_)); + content::Source<content::NavigationController>(controller_)); DCHECK_EQ(NOT_STARTED, state_); state_ = IN_PROGRESS; diff --git a/chrome/browser/alternate_nav_url_fetcher.h b/chrome/browser/alternate_nav_url_fetcher.h index 9e5b342..7853a26 100644 --- a/chrome/browser/alternate_nav_url_fetcher.h +++ b/chrome/browser/alternate_nav_url_fetcher.h @@ -14,7 +14,9 @@ #include "content/public/browser/notification_registrar.h" #include "googleurl/src/gurl.h" +namespace content { class NavigationController; +} namespace net { class URLRequestStatus; @@ -62,7 +64,7 @@ class AlternateNavURLFetcher : public content::NotificationObserver, // Sets |controller_| to the supplied pointer and begins fetching // |alternate_nav_url_|. - void StartFetch(NavigationController* controller); + void StartFetch(content::NavigationController* controller); // Sets |state_| to either SUCCEEDED or FAILED depending on the result of the // fetch. @@ -78,7 +80,7 @@ class AlternateNavURLFetcher : public content::NotificationObserver, GURL alternate_nav_url_; scoped_ptr<content::URLFetcher> fetcher_; - NavigationController* controller_; + content::NavigationController* controller_; State state_; bool navigated_to_entry_; diff --git a/chrome/browser/autofill/autofill_feedback_infobar_delegate.cc b/chrome/browser/autofill/autofill_feedback_infobar_delegate.cc index f48c9f3..75b4388 100644 --- a/chrome/browser/autofill/autofill_feedback_infobar_delegate.cc +++ b/chrome/browser/autofill/autofill_feedback_infobar_delegate.cc @@ -9,6 +9,7 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/webui/bug_report_ui.h" #include "chrome/browser/userfeedback/proto/extension.pb.h" +#include "content/browser/tab_contents/navigation_controller.h" #include "content/public/browser/navigation_details.h" #include "content/public/browser/web_contents.h" #include "googleurl/src/gurl.h" diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index 9d0ca8a..47d6476 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -291,18 +291,19 @@ void AutomationProvider::OnLoginWebuiReady() { Send(new AutomationMsg_InitialLoadsComplete()); } -void AutomationProvider::AddLoginHandler(NavigationController* tab, +void AutomationProvider::AddLoginHandler(content::NavigationController* tab, LoginHandler* handler) { login_handler_map_[tab] = handler; } -void AutomationProvider::RemoveLoginHandler(NavigationController* tab) { +void AutomationProvider::RemoveLoginHandler(content::NavigationController* tab) { DCHECK(login_handler_map_[tab]); login_handler_map_.erase(tab); } int AutomationProvider::GetIndexForNavigationController( - const NavigationController* controller, const Browser* parent) const { + const content::NavigationController* controller, + const Browser* parent) const { DCHECK(parent); return parent->GetIndexOfController(controller); } @@ -526,7 +527,7 @@ bool AutomationProvider::Send(IPC::Message* msg) { } Browser* AutomationProvider::FindAndActivateTab( - NavigationController* controller) { + content::NavigationController* controller) { int tab_index; Browser* browser = Browser::GetBrowserForController(controller, &tab_index); if (browser) @@ -545,7 +546,7 @@ void AutomationProvider::HandleFindRequest( return; } - NavigationController* nav = tab_tracker_->GetResource(handle); + content::NavigationController* nav = tab_tracker_->GetResource(handle); WebContents* web_contents = nav->GetWebContents(); SendFindRequest(web_contents, @@ -600,9 +601,10 @@ void AutomationProvider::SetProxyConfig(const std::string& new_proxy_config) { } WebContents* AutomationProvider::GetWebContentsForHandle( - int handle, NavigationController** tab) { + int handle, content::NavigationController** tab) { if (tab_tracker_->ContainsHandle(handle)) { - NavigationController* nav_controller = tab_tracker_->GetResource(handle); + content::NavigationController* nav_controller = + tab_tracker_->GetResource(handle); if (tab) *tab = nav_controller; return nav_controller->GetWebContents(); @@ -616,7 +618,7 @@ void AutomationProvider::OverrideEncoding(int tab_handle, bool* success) { *success = false; if (tab_tracker_->ContainsHandle(tab_handle)) { - NavigationController* nav = tab_tracker_->GetResource(tab_handle); + content::NavigationController* nav = tab_tracker_->GetResource(tab_handle); if (!nav) return; Browser* browser = FindAndActivateTab(nav); @@ -688,7 +690,7 @@ void AutomationProvider::Paste(int tab_handle) { void AutomationProvider::ReloadAsync(int tab_handle) { if (tab_tracker_->ContainsHandle(tab_handle)) { - NavigationController* tab = tab_tracker_->GetResource(tab_handle); + content::NavigationController* tab = tab_tracker_->GetResource(tab_handle); if (!tab) { NOTREACHED(); return; @@ -724,7 +726,7 @@ void AutomationProvider::OnSetPageFontSize(int tab_handle, } if (tab_tracker_->ContainsHandle(tab_handle)) { - NavigationController* tab = tab_tracker_->GetResource(tab_handle); + content::NavigationController* tab = tab_tracker_->GetResource(tab_handle); DCHECK(tab != NULL); if (tab && tab->GetWebContents()) { DCHECK(tab->GetWebContents()->GetBrowserContext() != NULL); @@ -795,7 +797,7 @@ void AutomationProvider::GetTracingOutput(std::string* chunk, RenderViewHost* AutomationProvider::GetViewForTab(int tab_handle) { if (tab_tracker_->ContainsHandle(tab_handle)) { - NavigationController* tab = tab_tracker_->GetResource(tab_handle); + content::NavigationController* tab = tab_tracker_->GetResource(tab_handle); if (!tab) { NOTREACHED(); return NULL; @@ -1003,7 +1005,7 @@ void AutomationProvider::GetExtensionProperty( } void AutomationProvider::SaveAsAsync(int tab_handle) { - NavigationController* tab = NULL; + content::NavigationController* tab = NULL; WebContents* web_contents = GetWebContentsForHandle(tab_handle, &tab); if (web_contents) web_contents->OnSavePage(); diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h index 5279cbd..55e373d 100644 --- a/chrome/browser/automation/automation_provider.h +++ b/chrome/browser/automation/automation_provider.h @@ -51,7 +51,6 @@ class FilePath; class InitialLoadObserver; class LoginHandler; class MetricEventDurationObserver; -class NavigationController; class NavigationControllerRestoredObserver; class Profile; class RenderViewHost; @@ -64,6 +63,10 @@ namespace IPC { class ChannelProxy; } +namespace content { +class NavigationController; +} + namespace base { class DictionaryValue; } @@ -117,8 +120,9 @@ class AutomationProvider // Get the index of a particular NavigationController object // in the given parent window. This method uses // TabStrip::GetIndexForNavigationController to get the index. - int GetIndexForNavigationController(const NavigationController* controller, - const Browser* parent) const; + int GetIndexForNavigationController( + const content::NavigationController* controller, + const Browser* parent) const; // Add or remove a non-owning reference to a tab's LoginHandler. This is for // when a login prompt is shown for HTTP/FTP authentication. @@ -126,8 +130,9 @@ class AutomationProvider // Eventually we'll probably want ways to interact with the ChromeView of the // login window in a generic manner, such that it can be used for anything, // not just logins. - void AddLoginHandler(NavigationController* tab, LoginHandler* handler); - void RemoveLoginHandler(NavigationController* tab); + void AddLoginHandler(content::NavigationController* tab, + LoginHandler* handler); + void RemoveLoginHandler(content::NavigationController* tab); // IPC::Channel::Sender implementation. virtual bool Send(IPC::Message* msg) OVERRIDE; @@ -167,13 +172,13 @@ class AutomationProvider // Helper function to find the browser window that contains a given // NavigationController and activate that tab. // Returns the Browser if found. - Browser* FindAndActivateTab(NavigationController* contents); + Browser* FindAndActivateTab(content::NavigationController* contents); // Convert a tab handle into a WebContents. If |tab| is non-NULL a pointer // to the tab is also returned. Returns NULL in case of failure or if the tab // is not of the WebContents type. - content::WebContents* GetWebContentsForHandle(int handle, - NavigationController** tab); + content::WebContents* GetWebContentsForHandle( + int handle, content::NavigationController** tab); // Returns the protocol version which typically is the module version. virtual std::string GetProtocolVersion(); @@ -193,7 +198,8 @@ class AutomationProvider scoped_ptr<AutomationTabTracker> tab_tracker_; scoped_ptr<AutomationWindowTracker> window_tracker_; - typedef std::map<NavigationController*, LoginHandler*> LoginHandlerMap; + typedef std::map<content::NavigationController*, LoginHandler*> + LoginHandlerMap; LoginHandlerMap login_handler_map_; Profile* profile_; diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc index 62c4aa0..c1a0b7e 100644 --- a/chrome/browser/automation/automation_provider_observers.cc +++ b/chrome/browser/automation/automation_provider_observers.cc @@ -233,7 +233,7 @@ void NewTabUILoadObserver::Observe(int type, NavigationControllerRestoredObserver::NavigationControllerRestoredObserver( AutomationProvider* automation, - NavigationController* controller, + content::NavigationController* controller, IPC::Message* reply_message) : automation_(automation->AsWeakPtr()), controller_(controller), @@ -273,7 +273,7 @@ void NavigationControllerRestoredObserver::SendDone() { } NavigationNotificationObserver::NavigationNotificationObserver( - NavigationController* controller, + content::NavigationController* controller, AutomationProvider* automation, IPC::Message* reply_message, int number_of_navigations, @@ -290,7 +290,7 @@ NavigationNotificationObserver::NavigationNotificationObserver( return; } DCHECK_LT(0, navigations_remaining_); - content::Source<NavigationController> source(controller_); + content::Source<content::NavigationController> source(controller_); registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, source); registrar_.Add(this, content::NOTIFICATION_LOAD_START, source); registrar_.Add(this, content::NOTIFICATION_LOAD_STOP, source); @@ -395,7 +395,7 @@ void TabStripNotificationObserver::Observe( ObserveTab(&(content::Source<TabContentsWrapper>(source).ptr()-> tab_contents()->GetController())); } else { - ObserveTab(content::Source<NavigationController>(source).ptr()); + ObserveTab(content::Source<content::NavigationController>(source).ptr()); } delete this; } else { @@ -415,7 +415,7 @@ TabAppendedNotificationObserver::TabAppendedNotificationObserver( TabAppendedNotificationObserver::~TabAppendedNotificationObserver() {} void TabAppendedNotificationObserver::ObserveTab( - NavigationController* controller) { + content::NavigationController* controller) { if (!automation_) return; @@ -443,7 +443,7 @@ TabClosedNotificationObserver::TabClosedNotificationObserver( TabClosedNotificationObserver::~TabClosedNotificationObserver() {} void TabClosedNotificationObserver::ObserveTab( - NavigationController* controller) { + content::NavigationController* controller) { if (!automation_) return; @@ -885,8 +885,8 @@ void BrowserOpenedNotificationObserver::Observe( content::Source<Browser>(source).ptr()); } else if (type == content::NOTIFICATION_LOAD_STOP) { // Only send the result if the loaded tab is in the new window. - NavigationController* controller = - content::Source<NavigationController>(source).ptr(); + content::NavigationController* controller = + content::Source<content::NavigationController>(source).ptr(); TabContentsWrapper* tab = TabContentsWrapper::GetCurrentWrapperForContents( controller->GetWebContents()); int window_id = tab ? tab->restore_tab_helper()->window_id().id() : -1; @@ -1900,13 +1900,13 @@ void AutomationProviderBrowsingDataObserver::OnBrowsingDataRemoverDone() { } OmniboxAcceptNotificationObserver::OmniboxAcceptNotificationObserver( - NavigationController* controller, + content::NavigationController* controller, AutomationProvider* automation, IPC::Message* reply_message) : automation_(automation->AsWeakPtr()), reply_message_(reply_message), controller_(controller) { - content::Source<NavigationController> source(controller_); + content::Source<content::NavigationController> source(controller_); registrar_.Add(this, content::NOTIFICATION_LOAD_STOP, source); // Pages requiring auth don't send LOAD_STOP. registrar_.Add(this, chrome::NOTIFICATION_AUTH_NEEDED, source); @@ -2198,7 +2198,7 @@ void NTPInfoObserver::OnTopSitesReceived( } AppLaunchObserver::AppLaunchObserver( - NavigationController* controller, + content::NavigationController* controller, AutomationProvider* automation, IPC::Message* reply_message, extension_misc::LaunchContainer launch_container) @@ -2209,7 +2209,7 @@ AppLaunchObserver::AppLaunchObserver( new_window_id_(extension_misc::kUnknownWindowId) { if (launch_container_ == extension_misc::LAUNCH_TAB) { // Need to wait for the currently-active tab to reload. - content::Source<NavigationController> source(controller_); + content::Source<content::NavigationController> source(controller_); registrar_.Add(this, content::NOTIFICATION_LOAD_STOP, source); } else { // Need to wait for a new tab in a new window to load. @@ -2236,8 +2236,8 @@ void AppLaunchObserver::Observe(int type, return; } else { // The app has launched only if the loaded tab is in the new window. - NavigationController* controller = - content::Source<NavigationController>(source).ptr(); + content::NavigationController* controller = + content::Source<content::NavigationController>(source).ptr(); TabContentsWrapper* tab = TabContentsWrapper::GetCurrentWrapperForContents( controller->GetWebContents()); @@ -2750,7 +2750,7 @@ void NewTabObserver::Observe(int type, const content::NotificationSource& source, const content::NotificationDetails& details) { DCHECK_EQ(content::NOTIFICATION_TAB_PARENTED, type); - NavigationController* controller = + content::NavigationController* controller = &(content::Source<TabContentsWrapper>(source).ptr()-> tab_contents()->GetController()); if (automation_) { @@ -2971,8 +2971,8 @@ void BrowserOpenedWithNewProfileNotificationObserver::Observe( content::Source<Browser>(source).ptr()); } else if (type == content::NOTIFICATION_LOAD_STOP) { // Only send the result if the loaded tab is in the new window. - NavigationController* controller = - content::Source<NavigationController>(source).ptr(); + content::NavigationController* controller = + content::Source<content::NavigationController>(source).ptr(); TabContentsWrapper* tab = TabContentsWrapper::GetCurrentWrapperForContents( controller->GetWebContents()); int window_id = tab ? tab->restore_tab_helper()->window_id().id() : -1; diff --git a/chrome/browser/automation/automation_provider_observers.h b/chrome/browser/automation/automation_provider_observers.h index 02c6642..04d96c1 100644 --- a/chrome/browser/automation/automation_provider_observers.h +++ b/chrome/browser/automation/automation_provider_observers.h @@ -61,7 +61,6 @@ class Extension; class ExtensionProcessManager; class ExtensionService; class InfoBarTabHelper; -class NavigationController; class Notification; class Profile; class RenderViewHost; @@ -80,6 +79,7 @@ class Message; } namespace content { +class NavigationController; class WebContents; } @@ -183,9 +183,10 @@ class NewTabUILoadObserver : public content::NotificationObserver { class NavigationControllerRestoredObserver : public content::NotificationObserver { public: - NavigationControllerRestoredObserver(AutomationProvider* automation, - NavigationController* controller, - IPC::Message* reply_message); + NavigationControllerRestoredObserver( + AutomationProvider* automation, + content::NavigationController* controller, + IPC::Message* reply_message); virtual ~NavigationControllerRestoredObserver(); virtual void Observe(int type, @@ -198,7 +199,7 @@ class NavigationControllerRestoredObserver content::NotificationRegistrar registrar_; base::WeakPtr<AutomationProvider> automation_; - NavigationController* controller_; + content::NavigationController* controller_; scoped_ptr<IPC::Message> reply_message_; DISALLOW_COPY_AND_ASSIGN(NavigationControllerRestoredObserver); @@ -206,7 +207,7 @@ class NavigationControllerRestoredObserver class NavigationNotificationObserver : public content::NotificationObserver { public: - NavigationNotificationObserver(NavigationController* controller, + NavigationNotificationObserver(content::NavigationController* controller, AutomationProvider* automation, IPC::Message* reply_message, int number_of_navigations, @@ -224,7 +225,7 @@ class NavigationNotificationObserver : public content::NotificationObserver { content::NotificationRegistrar registrar_; base::WeakPtr<AutomationProvider> automation_; scoped_ptr<IPC::Message> reply_message_; - NavigationController* controller_; + content::NavigationController* controller_; int navigations_remaining_; bool navigation_started_; bool use_json_interface_; @@ -242,7 +243,7 @@ class TabStripNotificationObserver : public content::NotificationObserver { const content::NotificationSource& source, const content::NotificationDetails& details); - virtual void ObserveTab(NavigationController* controller) = 0; + virtual void ObserveTab(content::NavigationController* controller) = 0; protected: content::NotificationRegistrar registrar_; @@ -257,7 +258,7 @@ class TabAppendedNotificationObserver : public TabStripNotificationObserver { IPC::Message* reply_message); virtual ~TabAppendedNotificationObserver(); - virtual void ObserveTab(NavigationController* controller); + virtual void ObserveTab(content::NavigationController* controller); protected: Browser* parent_; @@ -274,7 +275,7 @@ class TabClosedNotificationObserver : public TabStripNotificationObserver { IPC::Message* reply_message); virtual ~TabClosedNotificationObserver(); - virtual void ObserveTab(NavigationController* controller); + virtual void ObserveTab(content::NavigationController* controller); void set_for_browser_command(bool for_browser_command); @@ -1300,9 +1301,9 @@ class AutomationProviderBrowsingDataObserver // in the omnibox popup. class OmniboxAcceptNotificationObserver : public content::NotificationObserver { public: - OmniboxAcceptNotificationObserver(NavigationController* controller, - AutomationProvider* automation, - IPC::Message* reply_message); + OmniboxAcceptNotificationObserver(content::NavigationController* controller, + AutomationProvider* automation, + IPC::Message* reply_message); virtual ~OmniboxAcceptNotificationObserver(); virtual void Observe(int type, @@ -1313,7 +1314,7 @@ class OmniboxAcceptNotificationObserver : public content::NotificationObserver { content::NotificationRegistrar registrar_; base::WeakPtr<AutomationProvider> automation_; scoped_ptr<IPC::Message> reply_message_; - NavigationController* controller_; + content::NavigationController* controller_; DISALLOW_COPY_AND_ASSIGN(OmniboxAcceptNotificationObserver); }; @@ -1404,7 +1405,7 @@ class NTPInfoObserver : public content::NotificationObserver { // a content load in some tab has stopped. class AppLaunchObserver : public content::NotificationObserver { public: - AppLaunchObserver(NavigationController* controller, + AppLaunchObserver(content::NavigationController* controller, AutomationProvider* automation, IPC::Message* reply_message, extension_misc::LaunchContainer launch_container); @@ -1415,7 +1416,7 @@ class AppLaunchObserver : public content::NotificationObserver { const content::NotificationDetails& details); private: - NavigationController* controller_; + content::NavigationController* controller_; base::WeakPtr<AutomationProvider> automation_; scoped_ptr<IPC::Message> reply_message_; content::NotificationRegistrar registrar_; diff --git a/chrome/browser/automation/automation_provider_win.cc b/chrome/browser/automation/automation_provider_win.cc index 693c5ec..1adcbc1 100644 --- a/chrome/browser/automation/automation_provider_win.cc +++ b/chrome/browser/automation/automation_provider_win.cc @@ -249,7 +249,7 @@ void AutomationProvider::PrintAsync(int tab_handle) { ExternalTabContainer* AutomationProvider::GetExternalTabForHandle(int handle) { if (tab_tracker_->ContainsHandle(handle)) { - NavigationController* tab = tab_tracker_->GetResource(handle); + content::NavigationController* tab = tab_tracker_->GetResource(handle); return ExternalTabContainer::GetContainerForTab( tab->GetWebContents()->GetNativeView()); } @@ -291,7 +291,7 @@ void AutomationProvider::OnForwardContextMenuCommandToChrome(int tab_handle, if (!tab_tracker_->ContainsHandle(tab_handle)) return; - NavigationController* tab = tab_tracker_->GetResource(tab_handle); + content::NavigationController* tab = tab_tracker_->GetResource(tab_handle); if (!tab) { NOTREACHED(); return; @@ -371,7 +371,7 @@ void AutomationProvider::NavigateInExternalTab( *status = AUTOMATION_MSG_NAVIGATION_ERROR; if (tab_tracker_->ContainsHandle(handle)) { - NavigationController* tab = tab_tracker_->GetResource(handle); + content::NavigationController* tab = tab_tracker_->GetResource(handle); tab->LoadURL( url, content::Referrer(referrer, WebKit::WebReferrerPolicyDefault), @@ -386,7 +386,7 @@ void AutomationProvider::NavigateExternalTabAtIndex( *status = AUTOMATION_MSG_NAVIGATION_ERROR; if (tab_tracker_->ContainsHandle(handle)) { - NavigationController* tab = tab_tracker_->GetResource(handle); + content::NavigationController* tab = tab_tracker_->GetResource(handle); tab->GoToIndex(navigation_index); *status = AUTOMATION_MSG_NAVIGATION_SUCCESS; } @@ -402,7 +402,7 @@ void AutomationProvider::OnRunUnloadHandlers( void AutomationProvider::OnSetZoomLevel(int handle, int zoom_level) { if (tab_tracker_->ContainsHandle(handle)) { - NavigationController* tab = tab_tracker_->GetResource(handle); + content::NavigationController* tab = tab_tracker_->GetResource(handle); if (tab->GetWebContents() && tab->GetWebContents()->GetRenderViewHost()) { RenderViewHost* host = tab->GetWebContents()->GetRenderViewHost(); content::PageZoom zoom = static_cast<content::PageZoom>(zoom_level); diff --git a/chrome/browser/automation/automation_tab_tracker.cc b/chrome/browser/automation/automation_tab_tracker.cc index 03e3320..2d8d033 100644 --- a/chrome/browser/automation/automation_tab_tracker.cc +++ b/chrome/browser/automation/automation_tab_tracker.cc @@ -9,32 +9,34 @@ #include "content/public/browser/notification_source.h" AutomationTabTracker::AutomationTabTracker(IPC::Message::Sender* automation) - : AutomationResourceTracker<NavigationController*>(automation) { + : AutomationResourceTracker<content::NavigationController*>(automation) { } AutomationTabTracker::~AutomationTabTracker() { } -void AutomationTabTracker::AddObserver(NavigationController* resource) { +void AutomationTabTracker::AddObserver( + content::NavigationController* resource) { // This tab could either be a regular tab or an external tab // Register for both notifications. registrar_.Add(this, content::NOTIFICATION_TAB_CLOSING, - content::Source<NavigationController>(resource)); + content::Source<content::NavigationController>(resource)); registrar_.Add(this, chrome::NOTIFICATION_EXTERNAL_TAB_CLOSED, - content::Source<NavigationController>(resource)); + content::Source<content::NavigationController>(resource)); // We also want to know about navigations so we can keep track of the last // navigation time. registrar_.Add(this, content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>(resource)); + content::Source<content::NavigationController>(resource)); } -void AutomationTabTracker::RemoveObserver(NavigationController* resource) { +void AutomationTabTracker::RemoveObserver( + content::NavigationController* resource) { registrar_.Remove(this, content::NOTIFICATION_TAB_CLOSING, - content::Source<NavigationController>(resource)); + content::Source<content::NavigationController>(resource)); registrar_.Remove(this, chrome::NOTIFICATION_EXTERNAL_TAB_CLOSED, - content::Source<NavigationController>(resource)); + content::Source<content::NavigationController>(resource)); registrar_.Remove(this, content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>(resource)); + content::Source<content::NavigationController>(resource)); } void AutomationTabTracker::Observe( @@ -44,15 +46,15 @@ void AutomationTabTracker::Observe( switch (type) { case content::NOTIFICATION_LOAD_STOP: last_navigation_times_[ - content::Source<NavigationController>(source).ptr()] = + content::Source<content::NavigationController>(source).ptr()] = base::Time::Now(); return; case chrome::NOTIFICATION_EXTERNAL_TAB_CLOSED: case content::NOTIFICATION_TAB_CLOSING: { - std::map<NavigationController*, base::Time>::iterator iter = + std::map<content::NavigationController*, base::Time>::iterator iter = last_navigation_times_.find( - content::Source<NavigationController>(source).ptr()); + content::Source<content::NavigationController>(source).ptr()); if (iter != last_navigation_times_.end()) last_navigation_times_.erase(iter); } @@ -60,16 +62,16 @@ void AutomationTabTracker::Observe( default: NOTREACHED(); } - AutomationResourceTracker<NavigationController*>::Observe(type, source, - details); + AutomationResourceTracker<content::NavigationController*>::Observe( + type, source, details); } base::Time AutomationTabTracker::GetLastNavigationTime(int handle) { if (ContainsHandle(handle)) { - NavigationController* controller = GetResource(handle); + content::NavigationController* controller = GetResource(handle); if (controller) { - std::map<NavigationController*, base::Time>::const_iterator iter = - last_navigation_times_.find(controller); + std::map<content::NavigationController*, base::Time>::const_iterator iter + = last_navigation_times_.find(controller); if (iter != last_navigation_times_.end()) return iter->second; } diff --git a/chrome/browser/automation/automation_tab_tracker.h b/chrome/browser/automation/automation_tab_tracker.h index 5cab11b..13926afd 100644 --- a/chrome/browser/automation/automation_tab_tracker.h +++ b/chrome/browser/automation/automation_tab_tracker.h @@ -11,16 +11,18 @@ #include "base/time.h" #include "chrome/browser/automation/automation_resource_tracker.h" +namespace content { class NavigationController; +} class AutomationTabTracker - : public AutomationResourceTracker<NavigationController*> { + : public AutomationResourceTracker<content::NavigationController*> { public: explicit AutomationTabTracker(IPC::Message::Sender* automation); virtual ~AutomationTabTracker(); - virtual void AddObserver(NavigationController* resource); - virtual void RemoveObserver(NavigationController* resource); + virtual void AddObserver(content::NavigationController* resource); + virtual void RemoveObserver(content::NavigationController* resource); virtual void Observe(int type, const content::NotificationSource& source, @@ -30,7 +32,7 @@ class AutomationTabTracker private: // Last time a navigation occurred. - std::map<NavigationController*, base::Time> last_navigation_times_; + std::map<content::NavigationController*, base::Time> last_navigation_times_; DISALLOW_COPY_AND_ASSIGN(AutomationTabTracker); }; diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc index f7f59ae..f40985a 100644 --- a/chrome/browser/automation/testing_automation_provider.cc +++ b/chrome/browser/automation/testing_automation_provider.cc @@ -571,7 +571,8 @@ void TestingAutomationProvider::CloseTab(int tab_handle, bool wait_until_closed, IPC::Message* reply_message) { if (tab_tracker_->ContainsHandle(tab_handle)) { - NavigationController* controller = tab_tracker_->GetResource(tab_handle); + content::NavigationController* controller = + tab_tracker_->GetResource(tab_handle); int index; Browser* browser = Browser::GetBrowserForController(controller, &index); DCHECK(browser); @@ -613,7 +614,8 @@ void TestingAutomationProvider::ShowCollectedCookiesDialog( int handle, bool* success) { *success = false; if (tab_tracker_->ContainsHandle(handle)) { - NavigationController* controller = tab_tracker_->GetResource(handle); + content::NavigationController* controller = + tab_tracker_->GetResource(handle); WebContents* tab_contents = controller->GetWebContents(); Browser* browser = Browser::GetBrowserForController(controller, NULL); browser->ShowCollectedCookiesDialog( @@ -626,7 +628,7 @@ void TestingAutomationProvider::NavigateToURLBlockUntilNavigationsComplete( int handle, const GURL& url, int number_of_navigations, IPC::Message* reply_message) { if (tab_tracker_->ContainsHandle(handle)) { - NavigationController* tab = tab_tracker_->GetResource(handle); + content::NavigationController* tab = tab_tracker_->GetResource(handle); // Simulate what a user would do. Activate the tab and then navigate. // We could allow navigating in a background tab in future. @@ -663,7 +665,7 @@ void TestingAutomationProvider::NavigationAsyncWithDisposition( *status = false; if (tab_tracker_->ContainsHandle(handle)) { - NavigationController* tab = tab_tracker_->GetResource(handle); + content::NavigationController* tab = tab_tracker_->GetResource(handle); // Simulate what a user would do. Activate the tab and then navigate. // We could allow navigating in a background tab in future. @@ -683,7 +685,7 @@ void TestingAutomationProvider::NavigationAsyncWithDisposition( void TestingAutomationProvider::Reload(int handle, IPC::Message* reply_message) { if (tab_tracker_->ContainsHandle(handle)) { - NavigationController* tab = tab_tracker_->GetResource(handle); + content::NavigationController* tab = tab_tracker_->GetResource(handle); Browser* browser = FindAndActivateTab(tab); if (browser && browser->command_updater()->IsCommandEnabled(IDC_RELOAD)) { new NavigationNotificationObserver( @@ -703,7 +705,7 @@ void TestingAutomationProvider::SetAuth(int tab_handle, const std::wstring& password, IPC::Message* reply_message) { if (tab_tracker_->ContainsHandle(tab_handle)) { - NavigationController* tab = tab_tracker_->GetResource(tab_handle); + content::NavigationController* tab = tab_tracker_->GetResource(tab_handle); LoginHandlerMap::iterator iter = login_handler_map_.find(tab); if (iter != login_handler_map_.end()) { @@ -726,7 +728,7 @@ void TestingAutomationProvider::SetAuth(int tab_handle, void TestingAutomationProvider::CancelAuth(int tab_handle, IPC::Message* reply_message) { if (tab_tracker_->ContainsHandle(tab_handle)) { - NavigationController* tab = tab_tracker_->GetResource(tab_handle); + content::NavigationController* tab = tab_tracker_->GetResource(tab_handle); LoginHandlerMap::iterator iter = login_handler_map_.find(tab); if (iter != login_handler_map_.end()) { @@ -748,7 +750,7 @@ void TestingAutomationProvider::NeedsAuth(int tab_handle, bool* needs_auth) { *needs_auth = false; if (tab_tracker_->ContainsHandle(tab_handle)) { - NavigationController* tab = tab_tracker_->GetResource(tab_handle); + content::NavigationController* tab = tab_tracker_->GetResource(tab_handle); LoginHandlerMap::iterator iter = login_handler_map_.find(tab); if (iter != login_handler_map_.end()) { @@ -764,7 +766,7 @@ void TestingAutomationProvider::GetRedirectsFrom(int tab_handle, if (redirect_query_) { LOG(ERROR) << "Can only handle one redirect query at once."; } else if (tab_tracker_->ContainsHandle(tab_handle)) { - NavigationController* tab = tab_tracker_->GetResource(tab_handle); + content::NavigationController* tab = tab_tracker_->GetResource(tab_handle); Profile* profile = Profile::FromBrowserContext(tab->GetBrowserContext()); HistoryService* history_service = profile->GetHistoryService(Profile::EXPLICIT_ACCESS); @@ -1284,7 +1286,7 @@ void TestingAutomationProvider::GetTabTitle(int handle, std::wstring* title) { *title_string_size = -1; // -1 is the error code if (tab_tracker_->ContainsHandle(handle)) { - NavigationController* tab = tab_tracker_->GetResource(handle); + content::NavigationController* tab = tab_tracker_->GetResource(handle); NavigationEntry* entry = tab->GetActiveEntry(); if (entry != NULL) { *title = UTF16ToWideHack(entry->GetTitleForDisplay("")); @@ -1299,7 +1301,7 @@ void TestingAutomationProvider::GetTabIndex(int handle, int* tabstrip_index) { *tabstrip_index = -1; // -1 is the error code if (tab_tracker_->ContainsHandle(handle)) { - NavigationController* tab = tab_tracker_->GetResource(handle); + content::NavigationController* tab = tab_tracker_->GetResource(handle); Browser* browser = Browser::GetBrowserForController(tab, NULL); *tabstrip_index = browser->tabstrip_model()->GetIndexOfController(tab); } @@ -1310,7 +1312,7 @@ void TestingAutomationProvider::GetTabURL(int handle, GURL* url) { *success = false; if (tab_tracker_->ContainsHandle(handle)) { - NavigationController* tab = tab_tracker_->GetResource(handle); + content::NavigationController* tab = tab_tracker_->GetResource(handle); // Return what the user would see in the location bar. *url = tab->GetActiveEntry()->GetVirtualURL(); *success = true; @@ -1399,7 +1401,7 @@ void TestingAutomationProvider::GetConstrainedWindowCount(int handle, int* count) { *count = -1; // -1 is the error code if (tab_tracker_->ContainsHandle(handle)) { - NavigationController* nav_controller = tab_tracker_->GetResource(handle); + content::NavigationController* nav_controller = tab_tracker_->GetResource(handle); WebContents* web_contents = nav_controller->GetWebContents(); if (web_contents) { TabContentsWrapper* wrapper = @@ -1429,7 +1431,7 @@ void TestingAutomationProvider::HandleInspectElementRequest( void TestingAutomationProvider::GetDownloadDirectory( int handle, FilePath* download_directory) { if (tab_tracker_->ContainsHandle(handle)) { - NavigationController* tab = tab_tracker_->GetResource(handle); + content::NavigationController* tab = tab_tracker_->GetResource(handle); DownloadManager* dlm = tab->GetBrowserContext()->GetDownloadManager(); *download_directory = DownloadPrefs::FromDownloadManager(dlm)->download_path(); @@ -1523,7 +1525,8 @@ void TestingAutomationProvider::ShowInterstitialPage( const std::string& html_text, IPC::Message* reply_message) { if (tab_tracker_->ContainsHandle(tab_handle)) { - NavigationController* controller = tab_tracker_->GetResource(tab_handle); + content::NavigationController* controller = + tab_tracker_->GetResource(tab_handle); WebContents* web_contents = controller->GetWebContents(); new NavigationNotificationObserver(controller, this, reply_message, 1, @@ -1556,7 +1559,7 @@ void TestingAutomationProvider::WaitForTabToBeRestored( int tab_handle, IPC::Message* reply_message) { if (tab_tracker_->ContainsHandle(tab_handle)) { - NavigationController* tab = tab_tracker_->GetResource(tab_handle); + content::NavigationController* tab = tab_tracker_->GetResource(tab_handle); restore_tracker_.reset( new NavigationControllerRestoredObserver(this, tab, reply_message)); } else { @@ -1573,7 +1576,7 @@ void TestingAutomationProvider::GetSecurityState( net::CertStatus* ssl_cert_status, int* insecure_content_status) { if (tab_tracker_->ContainsHandle(handle)) { - NavigationController* tab = tab_tracker_->GetResource(handle); + content::NavigationController* tab = tab_tracker_->GetResource(handle); NavigationEntry* entry = tab->GetActiveEntry(); *success = true; *security_style = entry->GetSSL().security_style; @@ -1592,7 +1595,7 @@ void TestingAutomationProvider::GetPageType( bool* success, content::PageType* page_type) { if (tab_tracker_->ContainsHandle(handle)) { - NavigationController* tab = tab_tracker_->GetResource(handle); + content::NavigationController* tab = tab_tracker_->GetResource(handle); NavigationEntry* entry = tab->GetActiveEntry(); *page_type = entry->GetPageType(); *success = true; @@ -1619,7 +1622,7 @@ void TestingAutomationProvider::ActionOnSSLBlockingPage( bool proceed, IPC::Message* reply_message) { if (tab_tracker_->ContainsHandle(handle)) { - NavigationController* tab = tab_tracker_->GetResource(handle); + content::NavigationController* tab = tab_tracker_->GetResource(handle); NavigationEntry* entry = tab->GetActiveEntry(); if (entry->GetPageType() == content::PAGE_TYPE_INTERSTITIAL) { WebContents* web_contents = tab->GetWebContents(); @@ -1670,7 +1673,7 @@ void TestingAutomationProvider::IsMenuCommandEnabled(int browser_handle, void TestingAutomationProvider::PrintNow(int tab_handle, IPC::Message* reply_message) { - NavigationController* tab = NULL; + content::NavigationController* tab = NULL; WebContents* web_contents = GetWebContentsForHandle(tab_handle, &tab); if (web_contents) { FindAndActivateTab(tab); @@ -1711,7 +1714,7 @@ void TestingAutomationProvider::SavePage(int tab_handle, return; } - NavigationController* nav = tab_tracker_->GetResource(tab_handle); + content::NavigationController* nav = tab_tracker_->GetResource(tab_handle); Browser* browser = FindAndActivateTab(nav); if (!browser->command_updater()->IsCommandEnabled(IDC_SAVE_PAGE)) { *success = false; @@ -1970,7 +1973,8 @@ void TestingAutomationProvider::RemoveBookmark(int handle, void TestingAutomationProvider::GetInfoBarCount(int handle, size_t* count) { *count = static_cast<size_t>(-1); // -1 means error. if (tab_tracker_->ContainsHandle(handle)) { - NavigationController* nav_controller = tab_tracker_->GetResource(handle); + content::NavigationController* nav_controller = + tab_tracker_->GetResource(handle); if (nav_controller) { TabContentsWrapper* wrapper = TabContentsWrapper::GetCurrentWrapperForContents( @@ -1987,7 +1991,8 @@ void TestingAutomationProvider::ClickInfoBarAccept( IPC::Message* reply_message) { bool success = false; if (tab_tracker_->ContainsHandle(handle)) { - NavigationController* nav_controller = tab_tracker_->GetResource(handle); + content::NavigationController* nav_controller = + tab_tracker_->GetResource(handle); if (nav_controller) { InfoBarTabHelper* infobar_helper = TabContentsWrapper::GetCurrentWrapperForContents( @@ -2026,7 +2031,7 @@ void TestingAutomationProvider::GetLastNavigationTime( void TestingAutomationProvider::WaitForNavigation(int handle, int64 last_navigation_time, IPC::Message* reply_message) { - NavigationController* controller = tab_tracker_->GetResource(handle); + content::NavigationController* controller = tab_tracker_->GetResource(handle); base::Time time(tab_tracker_->GetLastNavigationTime(handle)); if (time.ToInternalValue() > last_navigation_time || !controller) { @@ -2157,7 +2162,7 @@ void TestingAutomationProvider::WaitForAppModalDialogToBeShown( void TestingAutomationProvider::GoBackBlockUntilNavigationsComplete( int handle, int number_of_navigations, IPC::Message* reply_message) { if (tab_tracker_->ContainsHandle(handle)) { - NavigationController* tab = tab_tracker_->GetResource(handle); + content::NavigationController* tab = tab_tracker_->GetResource(handle); Browser* browser = FindAndActivateTab(tab); if (browser && browser->command_updater()->IsCommandEnabled(IDC_BACK)) { new NavigationNotificationObserver(tab, this, reply_message, @@ -2175,7 +2180,7 @@ void TestingAutomationProvider::GoBackBlockUntilNavigationsComplete( void TestingAutomationProvider::GoForwardBlockUntilNavigationsComplete( int handle, int number_of_navigations, IPC::Message* reply_message) { if (tab_tracker_->ContainsHandle(handle)) { - NavigationController* tab = tab_tracker_->GetResource(handle); + content::NavigationController* tab = tab_tracker_->GetResource(handle); Browser* browser = FindAndActivateTab(tab); if (browser && browser->command_updater()->IsCommandEnabled(IDC_FORWARD)) { new NavigationNotificationObserver(tab, this, reply_message, @@ -2218,7 +2223,8 @@ void TestingAutomationProvider::SetShelfVisibility(int handle, bool visible) { void TestingAutomationProvider::GetBlockedPopupCount(int handle, int* count) { *count = -1; // -1 is the error code if (tab_tracker_->ContainsHandle(handle)) { - NavigationController* nav_controller = tab_tracker_->GetResource(handle); + content::NavigationController* nav_controller = + tab_tracker_->GetResource(handle); TabContentsWrapper* tab_contents = TabContentsWrapper::GetCurrentWrapperForContents( nav_controller->GetWebContents()); @@ -6564,7 +6570,8 @@ void TestingAutomationProvider::WaitForInfoBarCount( return; } - NavigationController* controller = tab_tracker_->GetResource(tab_handle); + content::NavigationController* controller = + tab_tracker_->GetResource(tab_handle); if (!controller) { AutomationMsg_WaitForInfoBarCount::WriteReplyParams(reply_message_, false); Send(reply_message_); @@ -6581,7 +6588,7 @@ void TestingAutomationProvider::WaitForInfoBarCount( void TestingAutomationProvider::GetPageCurrentEncoding( int tab_handle, std::string* current_encoding) { if (tab_tracker_->ContainsHandle(tab_handle)) { - NavigationController* nav = tab_tracker_->GetResource(tab_handle); + content::NavigationController* nav = tab_tracker_->GetResource(tab_handle); Browser* browser = FindAndActivateTab(nav); if (browser->command_updater()->IsCommandEnabled(IDC_ENCODING_MENU)) *current_encoding = nav->GetWebContents()->GetEncoding(); @@ -6627,7 +6634,7 @@ void TestingAutomationProvider::LoadBlockedPlugins(int tab_handle, bool* success) { *success = false; if (tab_tracker_->ContainsHandle(tab_handle)) { - NavigationController* nav = tab_tracker_->GetResource(tab_handle); + content::NavigationController* nav = tab_tracker_->GetResource(tab_handle); if (!nav) return; WebContents* contents = nav->GetWebContents(); @@ -6653,7 +6660,8 @@ void TestingAutomationProvider::GetParentBrowserOfTab(int tab_handle, bool* success) { *success = false; if (tab_tracker_->ContainsHandle(tab_handle)) { - NavigationController* controller = tab_tracker_->GetResource(tab_handle); + content::NavigationController* controller = + tab_tracker_->GetResource(tab_handle); int index; Browser* browser = Browser::GetBrowserForController(controller, &index); if (browser) { diff --git a/chrome/browser/browser_focus_uitest.cc b/chrome/browser/browser_focus_uitest.cc index 0ecab77..fc59670 100644 --- a/chrome/browser/browser_focus_uitest.cc +++ b/chrome/browser/browser_focus_uitest.cc @@ -853,8 +853,8 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FocusOnReload) { { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( - &browser()->GetSelectedTabContentsWrapper()->tab_contents()-> + content::Source<content::NavigationController>( + &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController())); browser()->Reload(CURRENT_TAB); observer.Wait(); @@ -869,8 +869,8 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FocusOnReload) { { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( - &browser()->GetSelectedTabContentsWrapper()->tab_contents()-> + content::Source<content::NavigationController>( + &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController())); browser()->Reload(CURRENT_TAB); observer.Wait(); @@ -892,8 +892,8 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, DISABLED_FocusOnReloadCrashedTab) { { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( - &browser()->GetSelectedTabContentsWrapper()->tab_contents()-> + content::Source<content::NavigationController>( + &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController())); browser()->Reload(CURRENT_TAB); observer.Wait(); diff --git a/chrome/browser/browser_keyevents_browsertest.cc b/chrome/browser/browser_keyevents_browsertest.cc index 18f7c29..a3064b4 100644 --- a/chrome/browser/browser_keyevents_browsertest.cc +++ b/chrome/browser/browser_keyevents_browsertest.cc @@ -711,7 +711,8 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, MAYBE_ReservedAccelerators) { ASSERT_NO_FATAL_FAILURE(SuppressAllEvents(1, true)); ui_test_utils::WindowedNotificationObserver wait_for_tab_closed( - content::NOTIFICATION_TAB_CLOSED, content::Source<NavigationController>( + content::NOTIFICATION_TAB_CLOSED, + content::Source<content::NavigationController>( &browser()->GetTabContentsAt(1)->GetController())); // Press Ctrl/Cmd+W, which will close the tab. diff --git a/chrome/browser/chromeos/boot_times_loader.cc b/chrome/browser/chromeos/boot_times_loader.cc index f601332..44422ed 100644 --- a/chrome/browser/chromeos/boot_times_loader.cc +++ b/chrome/browser/chromeos/boot_times_loader.cc @@ -37,11 +37,11 @@ using content::WebContents; namespace { -RenderWidgetHost* GetRenderWidgetHost(NavigationController* tab) { - TabContents* tab_contents = tab->tab_contents(); - if (tab_contents) { +RenderWidgetHost* GetRenderWidgetHost(content::NavigationController* tab) { + WebContents* web_contents = tab->GetWebContents(); + if (web_contents) { RenderWidgetHostView* render_widget_host_view = - tab_contents->GetRenderWidgetHostView(); + web_contents->GetRenderWidgetHostView(); if (render_widget_host_view) return render_widget_host_view->GetRenderWidgetHost(); } @@ -440,8 +440,8 @@ void BootTimesLoader::Observe( break; } case content::NOTIFICATION_LOAD_START: { - NavigationController* tab = - content::Source<NavigationController>(source).ptr(); + content::NavigationController* tab = + content::Source<content::NavigationController>(source).ptr(); RenderWidgetHost* rwh = GetRenderWidgetHost(tab); DCHECK(rwh); AddLoginTimeMarker("TabLoad-Start: " + GetTabUrl(rwh), false); @@ -449,8 +449,8 @@ void BootTimesLoader::Observe( break; } case content::NOTIFICATION_LOAD_STOP: { - NavigationController* tab = - content::Source<NavigationController>(source).ptr(); + content::NavigationController* tab = + content::Source<content::NavigationController>(source).ptr(); RenderWidgetHost* rwh = GetRenderWidgetHost(tab); if (render_widget_hosts_loading_.find(rwh) != render_widget_hosts_loading_.end()) { diff --git a/chrome/browser/crash_recovery_browsertest.cc b/chrome/browser/crash_recovery_browsertest.cc index 0754059..13d5b75 100644 --- a/chrome/browser/crash_recovery_browsertest.cc +++ b/chrome/browser/crash_recovery_browsertest.cc @@ -50,8 +50,8 @@ IN_PROC_BROWSER_TEST_F(CrashRecoveryBrowserTest, Reload) { SimulateRendererCrash(browser()); ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( - &browser()->GetSelectedTabContentsWrapper()->tab_contents()-> + content::Source<content::NavigationController>( + &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController())); browser()->Reload(CURRENT_TAB); observer.Wait(); @@ -80,8 +80,8 @@ IN_PROC_BROWSER_TEST_F(CrashRecoveryBrowserTest, LoadInNewTab) { SimulateRendererCrash(browser()); ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( - &browser()->GetSelectedTabContentsWrapper()->tab_contents()-> + content::Source<content::NavigationController>( + &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController())); browser()->Reload(CURRENT_TAB); observer.Wait(); diff --git a/chrome/browser/debugger/devtools_sanity_unittest.cc b/chrome/browser/debugger/devtools_sanity_unittest.cc index 1279f02..bfafa5e 100644 --- a/chrome/browser/debugger/devtools_sanity_unittest.cc +++ b/chrome/browser/debugger/devtools_sanity_unittest.cc @@ -412,7 +412,7 @@ class WorkerDevToolsSanityTest : public InProcessBrowserTest { if (client_contents->IsLoading()) { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &client_contents->GetController())); observer.Wait(); } @@ -525,8 +525,8 @@ IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestReattachAfterCrash) { ui_test_utils::CrashTab(GetInspectedTab()); ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( - &browser()->GetSelectedTabContentsWrapper()->tab_contents()-> + content::Source<content::NavigationController>( + &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController())); browser()->Reload(CURRENT_TAB); observer.Wait(); diff --git a/chrome/browser/debugger/devtools_window.cc b/chrome/browser/debugger/devtools_window.cc index efa57fe..45e9e779 100644 --- a/chrome/browser/debugger/devtools_window.cc +++ b/chrome/browser/debugger/devtools_window.cc @@ -206,13 +206,13 @@ DevToolsWindow::DevToolsWindow(TabContentsWrapper* tab_contents, registrar_.Add( this, content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( - &tab_contents_->tab_contents()->GetController())); + content::Source<content::NavigationController>( + &tab_contents_->web_contents()->GetController())); registrar_.Add( this, content::NOTIFICATION_TAB_CLOSING, - content::Source<NavigationController>( - &tab_contents_->tab_contents()->GetController())); + content::Source<content::NavigationController>( + &tab_contents_->web_contents()->GetController())); registrar_.Add( this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, @@ -483,8 +483,8 @@ void DevToolsWindow::Observe(int type, DoAction(); AddDevToolsExtensionsToClient(); } else if (type == content::NOTIFICATION_TAB_CLOSING) { - if (content::Source<NavigationController>(source).ptr() == - &tab_contents_->tab_contents()->GetController()) { + if (content::Source<content::NavigationController>(source).ptr() == + &tab_contents_->web_contents()->GetController()) { // This happens when browser closes all of its tabs as a result // of window.Close event. // Notify manager that this DevToolsClientHost no longer exists and diff --git a/chrome/browser/download/download_request_limiter.cc b/chrome/browser/download/download_request_limiter.cc index fbc1746..372524b 100644 --- a/chrome/browser/download/download_request_limiter.cc +++ b/chrome/browser/download/download_request_limiter.cc @@ -35,7 +35,8 @@ DownloadRequestLimiter::TabDownloadState::TabDownloadState( status_(DownloadRequestLimiter::ALLOW_ONE_DOWNLOAD), download_count_(0), infobar_(NULL) { - content::Source<NavigationController> notification_source(controller); + content::Source<content::NavigationController> notification_source( + controller); registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_PENDING, notification_source); registrar_.Add(this, content::NOTIFICATION_TAB_CLOSED, notification_source); @@ -102,7 +103,8 @@ void DownloadRequestLimiter::TabDownloadState::Observe( const content::NotificationDetails& details) { if ((type != content::NOTIFICATION_NAV_ENTRY_PENDING && type != content::NOTIFICATION_TAB_CLOSED) || - content::Source<NavigationController>(source).ptr() != controller_) { + content::Source<content::NavigationController>(source).ptr() != + controller_) { NOTREACHED(); return; } diff --git a/chrome/browser/errorpage_browsertest.cc b/chrome/browser/errorpage_browsertest.cc index fec22f3..01dc31d 100644 --- a/chrome/browser/errorpage_browsertest.cc +++ b/chrome/browser/errorpage_browsertest.cc @@ -81,7 +81,7 @@ class ErrorPageTest : public InProcessBrowserTest { ASCIIToUTF16(expected_title)); TestNavigationObserver test_navigation_observer( - content::Source<NavigationController>( + content::Source<content::NavigationController>( &browser()->GetSelectedTabContentsWrapper()->tab_contents()-> GetController()), NULL, diff --git a/chrome/browser/extensions/app_process_apitest.cc b/chrome/browser/extensions/app_process_apitest.cc index c6f7575..a16e9d1 100644 --- a/chrome/browser/extensions/app_process_apitest.cc +++ b/chrome/browser/extensions/app_process_apitest.cc @@ -425,7 +425,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, DISABLED_ReloadIntoAppProcess) { EnableExtension(app->id()); ui_test_utils::WindowedNotificationObserver reload_observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &browser()->GetSelectedTabContentsWrapper()->tab_contents()-> GetController())); browser()->Reload(CURRENT_TAB); @@ -437,7 +437,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, DISABLED_ReloadIntoAppProcess) { DisableExtension(app->id()); ui_test_utils::WindowedNotificationObserver reload_observer2( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &browser()->GetSelectedTabContentsWrapper()->tab_contents()-> GetController())); browser()->Reload(CURRENT_TAB); @@ -449,7 +449,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, DISABLED_ReloadIntoAppProcess) { EnableExtension(app->id()); ui_test_utils::WindowedNotificationObserver js_reload_observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &browser()->GetSelectedTabContentsWrapper()->tab_contents()-> GetController())); ASSERT_TRUE(ui_test_utils::ExecuteJavaScript(contents->GetRenderViewHost(), @@ -462,7 +462,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, DISABLED_ReloadIntoAppProcess) { DisableExtension(app->id()); ui_test_utils::WindowedNotificationObserver js_reload_observer2( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &browser()->GetSelectedTabContentsWrapper()->tab_contents()-> GetController())); ASSERT_TRUE(ui_test_utils::ExecuteJavaScript(contents->GetRenderViewHost(), @@ -516,7 +516,8 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, OpenAppFromIframe) { // NAV_ENTRY_COMMITTED on the new tab there. ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<NavigationController>(&(newtab->GetController()))); + content::Source<content::NavigationController>( + &(newtab->GetController()))); observer.Wait(); } @@ -654,7 +655,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, ReloadAppAfterCrash) { ui_test_utils::CrashTab(browser()->GetSelectedWebContents()); ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &browser()->GetSelectedTabContentsWrapper()->tab_contents()-> GetController())); browser()->Reload(CURRENT_TAB); diff --git a/chrome/browser/extensions/extension_browser_event_router.cc b/chrome/browser/extensions/extension_browser_event_router.cc index ee72ab8..62d320c 100644 --- a/chrome/browser/extensions/extension_browser_event_router.cc +++ b/chrome/browser/extensions/extension_browser_event_router.cc @@ -149,7 +149,8 @@ void ExtensionBrowserEventRouter::RegisterForTabNotifications( WebContents* contents) { registrar_.Add( this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<NavigationController>(&contents->GetController())); + content::Source<content::NavigationController>( + &contents->GetController())); // Observing TAB_CONTENTS_DESTROYED is necessary because it's // possible for tabs to be created, detached and then destroyed without @@ -162,7 +163,8 @@ void ExtensionBrowserEventRouter::RegisterForTabNotifications( void ExtensionBrowserEventRouter::UnregisterForTabNotifications( WebContents* contents) { registrar_.Remove(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<NavigationController>(&contents->GetController())); + content::Source<content::NavigationController>( + &contents->GetController())); registrar_.Remove(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, content::Source<WebContents>(contents)); } @@ -540,14 +542,15 @@ void ExtensionBrowserEventRouter::Observe( const content::NotificationSource& source, const content::NotificationDetails& details) { if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) { - NavigationController* source_controller = - content::Source<NavigationController>(source).ptr(); + content::NavigationController* source_controller = + content::Source<content::NavigationController>(source).ptr(); TabUpdated(source_controller->GetWebContents(), true); } else if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { // Tab was destroyed after being detached (without being re-attached). WebContents* contents = content::Source<WebContents>(source).ptr(); registrar_.Remove(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<NavigationController>(&contents->GetController())); + content::Source<content::NavigationController>( + &contents->GetController())); registrar_.Remove(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, content::Source<WebContents>(contents)); } else if (type == chrome::NOTIFICATION_BROWSER_WINDOW_READY) { diff --git a/chrome/browser/extensions/extension_browsertests_misc.cc b/chrome/browser/extensions/extension_browsertests_misc.cc index 5450230..862ead2 100644 --- a/chrome/browser/extensions/extension_browsertests_misc.cc +++ b/chrome/browser/extensions/extension_browsertests_misc.cc @@ -812,7 +812,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, MAYBE_PluginLoadUnload) { { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &browser()->GetSelectedTabContentsWrapper()->tab_contents()-> GetController())); browser()->Reload(CURRENT_TAB); @@ -839,7 +839,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, MAYBE_PluginLoadUnload) { { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &browser()->GetSelectedTabContentsWrapper()->tab_contents()-> GetController())); browser()->Reload(CURRENT_TAB); diff --git a/chrome/browser/extensions/extension_crash_recovery_browsertest.cc b/chrome/browser/extensions/extension_crash_recovery_browsertest.cc index c9b3b10..a6d4a97 100644 --- a/chrome/browser/extensions/extension_crash_recovery_browsertest.cc +++ b/chrome/browser/extensions/extension_crash_recovery_browsertest.cc @@ -473,7 +473,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionCrashRecoveryTest, { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController())); browser()->Reload(CURRENT_TAB); diff --git a/chrome/browser/extensions/extension_navigation_observer.cc b/chrome/browser/extensions/extension_navigation_observer.cc index 5fed51a..18a4edf 100644 --- a/chrome/browser/extensions/extension_navigation_observer.cc +++ b/chrome/browser/extensions/extension_navigation_observer.cc @@ -28,8 +28,8 @@ void ExtensionNavigationObserver::Observe( return; } - NavigationController* controller = - content::Source<NavigationController>(source).ptr(); + content::NavigationController* controller = + content::Source<content::NavigationController>(source).ptr(); if (!profile_->IsSameProfile( Profile::FromBrowserContext(controller->GetBrowserContext()))) return; @@ -43,7 +43,7 @@ void ExtensionNavigationObserver::RegisterForNotifications() { } void ExtensionNavigationObserver::PromptToEnableExtensionIfNecessary( - NavigationController* nav_controller) { + content::NavigationController* nav_controller) { // Bail out if we're already running a prompt. if (!in_progress_prompt_extension_id_.empty()) return; @@ -80,7 +80,7 @@ void ExtensionNavigationObserver::InstallUIProceed() { ExtensionService* extension_service = profile_->GetExtensionService(); const Extension* extension = extension_service->GetExtensionById( in_progress_prompt_extension_id_, true); - NavigationController* nav_controller = + content::NavigationController* nav_controller = in_progress_prompt_navigation_controller_; CHECK(extension); CHECK(nav_controller); diff --git a/chrome/browser/extensions/extension_navigation_observer.h b/chrome/browser/extensions/extension_navigation_observer.h index 0bf09ef..5734e50 100644 --- a/chrome/browser/extensions/extension_navigation_observer.h +++ b/chrome/browser/extensions/extension_navigation_observer.h @@ -14,7 +14,10 @@ #include "content/public/browser/notification_registrar.h" class Profile; + +namespace content { class NavigationController; +} // The ExtensionNavigationObserver listens to navigation notifications. If the // user navigates into an extension that has been disabled due to a permission @@ -37,7 +40,8 @@ class ExtensionNavigationObserver : public ExtensionInstallUI::Delegate, // Checks if |nav_controller| has entered an extension's web extent. If it // has and the extension is disabled due to a permissions increase, this // prompts the user to accept the new permissions and enables the extension. - void PromptToEnableExtensionIfNecessary(NavigationController* nav_controller); + void PromptToEnableExtensionIfNecessary( + content::NavigationController* nav_controller); // ExtensionInstallUI::Delegate callbacks used for the permissions prompt. virtual void InstallUIProceed() OVERRIDE; @@ -52,7 +56,7 @@ class ExtensionNavigationObserver : public ExtensionInstallUI::Delegate, // The data we keep track of when prompting to enable extensions. std::string in_progress_prompt_extension_id_; - NavigationController* in_progress_prompt_navigation_controller_; + content::NavigationController* in_progress_prompt_navigation_controller_; // The extension ids we've already prompted the user about. std::set<std::string> prompted_extensions_; diff --git a/chrome/browser/extensions/extension_tabs_module.cc b/chrome/browser/extensions/extension_tabs_module.cc index 822f53a..10de472 100644 --- a/chrome/browser/extensions/extension_tabs_module.cc +++ b/chrome/browser/extensions/extension_tabs_module.cc @@ -1638,11 +1638,11 @@ bool DetectTabLanguageFunction::RunImpl() { content::Source<WebContents>(contents->web_contents())); registrar_.Add( this, content::NOTIFICATION_TAB_CLOSING, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &(contents->web_contents()->GetController()))); registrar_.Add( this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &(contents->web_contents()->GetController()))); return true; } diff --git a/chrome/browser/extensions/isolated_app_browsertest.cc b/chrome/browser/extensions/isolated_app_browsertest.cc index 2d115f3..7627bf7 100644 --- a/chrome/browser/extensions/isolated_app_browsertest.cc +++ b/chrome/browser/extensions/isolated_app_browsertest.cc @@ -118,7 +118,7 @@ IN_PROC_BROWSER_TEST_F(IsolatedAppTest, CookieIsolation) { ui_test_utils::CrashTab(tab1); ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &browser()->GetSelectedTabContentsWrapper()->tab_contents()-> GetController())); browser()->Reload(CURRENT_TAB); diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc index 019919d..e556937 100644 --- a/chrome/browser/external_tab_container_win.cc +++ b/chrome/browser/external_tab_container_win.cc @@ -202,13 +202,13 @@ bool ExternalTabContainer::Init(Profile* profile, } NavigationController* controller = - &tab_contents_->tab_contents()->GetController(); + &tab_contents_->web_contents()->GetController(); registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<NavigationController>(controller)); + content::Source<content::NavigationController>(controller)); registrar_.Add(this, content::NOTIFICATION_FAIL_PROVISIONAL_LOAD_WITH_ERROR, - content::Source<NavigationController>(controller)); + content::Source<content::NavigationController>(controller)); registrar_.Add(this, content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>(controller)); + content::Source<content::NavigationController>(controller)); registrar_.Add(this, content::NOTIFICATION_RENDER_VIEW_HOST_CREATED_FOR_TAB, content::Source<WebContents>(tab_contents_->web_contents())); registrar_.Add(this, content::NOTIFICATION_RENDER_VIEW_HOST_DELETED, @@ -251,15 +251,15 @@ void ExternalTabContainer::Uninitialize() { registrar_.RemoveAll(); if (tab_contents_.get()) { UnregisterRenderViewHost( - tab_contents_->tab_contents()->GetRenderViewHost()); + tab_contents_->web_contents()->GetRenderViewHost()); if (GetWidget()->GetRootView()) GetWidget()->GetRootView()->RemoveAllChildViews(true); content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTERNAL_TAB_CLOSED, - content::Source<NavigationController>( - &tab_contents_->tab_contents()->GetController()), + content::Source<content::NavigationController>( + &tab_contents_->web_contents()->GetController()), content::Details<ExternalTabContainer>(this)); tab_contents_.reset(NULL); diff --git a/chrome/browser/geolocation/geolocation_browsertest.cc b/chrome/browser/geolocation/geolocation_browsertest.cc index 1202c92..d756eb4 100644 --- a/chrome/browser/geolocation/geolocation_browsertest.cc +++ b/chrome/browser/geolocation/geolocation_browsertest.cc @@ -50,7 +50,7 @@ class IFrameLoader : public content::NotificationObserver { NavigationController* controller = &browser->GetSelectedWebContents()->GetController(); registrar_.Add(this, content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>(controller)); + content::Source<content::NavigationController>(controller)); registrar_.Add(this, chrome::NOTIFICATION_DOM_OPERATION_RESPONSE, content::NotificationService::AllSources()); std::string script = base::StringPrintf( @@ -325,7 +325,7 @@ class GeolocationBrowserTest : public InProcessBrowserTest { { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &tab_contents_wrapper->web_contents()->GetController())); if (allowed) infobar_->AsConfirmInfoBarDelegate()->Accept(); @@ -508,7 +508,7 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, Geoposition fresh_position = GeopositionFromLatLong(3.17, 4.23); ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( + content::Source<content::NavigationController>( ¤t_browser_->GetSelectedWebContents()->GetController())); NotifyGeoposition(fresh_position); observer.Wait(); @@ -545,7 +545,7 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, Geoposition cached_position = GeopositionFromLatLong(5.67, 8.09); ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( + content::Source<content::NavigationController>( ¤t_browser_->GetSelectedWebContents()->GetController())); NotifyGeoposition(cached_position); observer.Wait(); @@ -653,7 +653,7 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, TwoWatchesInOneFrame) { // its way through to the first watcher. ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( + content::Source<content::NavigationController>( ¤t_browser_->GetSelectedWebContents()->GetController())); NotifyGeoposition(final_position); observer.Wait(); diff --git a/chrome/browser/google/google_url_tracker.cc b/chrome/browser/google/google_url_tracker.cc index ae1c539..080f15f 100644 --- a/chrome/browser/google/google_url_tracker.cc +++ b/chrome/browser/google/google_url_tracker.cc @@ -323,8 +323,8 @@ void GoogleURLTracker::Observe(int type, const content::NotificationDetails& details) { switch (type) { case content::NOTIFICATION_NAV_ENTRY_PENDING: { - NavigationController* controller = - content::Source<NavigationController>(source).ptr(); + content::NavigationController* controller = + content::Source<content::NavigationController>(source).ptr(); OnNavigationPending(source, controller->GetPendingEntry()->GetURL()); break; } @@ -332,8 +332,8 @@ void GoogleURLTracker::Observe(int type, case content::NOTIFICATION_NAV_ENTRY_COMMITTED: case content::NOTIFICATION_TAB_CLOSED: OnNavigationCommittedOrTabClosed( - content::Source<NavigationController>(source).ptr()->GetWebContents(), - type); + content::Source<content::NavigationController>(source).ptr()-> + GetWebContents(), type); break; default: @@ -358,16 +358,16 @@ void GoogleURLTracker::SearchCommitted() { void GoogleURLTracker::OnNavigationPending( const content::NotificationSource& source, const GURL& pending_url) { - controller_ = content::Source<NavigationController>(source).ptr(); + controller_ = content::Source<content::NavigationController>(source).ptr(); search_url_ = pending_url; registrar_.Remove(this, content::NOTIFICATION_NAV_ENTRY_PENDING, content::NotificationService::AllSources()); // Start listening for the commit notification. We also need to listen for the // tab close command since that means the load will never commit. registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<NavigationController>(controller_)); + content::Source<content::NavigationController>(controller_)); registrar_.Add(this, content::NOTIFICATION_TAB_CLOSED, - content::Source<NavigationController>(controller_)); + content::Source<content::NavigationController>(controller_)); } void GoogleURLTracker::OnNavigationCommittedOrTabClosed( diff --git a/chrome/browser/google/google_url_tracker.h b/chrome/browser/google/google_url_tracker.h index f8ad46d..7c179bf 100644 --- a/chrome/browser/google/google_url_tracker.h +++ b/chrome/browser/google/google_url_tracker.h @@ -18,10 +18,10 @@ #include "googleurl/src/gurl.h" #include "net/base/network_change_notifier.h" -class NavigationController; class PrefService; namespace content { +class NavigationController; class WebContents; } @@ -149,7 +149,7 @@ class GoogleURLTracker : public content::URLFetcherDelegate, bool need_to_prompt_; // True if the last fetched Google URL is not // matched with current user's default Google URL // nor the last prompted Google URL. - NavigationController* controller_; + content::NavigationController* controller_; InfoBarDelegate* infobar_; GURL search_url_; diff --git a/chrome/browser/history/top_sites.cc b/chrome/browser/history/top_sites.cc index da7be4c..533525d 100644 --- a/chrome/browser/history/top_sites.cc +++ b/chrome/browser/history/top_sites.cc @@ -845,8 +845,8 @@ void TopSites::Observe(int type, } StartQueryForMostVisited(); } else if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) { - NavigationController* controller = - content::Source<NavigationController>(source).ptr(); + content::NavigationController* controller = + content::Source<content::NavigationController>(source).ptr(); Profile* profile = Profile::FromBrowserContext( controller->GetWebContents()->GetBrowserContext()); if (profile == profile_ && !IsFull()) { diff --git a/chrome/browser/infobars/infobar_tab_helper.cc b/chrome/browser/infobars/infobar_tab_helper.cc index 4dede23..fbe633e 100644 --- a/chrome/browser/infobars/infobar_tab_helper.cc +++ b/chrome/browser/infobars/infobar_tab_helper.cc @@ -9,6 +9,7 @@ #include "chrome/browser/tab_contents/insecure_content_infobar_delegate.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/render_messages.h" +#include "content/browser/tab_contents/navigation_controller.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/web_contents.h" @@ -57,7 +58,7 @@ void InfoBarTabHelper::AddInfoBar(InfoBarDelegate* delegate) { if (infobars_.size() == 1) { registrar_.Add( this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &web_contents()->GetController())); } } @@ -123,7 +124,7 @@ void InfoBarTabHelper::RemoveInfoBarInternal(InfoBarDelegate* delegate, if (infobars_.empty()) { registrar_.Remove( this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &web_contents()->GetController())); } } @@ -182,7 +183,7 @@ void InfoBarTabHelper::Observe(int type, switch (type) { case content::NOTIFICATION_NAV_ENTRY_COMMITTED: { DCHECK(&web_contents()->GetController() == - content::Source<NavigationController>(source).ptr()); + content::Source<content::NavigationController>(source).ptr()); content::LoadCommittedDetails& committed_details = *(content::Details<content::LoadCommittedDetails>(details).ptr()); diff --git a/chrome/browser/instant/instant_loader.cc b/chrome/browser/instant/instant_loader.cc index 43bf30b..0615225 100644 --- a/chrome/browser/instant/instant_loader.cc +++ b/chrome/browser/instant/instant_loader.cc @@ -296,7 +296,7 @@ InstantLoader::TabContentsDelegateImpl::TabContentsDelegateImpl( registrar_.Add(this, content::NOTIFICATION_INTERSTITIAL_ATTACHED, content::Source<WebContents>(loader->preview_contents()->web_contents())); registrar_.Add(this, content::NOTIFICATION_FAIL_PROVISIONAL_LOAD_WITH_ERROR, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &loader->preview_contents()->web_contents()->GetController())); } @@ -779,7 +779,7 @@ TabContentsWrapper* InstantLoader::ReleasePreviewContents( registrar_.Remove( this, content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &preview_contents_->web_contents()->GetController())); #endif } @@ -999,13 +999,13 @@ void InstantLoader::ReplacePreviewContents(TabContentsWrapper* old_tc, registrar_.Remove( this, content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &old_tc->web_contents()->GetController())); #endif registrar_.Remove( this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &old_tc->web_contents()->GetController())); // We prerendered so we should be ready to show. If we're ready, swap in @@ -1045,14 +1045,14 @@ void InstantLoader::SetupPreviewContents(TabContentsWrapper* tab_contents) { registrar_.Add( this, content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &preview_contents_->web_contents()->GetController())); #endif registrar_.Add( this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &preview_contents_->web_contents()->GetController())); gfx::Rect tab_bounds; diff --git a/chrome/browser/omnibox_search_hint.cc b/chrome/browser/omnibox_search_hint.cc index 8762d61..dc6725f 100644 --- a/chrome/browser/omnibox_search_hint.cc +++ b/chrome/browser/omnibox_search_hint.cc @@ -154,11 +154,12 @@ bool HintInfoBar::Accept() { // OmniboxSearchHint ---------------------------------------------------------- OmniboxSearchHint::OmniboxSearchHint(TabContentsWrapper* tab) : tab_(tab) { - NavigationController* controller = &(tab->tab_contents()->GetController()); + content::NavigationController* controller = + &(tab->web_contents()->GetController()); notification_registrar_.Add( this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<NavigationController>(controller)); + content::Source<content::NavigationController>(controller)); // Fill the search_engine_urls_ map, used for faster look-up (overkill?). for (size_t i = 0; i < arraysize(kSearchEngineURLs); ++i) search_engine_urls_[kSearchEngineURLs[i]] = 1; @@ -176,8 +177,8 @@ void OmniboxSearchHint::Observe(int type, const content::NotificationSource& source, const content::NotificationDetails& details) { if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) { - NavigationEntry* entry = - tab_->tab_contents()->GetController().GetActiveEntry(); + content::NavigationEntry* entry = + tab_->web_contents()->GetController().GetActiveEntry(); if (search_engine_urls_.find(entry->GetURL().spec()) == search_engine_urls_.end()) { // The search engine is not in our white-list, bail. diff --git a/chrome/browser/prerender/prerender_browsertest.cc b/chrome/browser/prerender/prerender_browsertest.cc index 063effd..d186c27 100644 --- a/chrome/browser/prerender/prerender_browsertest.cc +++ b/chrome/browser/prerender/prerender_browsertest.cc @@ -587,7 +587,7 @@ class PrerenderBrowserTest : public InProcessBrowserTest { EXPECT_FALSE(tab->IsLoading()); ui_test_utils::WindowedNotificationObserver back_nav_observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>(&tab->GetController())); + content::Source<content::NavigationController>(&tab->GetController())); browser->GoBack(CURRENT_TAB); back_nav_observer.Wait(); bool js_result; @@ -766,7 +766,7 @@ class PrerenderBrowserTest : public InProcessBrowserTest { page_load_observer.reset( new ui_test_utils::WindowedNotificationObserver( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &tab_contents->GetController()))); } diff --git a/chrome/browser/printing/print_dialog_cloud.cc b/chrome/browser/printing/print_dialog_cloud.cc index d0c5b92..afa4c16 100644 --- a/chrome/browser/printing/print_dialog_cloud.cc +++ b/chrome/browser/printing/print_dialog_cloud.cc @@ -311,7 +311,7 @@ void CloudPrintFlowHandler::RegisterMessages() { CloudPrintURL(profile).GetCloudPrintServiceDialogURL()); } registrar_.Add(this, content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>(controller)); + content::Source<content::NavigationController>(controller)); } void CloudPrintFlowHandler::Observe( diff --git a/chrome/browser/printing/print_preview_tab_controller.cc b/chrome/browser/printing/print_preview_tab_controller.cc index a95f42d..16143e4 100644 --- a/chrome/browser/printing/print_preview_tab_controller.cc +++ b/chrome/browser/printing/print_preview_tab_controller.cc @@ -222,8 +222,8 @@ void PrintPreviewTabController::Observe( break; } case content::NOTIFICATION_NAV_ENTRY_COMMITTED: { - NavigationController* controller = - content::Source<NavigationController>(source).ptr(); + content::NavigationController* controller = + content::Source<content::NavigationController>(source).ptr(); TabContentsWrapper* wrapper = TabContentsWrapper::GetCurrentWrapperForContents( controller->GetWebContents()); @@ -416,7 +416,8 @@ void PrintPreviewTabController::AddObservers(TabContentsWrapper* tab) { content::Source<WebContents>(contents)); registrar_.Add( this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<NavigationController>(&contents->GetController())); + content::Source<content::NavigationController>( + &contents->GetController())); // Multiple sites may share the same RenderProcessHost, so check if this // notification has already been added. @@ -436,7 +437,8 @@ void PrintPreviewTabController::RemoveObservers(TabContentsWrapper* tab) { content::Source<WebContents>(contents)); registrar_.Remove( this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<NavigationController>(&contents->GetController())); + content::Source<content::NavigationController>( + &contents->GetController())); // Multiple sites may share the same RenderProcessHost, so check if this // notification has already been added. diff --git a/chrome/browser/repost_form_warning_controller.cc b/chrome/browser/repost_form_warning_controller.cc index b7a49ad..36f7b30 100644 --- a/chrome/browser/repost_form_warning_controller.cc +++ b/chrome/browser/repost_form_warning_controller.cc @@ -24,7 +24,8 @@ RepostFormWarningController::RepostFormWarningController( : TabModalConfirmDialogDelegate(web_contents), navigation_controller_(&web_contents->GetController()) { registrar_.Add(this, content::NOTIFICATION_REPOST_WARNING_SHOWN, - content::Source<NavigationController>(navigation_controller_)); + content::Source<content::NavigationController>( + navigation_controller_)); } RepostFormWarningController::~RepostFormWarningController() { diff --git a/chrome/browser/rlz/rlz.cc b/chrome/browser/rlz/rlz.cc index 49f8087..5259ae9 100644 --- a/chrome/browser/rlz/rlz.cc +++ b/chrome/browser/rlz/rlz.cc @@ -307,7 +307,7 @@ void RLZTracker::Observe(int type, break; case content::NOTIFICATION_NAV_ENTRY_PENDING: { const NavigationEntry* entry = - content::Details<NavigationEntry>(details).ptr(); + content::Details<content::NavigationEntry>(details).ptr(); if (entry != NULL && ((entry->GetTransitionType() & content::PAGE_TRANSITION_HOME_PAGE) != 0)) { diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc index a59d801..51bbad2 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc @@ -21,6 +21,7 @@ #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" #include "content/browser/renderer_host/resource_dispatcher_host.h" +#include "content/browser/tab_contents/navigation_controller.h" #include "content/browser/tab_contents/tab_contents_view.h" #include "content/public/browser/web_contents.h" #include "content/test/test_browser_thread.h" @@ -429,7 +430,7 @@ IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageTest, MalwareProceed) { ui_test_utils::NavigateToURL(browser(), url); ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController())); SendCommand("\"proceed\""); // Simulate the user clicking "proceed" @@ -461,7 +462,7 @@ IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageTest, PhishingProceed) { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController())); SendCommand("\"proceed\""); // Simulate the user clicking "proceed". @@ -480,7 +481,7 @@ IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageTest, PhishingReportError) { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController())); SendCommand("\"reportError\""); // Simulate the user clicking "report error" @@ -503,7 +504,7 @@ IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageTest, ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController())); SendCommand("\"learnMore\""); // Simulate the user clicking "learn more" @@ -526,7 +527,7 @@ IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageTest, MalwareIframeDontProceed) { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController())); SendCommand("\"takeMeBack\""); // Simulate the user clicking "back" diff --git a/chrome/browser/sessions/session_restore.cc b/chrome/browser/sessions/session_restore.cc index 652288c..5044040 100644 --- a/chrome/browser/sessions/session_restore.cc +++ b/chrome/browser/sessions/session_restore.cc @@ -81,8 +81,8 @@ class TabLoader : public content::NotificationObserver, void StartLoading(); private: - typedef std::set<NavigationController*> TabsLoading; - typedef std::list<NavigationController*> TabsToLoad; + typedef std::set<content::NavigationController*> TabsLoading; + typedef std::list<content::NavigationController*> TabsToLoad; typedef std::set<RenderWidgetHost*> RenderWidgetHostSet; // Loads the next tab. If there are no more tabs to load this deletes itself, @@ -101,7 +101,7 @@ class TabLoader : public content::NotificationObserver, // Removes the listeners from the specified tab and removes the tab from // the set of tabs to load and list of tabs we're waiting to get a load // from. - void RemoveTab(NavigationController* tab); + void RemoveTab(content::NavigationController* tab); // Invoked from |force_load_timer_|. Doubles |force_load_delay_| and invokes // |LoadNextTab| to load the next tab @@ -109,13 +109,14 @@ class TabLoader : public content::NotificationObserver, // Returns the RenderWidgetHost associated with a tab if there is one, // NULL otherwise. - static RenderWidgetHost* GetRenderWidgetHost(NavigationController* tab); + static RenderWidgetHost* GetRenderWidgetHost( + content::NavigationController* tab); // Register for necessary notificaitons on a tab navigation controller. - void RegisterForNotifications(NavigationController* controller); + void RegisterForNotifications(content::NavigationController* controller); // Called when a tab goes away or a load completes. - void HandleTabClosedOrLoaded(NavigationController* controller); + void HandleTabClosedOrLoaded(content::NavigationController* controller); content::NotificationRegistrar registrar_; @@ -204,7 +205,7 @@ void TabLoader::StartLoading() { void TabLoader::LoadNextTab() { if (!tabs_to_load_.empty()) { - NavigationController* tab = tabs_to_load_.front(); + content::NavigationController* tab = tabs_to_load_.front(); DCHECK(tab); tabs_loading_.insert(tab); tabs_to_load_.pop_front(); @@ -243,8 +244,8 @@ void TabLoader::Observe(int type, // Add this render_widget_host to the set of those we're waiting for // paints on. We want to only record stats for paints that occur after // a load has finished. - NavigationController* tab = - content::Source<NavigationController>(source).ptr(); + content::NavigationController* tab = + content::Source<content::NavigationController>(source).ptr(); RenderWidgetHost* render_widget_host = GetRenderWidgetHost(tab); DCHECK(render_widget_host); render_widget_hosts_loading_.insert(render_widget_host); @@ -261,8 +262,8 @@ void TabLoader::Observe(int type, break; } case content::NOTIFICATION_LOAD_STOP: { - NavigationController* tab = - content::Source<NavigationController>(source).ptr(); + content::NavigationController* tab = + content::Source<content::NavigationController>(source).ptr(); render_widget_hosts_to_paint_.insert(GetRenderWidgetHost(tab)); HandleTabClosedOrLoaded(tab); break; @@ -327,13 +328,13 @@ void TabLoader::OnOnlineStateChanged(bool online) { } } -void TabLoader::RemoveTab(NavigationController* tab) { +void TabLoader::RemoveTab(content::NavigationController* tab) { registrar_.Remove(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, content::Source<WebContents>(tab->GetWebContents())); registrar_.Remove(this, content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>(tab)); + content::Source<content::NavigationController>(tab)); registrar_.Remove(this, content::NOTIFICATION_LOAD_START, - content::Source<NavigationController>(tab)); + content::Source<content::NavigationController>(tab)); TabsLoading::iterator i = tabs_loading_.find(tab); if (i != tabs_loading_.end()) @@ -350,7 +351,8 @@ void TabLoader::ForceLoadTimerFired() { LoadNextTab(); } -RenderWidgetHost* TabLoader::GetRenderWidgetHost(NavigationController* tab) { +RenderWidgetHost* TabLoader::GetRenderWidgetHost( + content::NavigationController* tab) { WebContents* web_contents = tab->GetWebContents(); if (web_contents) { RenderWidgetHostView* render_widget_host_view = @@ -361,17 +363,18 @@ RenderWidgetHost* TabLoader::GetRenderWidgetHost(NavigationController* tab) { return NULL; } -void TabLoader::RegisterForNotifications(NavigationController* controller) { +void TabLoader::RegisterForNotifications( + content::NavigationController* controller) { registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, content::Source<WebContents>(controller->GetWebContents())); registrar_.Add(this, content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>(controller)); + content::Source<content::NavigationController>(controller)); registrar_.Add(this, content::NOTIFICATION_LOAD_START, - content::Source<NavigationController>(controller)); + content::Source<content::NavigationController>(controller)); ++tab_count_; } -void TabLoader::HandleTabClosedOrLoaded(NavigationController* tab) { +void TabLoader::HandleTabClosedOrLoaded(content::NavigationController* tab) { RemoveTab(tab); if (loading_) LoadNextTab(); diff --git a/chrome/browser/sessions/session_service.cc b/chrome/browser/sessions/session_service.cc index 5325ee3..5d3c6c6 100644 --- a/chrome/browser/sessions/session_service.cc +++ b/chrome/browser/sessions/session_service.cc @@ -533,7 +533,7 @@ void SessionService::Observe(int type, case content::NOTIFICATION_TAB_CLOSED: { TabContentsWrapper* tab = TabContentsWrapper::GetCurrentWrapperForContents( - content::Source<NavigationController>( + content::Source<content::NavigationController>( source).ptr()->GetWebContents()); if (!tab || tab->profile() != profile()) return; @@ -548,7 +548,7 @@ void SessionService::Observe(int type, case content::NOTIFICATION_NAV_LIST_PRUNED: { TabContentsWrapper* tab = TabContentsWrapper::GetCurrentWrapperForContents( - content::Source<NavigationController>( + content::Source<content::NavigationController>( source).ptr()->GetWebContents()); if (!tab || tab->profile() != profile()) return; @@ -572,7 +572,7 @@ void SessionService::Observe(int type, case content::NOTIFICATION_NAV_ENTRY_CHANGED: { TabContentsWrapper* tab = TabContentsWrapper::GetCurrentWrapperForContents( - content::Source<NavigationController>( + content::Source<content::NavigationController>( source).ptr()->GetWebContents()); if (!tab || tab->profile() != profile()) return; @@ -587,7 +587,7 @@ void SessionService::Observe(int type, case content::NOTIFICATION_NAV_ENTRY_COMMITTED: { TabContentsWrapper* tab = TabContentsWrapper::GetCurrentWrapperForContents( - content::Source<NavigationController>( + content::Source<content::NavigationController>( source).ptr()->GetWebContents()); if (!tab || tab->profile() != profile()) return; diff --git a/chrome/browser/sidebar/sidebar_browsertest.cc b/chrome/browser/sidebar/sidebar_browsertest.cc index 914ee30..3237d1f 100644 --- a/chrome/browser/sidebar/sidebar_browsertest.cc +++ b/chrome/browser/sidebar/sidebar_browsertest.cc @@ -77,7 +77,7 @@ class SidebarTest : public ExtensionBrowserTest { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &client_contents->GetController())); sidebar_manager->NavigateSidebar(tab, content_id_, url); observer.Wait(); diff --git a/chrome/browser/ssl/ssl_blocking_page.cc b/chrome/browser/ssl/ssl_blocking_page.cc index d2b3597..453d197 100644 --- a/chrome/browser/ssl/ssl_blocking_page.cc +++ b/chrome/browser/ssl/ssl_blocking_page.cc @@ -124,7 +124,7 @@ void SSLBlockingPage::UpdateEntry(NavigationEntry* entry) { entry->GetSSL().security_bits = ssl_info.security_bits; content::NotificationService::current()->Notify( content::NOTIFICATION_SSL_VISIBLE_STATE_CHANGED, - content::Source<NavigationController>(&tab()->GetController()), + content::Source<content::NavigationController>(&tab()->GetController()), content::NotificationService::NoDetails()); } diff --git a/chrome/browser/ssl/ssl_browser_tests.cc b/chrome/browser/ssl/ssl_browser_tests.cc index 24d1e25..77e0d3a 100644 --- a/chrome/browser/ssl/ssl_browser_tests.cc +++ b/chrome/browser/ssl/ssl_browser_tests.cc @@ -141,7 +141,7 @@ class SSLUITest : public InProcessBrowserTest { ASSERT_TRUE(interstitial_page); ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>(&tab->GetController())); + content::Source<content::NavigationController>(&tab->GetController())); interstitial_page->Proceed(); observer.Wait(); } @@ -450,7 +450,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestHTTPSExpiredCertAndGoForward) { { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>(&tab->GetController())); + content::Source<content::NavigationController>(&tab->GetController())); tab->GetController().GoBack(); observer.Wait(); } @@ -468,7 +468,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestHTTPSExpiredCertAndGoForward) { { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>(&tab->GetController())); + content::Source<content::NavigationController>(&tab->GetController())); tab->GetController().GoToOffset(1); observer.Wait(); } @@ -1052,7 +1052,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestGoodFrameNavigation) { { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>(&tab->GetController())); + content::Source<content::NavigationController>(&tab->GetController())); EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( tab->GetRenderViewHost(), std::wstring(), L"window.domAutomationController.send(clickLink('goodHTTPSLink'));", @@ -1068,7 +1068,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestGoodFrameNavigation) { { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>(&tab->GetController())); + content::Source<content::NavigationController>(&tab->GetController())); EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( tab->GetRenderViewHost(), std::wstring(), L"window.domAutomationController.send(clickLink('badHTTPSLink'));", @@ -1094,7 +1094,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestGoodFrameNavigation) { { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>(&tab->GetController())); + content::Source<content::NavigationController>(&tab->GetController())); tab->GetController().GoBack(); observer.Wait(); } @@ -1104,7 +1104,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestGoodFrameNavigation) { { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>(&tab->GetController())); + content::Source<content::NavigationController>(&tab->GetController())); EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( tab->GetRenderViewHost(), std::wstring(), L"window.domAutomationController.send(clickLink('HTTPLink'));", @@ -1120,7 +1120,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestGoodFrameNavigation) { { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>(&tab->GetController())); + content::Source<content::NavigationController>(&tab->GetController())); tab->GetController().GoBack(); observer.Wait(); } @@ -1152,7 +1152,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestBadFrameNavigation) { bool success = false; ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>(&tab->GetController())); + content::Source<content::NavigationController>(&tab->GetController())); EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( tab->GetRenderViewHost(), std::wstring(), L"window.domAutomationController.send(clickLink('goodHTTPSLink'));", @@ -1189,7 +1189,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestUnauthenticatedFrameNavigation) { bool success = false; ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>(&tab->GetController())); + content::Source<content::NavigationController>(&tab->GetController())); EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( tab->GetRenderViewHost(), std::wstring(), L"window.domAutomationController.send(clickLink('goodHTTPSLink'));", @@ -1206,7 +1206,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestUnauthenticatedFrameNavigation) { bool success = false; ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>(&tab->GetController())); + content::Source<content::NavigationController>(&tab->GetController())); EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( tab->GetRenderViewHost(), std::wstring(), L"window.domAutomationController.send(clickLink('badHTTPSLink'));", diff --git a/chrome/browser/sync/glue/session_change_processor.cc b/chrome/browser/sync/glue/session_change_processor.cc index a0e2f63..6402708 100644 --- a/chrome/browser/sync/glue/session_change_processor.cc +++ b/chrome/browser/sync/glue/session_change_processor.cc @@ -38,7 +38,8 @@ namespace { SyncedTabDelegate* ExtractSyncedTabDelegate( const content::NotificationSource& source) { TabContentsWrapper* tab = TabContentsWrapper::GetCurrentWrapperForContents( - content::Source<NavigationController>(source).ptr()->GetWebContents()); + content::Source<content::NavigationController>(source).ptr()-> + GetWebContents()); if (!tab) return NULL; return tab->synced_tab_delegate(); diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc index 53319d8..212d763 100644 --- a/chrome/browser/tabs/tab_strip_model.cc +++ b/chrome/browser/tabs/tab_strip_model.cc @@ -388,7 +388,7 @@ int TabStripModel::GetWrapperIndex(const WebContents* contents) const { } int TabStripModel::GetIndexOfController( - const NavigationController* controller) const { + const content::NavigationController* controller) const { int index = 0; TabContentsDataVector::const_iterator iter = contents_data_.begin(); for (; iter != contents_data_.end(); ++iter, ++index) { diff --git a/chrome/browser/tabs/tab_strip_model.h b/chrome/browser/tabs/tab_strip_model.h index 4ef4c75..1a98314 100644 --- a/chrome/browser/tabs/tab_strip_model.h +++ b/chrome/browser/tabs/tab_strip_model.h @@ -23,6 +23,7 @@ class TabStripModelDelegate; class TabStripModelOrderController; namespace content { +class NavigationController; class WebContents; } @@ -276,7 +277,8 @@ class TabStripModel : public content::NotificationObserver { // Returns the index of the specified NavigationController, or kNoTab if it is // not in this TabStripModel. - int GetIndexOfController(const NavigationController* controller) const; + int GetIndexOfController( + const content::NavigationController* controller) const; // Notify any observers that the TabContents at the specified index has // changed in some way. See TabChangeType for details of |change_type|. diff --git a/chrome/browser/translate/translate_manager.cc b/chrome/browser/translate/translate_manager.cc index ef5e257..d704de6 100644 --- a/chrome/browser/translate/translate_manager.cc +++ b/chrome/browser/translate/translate_manager.cc @@ -261,8 +261,8 @@ void TranslateManager::Observe(int type, const content::NotificationDetails& details) { switch (type) { case content::NOTIFICATION_NAV_ENTRY_COMMITTED: { - NavigationController* controller = - content::Source<NavigationController>(source).ptr(); + content::NavigationController* controller = + content::Source<content::NavigationController>(source).ptr(); content::LoadCommittedDetails* load_details = content::Details<content::LoadCommittedDetails>(details).ptr(); NavigationEntry* entry = controller->GetActiveEntry(); diff --git a/chrome/browser/translate/translate_manager_browsertest.cc b/chrome/browser/translate/translate_manager_browsertest.cc index 13d2235..66ef4d7 100644 --- a/chrome/browser/translate/translate_manager_browsertest.cc +++ b/chrome/browser/translate/translate_manager_browsertest.cc @@ -268,7 +268,7 @@ class NavEntryCommittedObserver : public content::NotificationObserver { public: explicit NavEntryCommittedObserver(TabContents* tab_contents) { registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &tab_contents->GetController())); } diff --git a/chrome/browser/ui/auto_login_prompter.cc b/chrome/browser/ui/auto_login_prompter.cc index 24c70b6..4922dd9 100644 --- a/chrome/browser/ui/auto_login_prompter.cc +++ b/chrome/browser/ui/auto_login_prompter.cc @@ -226,7 +226,7 @@ AutoLoginPrompter::AutoLoginPrompter( username_(username), args_(args) { registrar_.Add(this, content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &web_contents_->GetController())); registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, content::Source<WebContents>(web_contents_)); diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index 796f469..1180727 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -1179,7 +1179,7 @@ int Browser::active_index() const { } int Browser::GetIndexOfController( - const NavigationController* controller) const { + const content::NavigationController* controller) const { return tab_handler_->GetTabStripModel()->GetIndexOfController(controller); } @@ -2528,7 +2528,7 @@ bool Browser::RunUnloadEventsHelper(TabContents* contents) { // static Browser* Browser::GetBrowserForController( - const NavigationController* controller, int* index_result) { + const content::NavigationController* controller, int* index_result) { BrowserList::const_iterator it; for (it = BrowserList::begin(); it != BrowserList::end(); ++it) { int index = (*it)->tab_handler_->GetTabStripModel()->GetIndexOfController( @@ -3280,8 +3280,8 @@ void Browser::TabClosingAt(TabStripModel* tab_strip_model, fullscreen_controller_->OnTabClosing(contents->tab_contents()); content::NotificationService::current()->Notify( content::NOTIFICATION_TAB_CLOSING, - content::Source<NavigationController>( - &contents->tab_contents()->GetController()), + content::Source<content::NavigationController>( + &contents->web_contents()->GetController()), content::NotificationService::NoDetails()); // Sever the TabContents' connection back to us. @@ -4116,7 +4116,7 @@ void Browser::Observe(int type, // closing of this one. if (GetSelectedWebContents() && &GetSelectedWebContents()->GetController() == - content::Source<NavigationController>(source).ptr()) + content::Source<content::NavigationController>(source).ptr()) UpdateToolbar(false); break; diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h index 62a8f14..2afe9f5 100644 --- a/chrome/browser/ui/browser.h +++ b/chrome/browser/ui/browser.h @@ -69,6 +69,11 @@ class StatusBubble; class TabNavigation; class TabStripModel; struct WebApplicationInfo; + +namespace content { +class NavigationController; +} + namespace gfx { class Point; } @@ -383,7 +388,8 @@ class Browser : public TabHandlerDelegate, int tab_count() const; int active_index() const; - int GetIndexOfController(const NavigationController* controller) const; + int GetIndexOfController( + const content::NavigationController* controller) const; // TODO(dpapad): Rename to GetActiveTabContentsWrapper(). TabContentsWrapper* GetSelectedTabContentsWrapper() const; @@ -670,7 +676,7 @@ class Browser : public TabHandlerDelegate, // Returns NULL if not found. // This call is O(N) in the number of tabs. static Browser* GetBrowserForController( - const NavigationController* controller, int* index); + const content::NavigationController* controller, int* index); // Retrieve the last active tabbed browser with a profile matching |profile|. static Browser* GetTabbedBrowser(Profile* profile, bool match_incognito); diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc index 50b2350..d762406 100644 --- a/chrome/browser/ui/browser_browsertest.cc +++ b/chrome/browser/ui/browser_browsertest.cc @@ -1158,7 +1158,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, ForwardDisabledOnForward) { ui_test_utils::WindowedNotificationObserver back_nav_load_observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &browser()->GetSelectedWebContents()->GetController())); browser()->GoBack(CURRENT_TAB); back_nav_load_observer.Wait(); @@ -1166,7 +1166,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, ForwardDisabledOnForward) { ui_test_utils::WindowedNotificationObserver forward_nav_load_observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &browser()->GetSelectedWebContents()->GetController())); browser()->GoForward(CURRENT_TAB); // This check will happen before the navigation completes, since the browser diff --git a/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm b/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm index fd6f74e..43d0257 100644 --- a/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm +++ b/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm @@ -68,7 +68,8 @@ void TabContentsNotificationBridge::ChangeWebContents(WebContents* contents) { registrar_.Add( this, content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED, - content::Source<NavigationController>(&contents->GetController())); + content::Source<content::NavigationController>( + &contents->GetController())); } } diff --git a/chrome/browser/ui/find_bar/find_bar_controller.cc b/chrome/browser/ui/find_bar/find_bar_controller.cc index 3f3220a..41a1646 100644 --- a/chrome/browser/ui/find_bar/find_bar_controller.cc +++ b/chrome/browser/ui/find_bar/find_bar_controller.cc @@ -94,8 +94,8 @@ void FindBarController::ChangeTabContents(TabContentsWrapper* contents) { registrar_.Add( this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<NavigationController>( - &tab_contents_->tab_contents()->GetController())); + content::Source<content::NavigationController>( + &tab_contents_->web_contents()->GetController())); MaybeSetPrepopulateText(); @@ -133,9 +133,9 @@ void FindBarController::Observe(int type, } } } else if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) { - NavigationController* source_controller = - content::Source<NavigationController>(source).ptr(); - if (source_controller == &tab_contents_->tab_contents()->GetController()) { + content::NavigationController* source_controller = + content::Source<content::NavigationController>(source).ptr(); + if (source_controller == &tab_contents_->web_contents()->GetController()) { content::LoadCommittedDetails* commit_details = content::Details<content::LoadCommittedDetails>(details).ptr(); content::PageTransition transition_type = diff --git a/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc b/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc index a77db9c..994ebbc 100644 --- a/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc +++ b/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc @@ -587,7 +587,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindDisappearOnNavigate) { // Reload the tab and make sure Find window doesn't go away. ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &browser()->GetSelectedTabContentsWrapper()->tab_contents()-> GetController())); browser()->Reload(CURRENT_TAB); @@ -1114,7 +1114,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, ActivateLinkNavigatesPage) { // End the find session, click on the link. ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &tab->tab_contents()->GetController())); tab->find_tab_helper()->StopFinding(FindBarController::kActivateSelection); observer.Wait(); diff --git a/chrome/browser/ui/intents/web_intent_picker_controller.cc b/chrome/browser/ui/intents/web_intent_picker_controller.cc index d71479b..c370e1a 100644 --- a/chrome/browser/ui/intents/web_intent_picker_controller.cc +++ b/chrome/browser/ui/intents/web_intent_picker_controller.cc @@ -118,9 +118,9 @@ WebIntentPickerController::WebIntentPickerController( service_tab_(NULL) { NavigationController* controller = &wrapper->tab_contents()->GetController(); registrar_.Add(this, content::NOTIFICATION_LOAD_START, - content::Source<NavigationController>(controller)); + content::Source<content::NavigationController>(controller)); registrar_.Add(this, content::NOTIFICATION_TAB_CLOSING, - content::Source<NavigationController>(controller)); + content::Source<content::NavigationController>(controller)); } WebIntentPickerController::~WebIntentPickerController() { diff --git a/chrome/browser/ui/login/login_prompt.cc b/chrome/browser/ui/login/login_prompt.cc index 09c76f9..6162be2 100644 --- a/chrome/browser/ui/login/login_prompt.cc +++ b/chrome/browser/ui/login/login_prompt.cc @@ -287,7 +287,7 @@ void LoginHandler::NotifyAuthNeeded() { LoginNotificationDetails details(this); service->Notify(chrome::NOTIFICATION_AUTH_NEEDED, - content::Source<NavigationController>(controller), + content::Source<content::NavigationController>(controller), content::Details<LoginNotificationDetails>(&details)); } @@ -306,7 +306,7 @@ void LoginHandler::NotifyAuthCancelled() { LoginNotificationDetails details(this); service->Notify(chrome::NOTIFICATION_AUTH_CANCELLED, - content::Source<NavigationController>(controller), + content::Source<content::NavigationController>(controller), content::Details<LoginNotificationDetails>(&details)); } @@ -326,7 +326,7 @@ void LoginHandler::NotifyAuthSupplied(const string16& username, service->Notify( chrome::NOTIFICATION_AUTH_SUPPLIED, - content::Source<NavigationController>(controller), + content::Source<content::NavigationController>(controller), content::Details<AuthSuppliedLoginNotificationDetails>(&details)); } diff --git a/chrome/browser/ui/login/login_prompt_browsertest.cc b/chrome/browser/ui/login/login_prompt_browsertest.cc index c879992..dadc9ac 100644 --- a/chrome/browser/ui/login/login_prompt_browsertest.cc +++ b/chrome/browser/ui/login/login_prompt_browsertest.cc @@ -158,9 +158,9 @@ template <int T> class WindowedNavigationObserver : public ui_test_utils::WindowedNotificationObserver { public: - explicit WindowedNavigationObserver(NavigationController* controller) + explicit WindowedNavigationObserver(content::NavigationController* controller) : ui_test_utils::WindowedNotificationObserver( - T, content::Source<NavigationController>(controller)) {} + T, content::Source<content::NavigationController>(controller)) {} }; // LOAD_STOP observer is special since we want to be able to wait for @@ -244,14 +244,15 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, PrefetchAuthCancels) { TabContentsWrapper* contents = browser()->GetSelectedTabContentsWrapper(); ASSERT_TRUE(contents); - NavigationController* controller = &contents->tab_contents()->GetController(); + NavigationController* controller = &contents->web_contents()->GetController(); LoginPromptBrowserTestObserver observer; - observer.Register(content::Source<NavigationController>(controller)); + observer.Register(content::Source<content::NavigationController>(controller)); WindowedLoadStopObserver load_stop_waiter(controller, 1); browser()->OpenURL(OpenURLParams( - test_page, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false)); + test_page, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, + false)); load_stop_waiter.Wait(); EXPECT_TRUE(observer.handlers_.empty()); @@ -270,10 +271,10 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, TestCancelAuth) { browser()->GetSelectedTabContentsWrapper(); ASSERT_TRUE(contents); - NavigationController* controller = &contents->tab_contents()->GetController(); + NavigationController* controller = &contents->web_contents()->GetController(); LoginPromptBrowserTestObserver observer; - observer.Register(content::Source<NavigationController>(controller)); + observer.Register(content::Source<content::NavigationController>(controller)); // First navigate to an unauthenticated page so we have something to // go back to. @@ -369,10 +370,10 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, MultipleRealmCancellation) { browser()->GetSelectedTabContentsWrapper(); ASSERT_TRUE(contents); - NavigationController* controller = &contents->tab_contents()->GetController(); + NavigationController* controller = &contents->web_contents()->GetController(); LoginPromptBrowserTestObserver observer; - observer.Register(content::Source<NavigationController>(controller)); + observer.Register(content::Source<content::NavigationController>(controller)); WindowedLoadStopObserver load_stop_waiter(controller, 1); @@ -422,10 +423,10 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, MultipleRealmConfirmation) { browser()->GetSelectedTabContentsWrapper(); ASSERT_TRUE(contents); - NavigationController* controller = &contents->tab_contents()->GetController(); + NavigationController* controller = &contents->web_contents()->GetController(); LoginPromptBrowserTestObserver observer; - observer.Register(content::Source<NavigationController>(controller)); + observer.Register(content::Source<content::NavigationController>(controller)); WindowedLoadStopObserver load_stop_waiter(controller, 1); int n_handlers = 0; @@ -475,10 +476,10 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, IncorrectConfirmation) { browser()->GetSelectedTabContentsWrapper(); ASSERT_TRUE(contents); - NavigationController* controller = &contents->tab_contents()->GetController(); + NavigationController* controller = &contents->web_contents()->GetController(); LoginPromptBrowserTestObserver observer; - observer.Register(content::Source<NavigationController>(controller)); + observer.Register(content::Source<content::NavigationController>(controller)); { WindowedAuthNeededObserver auth_needed_waiter(controller); @@ -547,10 +548,10 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, NoLoginPromptForFavicon) { browser()->GetSelectedTabContentsWrapper(); ASSERT_TRUE(contents); - NavigationController* controller = &contents->tab_contents()->GetController(); + NavigationController* controller = &contents->web_contents()->GetController(); LoginPromptBrowserTestObserver observer; - observer.Register(content::Source<NavigationController>(controller)); + observer.Register(content::Source<content::NavigationController>(controller)); // First load a page that has a favicon that requires // authentication. There should be no login prompt. @@ -604,9 +605,9 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, BlockCrossdomainPrompt) { TabContentsWrapper* contents = browser()->GetSelectedTabContentsWrapper(); ASSERT_TRUE(contents); - NavigationController* controller = &contents->tab_contents()->GetController(); + NavigationController* controller = &contents->web_contents()->GetController(); LoginPromptBrowserTestObserver observer; - observer.Register(content::Source<NavigationController>(controller)); + observer.Register(content::Source<content::NavigationController>(controller)); // Load a page that has a cross-domain sub-resource authentication. // There should be no login prompt. @@ -672,7 +673,7 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, SupplyRedundantAuths) { browser()->GetSelectedTabContentsWrapper(); ASSERT_TRUE(contents_1); NavigationController* controller_1 = - &contents_1->tab_contents()->GetController(); + &contents_1->web_contents()->GetController(); // Open a new tab. ui_test_utils::NavigateToURLWithDisposition( @@ -687,11 +688,13 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, SupplyRedundantAuths) { ASSERT_TRUE(contents_2); ASSERT_NE(contents_1, contents_2); NavigationController* controller_2 = - &contents_2->tab_contents()->GetController(); + &contents_2->web_contents()->GetController(); LoginPromptBrowserTestObserver observer; - observer.Register(content::Source<NavigationController>(controller_1)); - observer.Register(content::Source<NavigationController>(controller_2)); + observer.Register(content::Source<content::NavigationController>( + controller_1)); + observer.Register(content::Source<content::NavigationController>( + controller_2)); { // Open different auth urls in each tab. @@ -740,7 +743,7 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, CancelRedundantAuths) { browser()->GetSelectedTabContentsWrapper(); ASSERT_TRUE(contents_1); NavigationController* controller_1 = - &contents_1->tab_contents()->GetController(); + &contents_1->web_contents()->GetController(); // Open a new tab. ui_test_utils::NavigateToURLWithDisposition( @@ -755,11 +758,13 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, CancelRedundantAuths) { ASSERT_TRUE(contents_2); ASSERT_NE(contents_1, contents_2); NavigationController* controller_2 = - &contents_2->tab_contents()->GetController(); + &contents_2->web_contents()->GetController(); LoginPromptBrowserTestObserver observer; - observer.Register(content::Source<NavigationController>(controller_1)); - observer.Register(content::Source<NavigationController>(controller_2)); + observer.Register(content::Source<content::NavigationController>( + controller_1)); + observer.Register(content::Source<content::NavigationController>( + controller_2)); { // Open different auth urls in each tab. @@ -808,7 +813,7 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, TabContentsWrapper* contents = browser()->GetSelectedTabContentsWrapper(); ASSERT_TRUE(contents); - NavigationController* controller = &contents->tab_contents()->GetController(); + NavigationController* controller = &contents->web_contents()->GetController(); // Open an incognito window. Browser* browser_incognito = CreateIncognitoBrowser(); @@ -819,13 +824,13 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, ASSERT_TRUE(contents_incognito); ASSERT_NE(contents, contents_incognito); NavigationController* controller_incognito = - &contents_incognito->tab_contents()->GetController(); + &contents_incognito->web_contents()->GetController(); LoginPromptBrowserTestObserver observer; - observer.Register(content::Source<NavigationController>(controller)); + observer.Register(content::Source<content::NavigationController>(controller)); LoginPromptBrowserTestObserver observer_incognito; observer_incognito.Register( - content::Source<NavigationController>(controller_incognito)); + content::Source<content::NavigationController>(controller_incognito)); { // Open an auth url in each window. diff --git a/chrome/browser/ui/pdf/pdf_browsertest.cc b/chrome/browser/ui/pdf/pdf_browsertest.cc index ba3dab8..74f4e6e 100644 --- a/chrome/browser/ui/pdf/pdf_browsertest.cc +++ b/chrome/browser/ui/pdf/pdf_browsertest.cc @@ -289,7 +289,7 @@ IN_PROC_BROWSER_TEST_F(PDFBrowserTest, FLAKY_SLOW_Loading) { content::NotificationRegistrar registrar; registrar.Add(this, content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>(controller)); + content::Source<content::NavigationController>(controller)); std::string base_url = std::string("files/"); file_util::FileEnumerator file_enumerator( @@ -350,7 +350,7 @@ IN_PROC_BROWSER_TEST_F(PDFBrowserTest, MAYBE_OnLoadAndReload) { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &browser()->GetSelectedWebContents()->GetController())); ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( browser()->GetSelectedWebContents()->GetRenderViewHost(), diff --git a/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc b/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc index 5514905..8562be2 100644 --- a/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc +++ b/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc @@ -19,9 +19,9 @@ TabModalConfirmDialogDelegate::TabModalConfirmDialogDelegate( closing_(false) { NavigationController* controller = &web_contents->GetController(); registrar_.Add(this, content::NOTIFICATION_LOAD_START, - content::Source<NavigationController>(controller)); + content::Source<content::NavigationController>(controller)); registrar_.Add(this, content::NOTIFICATION_TAB_CLOSING, - content::Source<NavigationController>(controller)); + content::Source<content::NavigationController>(controller)); } TabModalConfirmDialogDelegate::~TabModalConfirmDialogDelegate() { diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_container.cc b/chrome/browser/ui/views/tab_contents/tab_contents_container.cc index da9b522..098746a 100644 --- a/chrome/browser/ui/views/tab_contents/tab_contents_container.cc +++ b/chrome/browser/ui/views/tab_contents/tab_contents_container.cc @@ -169,7 +169,8 @@ void TabContentsContainer::AddObservers() { registrar_.Add( this, content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED, - content::Source<NavigationController>(&web_contents_->GetController())); + content::Source<content::NavigationController>( + &web_contents_->GetController())); registrar_.Add( this, diff --git a/chrome/browser/ui/web_applications/web_app_ui.cc b/chrome/browser/ui/web_applications/web_app_ui.cc index 5d08a2f..5b18dac 100644 --- a/chrome/browser/ui/web_applications/web_app_ui.cc +++ b/chrome/browser/ui/web_applications/web_app_ui.cc @@ -103,8 +103,8 @@ UpdateShortcutWorker::UpdateShortcutWorker(TabContentsWrapper* tab_contents) registrar_.Add( this, content::NOTIFICATION_TAB_CLOSING, - content::Source<NavigationController>( - &tab_contents_->tab_contents()->GetController())); + content::Source<content::NavigationController>( + &tab_contents_->web_contents()->GetController())); } void UpdateShortcutWorker::Run() { @@ -117,8 +117,8 @@ void UpdateShortcutWorker::Observe( const content::NotificationSource& source, const content::NotificationDetails& details) { if (type == content::NOTIFICATION_TAB_CLOSING && - content::Source<NavigationController>(source).ptr() == - &tab_contents_->tab_contents()->GetController()) { + content::Source<content::NavigationController>(source).ptr() == + &tab_contents_->web_contents()->GetController()) { // Underlying tab is closing. tab_contents_ = NULL; } diff --git a/chrome/browser/ui/webui/active_downloads_ui.cc b/chrome/browser/ui/webui/active_downloads_ui.cc index 5d2cfa4..0984d28 100644 --- a/chrome/browser/ui/webui/active_downloads_ui.cc +++ b/chrome/browser/ui/webui/active_downloads_ui.cc @@ -44,6 +44,7 @@ #include "chrome/common/url_constants.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/renderer_host/render_view_host_delegate.h" +#include "content/browser/tab_contents/navigation_controller.h" #include "content/public/browser/download_item.h" #include "content/public/browser/download_manager.h" #include "content/public/browser/web_contents.h" diff --git a/chrome/browser/ui/webui/cloud_print_signin_dialog.cc b/chrome/browser/ui/webui/cloud_print_signin_dialog.cc index 1d2dca7..925284a 100644 --- a/chrome/browser/ui/webui/cloud_print_signin_dialog.cc +++ b/chrome/browser/ui/webui/cloud_print_signin_dialog.cc @@ -72,7 +72,7 @@ void CloudPrintSigninFlowHandler::RegisterMessages() { pending_entry->SetURL(CloudPrintURL( Profile::FromWebUI(web_ui())).GetCloudPrintSigninURL()); registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<NavigationController>(controller)); + content::Source<content::NavigationController>(controller)); } } diff --git a/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc index 8d251e9..55aad49 100644 --- a/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc +++ b/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc @@ -19,6 +19,7 @@ #include "chrome/browser/chromeos/input_method/input_method_util.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" +#include "content/browser/tab_contents/navigation_controller.h" #include "content/public/browser/user_metrics.h" #include "content/public/browser/web_contents.h" #include "grit/chromium_strings.h" diff --git a/chrome/browser/ui/webui/options2/chromeos/cros_language_options_handler2.cc b/chrome/browser/ui/webui/options2/chromeos/cros_language_options_handler2.cc index 6ab8de1..c0862f7 100644 --- a/chrome/browser/ui/webui/options2/chromeos/cros_language_options_handler2.cc +++ b/chrome/browser/ui/webui/options2/chromeos/cros_language_options_handler2.cc @@ -19,6 +19,7 @@ #include "chrome/browser/chromeos/input_method/input_method_util.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" +#include "content/browser/tab_contents/navigation_controller.h" #include "content/public/browser/user_metrics.h" #include "content/public/browser/web_contents.h" #include "grit/chromium_strings.h" diff --git a/chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc b/chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc index 3b59a5d..3b1cc67 100644 --- a/chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc +++ b/chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc @@ -91,7 +91,7 @@ void SyncPromoHandler::RegisterMessages() { IsViewSourceMode()) { // Listen to see if the tab we're in gets closed. registrar_.Add(this, content::NOTIFICATION_TAB_CLOSING, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &web_ui()->web_contents()->GetController())); // Listen to see if the window we're in gets closed. registrar_.Add(this, chrome::NOTIFICATION_BROWSER_CLOSING, diff --git a/chrome/browser/ui/webui/web_ui_browsertest.cc b/chrome/browser/ui/webui/web_ui_browsertest.cc index 38a5c49..7fbddc3 100644 --- a/chrome/browser/ui/webui/web_ui_browsertest.cc +++ b/chrome/browser/ui/webui/web_ui_browsertest.cc @@ -181,7 +181,7 @@ void WebUIBrowserTest::PreLoadJavascriptLibraries( void WebUIBrowserTest::BrowsePreload(const GURL& browse_to) { TestNavigationObserver navigation_observer( - content::Source<NavigationController>( + content::Source<content::NavigationController>( &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController()), this, 1); diff --git a/chrome/test/base/test_html_dialog_observer.cc b/chrome/test/base/test_html_dialog_observer.cc index 9a7019d..3d7189e 100644 --- a/chrome/test/base/test_html_dialog_observer.cc +++ b/chrome/test/base/test_html_dialog_observer.cc @@ -47,13 +47,13 @@ void TestHtmlDialogObserver::Observe( // TabContents::NavigateToEntry. The new RenderView is later told to // navigate in this method, ensuring that this is not a race condition. registrar_.Add(this, content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &web_ui_->web_contents()->GetController())); break; case content::NOTIFICATION_LOAD_STOP: DCHECK(web_ui_); registrar_.Remove(this, content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &web_ui_->web_contents()->GetController())); done_ = true; // If the message loop is running stop it. diff --git a/chrome/test/base/test_tab_strip_model_observer.cc b/chrome/test/base/test_tab_strip_model_observer.cc index 87bb8c3..e3f926c 100644 --- a/chrome/test/base/test_tab_strip_model_observer.cc +++ b/chrome/test/base/test_tab_strip_model_observer.cc @@ -42,8 +42,8 @@ void TestTabStripModelObserver::ObservePrintPreviewTabContents( TabContentsWrapper* preview_tab = tab_controller->GetPrintPreviewForTab(contents); if (preview_tab) { - RegisterAsObserver(content::Source<NavigationController>( - &preview_tab->tab_contents()->GetController())); + RegisterAsObserver(content::Source<content::NavigationController>( + &preview_tab->web_contents()->GetController())); } } } diff --git a/chrome/test/base/ui_test_utils.cc b/chrome/test/base/ui_test_utils.cc index 01d332e..d181b98 100644 --- a/chrome/test/base/ui_test_utils.cc +++ b/chrome/test/base/ui_test_utils.cc @@ -317,7 +317,7 @@ bool GetCurrentTabTitle(const Browser* browser, string16* title) { void WaitForNavigations(NavigationController* controller, int number_of_navigations) { TestNavigationObserver observer( - content::Source<NavigationController>(controller), NULL, + content::Source<content::NavigationController>(controller), NULL, number_of_navigations); observer.WaitForObservation( base::Bind(&ui_test_utils::RunMessageLoop), @@ -341,7 +341,7 @@ void WaitForBrowserActionUpdated(ExtensionAction* browser_action) { void WaitForLoadStop(WebContents* tab) { WindowedNotificationObserver load_stop_observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>(&tab->GetController())); + content::Source<content::NavigationController>(&tab->GetController())); // In many cases, the load may have finished before we get here. Only wait if // the tab still has a pending navigation. if (!tab->IsLoading()) @@ -403,7 +403,7 @@ static void NavigateToURLWithDispositionBlockUntilNavigationsComplete( if (disposition == CURRENT_TAB && browser->GetSelectedWebContents()) WaitForLoadStop(browser->GetSelectedWebContents()); TestNavigationObserver same_tab_observer( - content::Source<NavigationController>( + content::Source<content::NavigationController>( &browser->GetSelectedWebContents()->GetController()), NULL, number_of_navigations); @@ -929,7 +929,8 @@ TitleWatcher::TitleWatcher(TabContents* tab_contents, notification_registrar_.Add( this, content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>(&tab_contents->GetController())); + content::Source<content::NavigationController>( + &tab_contents->GetController())); } void TitleWatcher::AlsoWaitForTitle(const string16& expected_title) { @@ -954,8 +955,8 @@ void TitleWatcher::Observe(int type, TabContents* source_contents = content::Source<TabContents>(source).ptr(); ASSERT_EQ(tab_contents_, source_contents); } else if (type == content::NOTIFICATION_LOAD_STOP) { - NavigationController* controller = - content::Source<NavigationController>(source).ptr(); + content::NavigationController* controller = + content::Source<content::NavigationController>(source).ptr(); ASSERT_EQ(&tab_contents_->GetController(), controller); } else { FAIL() << "Unexpected notification received."; diff --git a/content/browser/speech/speech_input_browsertest.cc b/content/browser/speech/speech_input_browsertest.cc index f0f9f2b..c6d6a2f 100644 --- a/content/browser/speech/speech_input_browsertest.cc +++ b/content/browser/speech/speech_input_browsertest.cc @@ -165,7 +165,8 @@ class SpeechInputBrowserTest : public InProcessBrowserTest { WebContents* web_contents = browser()->GetSelectedWebContents(); ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>(&web_contents->GetController())); + content::Source<content::NavigationController>( + &web_contents->GetController())); web_contents->GetRenderViewHost()->ForwardMouseEvent(mouse_event); mouse_event.type = WebKit::WebInputEvent::MouseUp; web_contents->GetRenderViewHost()->ForwardMouseEvent(mouse_event); diff --git a/content/browser/ssl/ssl_manager.cc b/content/browser/ssl/ssl_manager.cc index 2330516..518217a 100644 --- a/content/browser/ssl/ssl_manager.cc +++ b/content/browser/ssl/ssl_manager.cc @@ -109,7 +109,7 @@ SSLManager::SSLManager(NavigationController* controller) // Subscribe to various notifications. registrar_.Add(this, content::NOTIFICATION_FAIL_PROVISIONAL_LOAD_WITH_ERROR, - content::Source<NavigationController>(controller_)); + content::Source<content::NavigationController>(controller_)); registrar_.Add( this, content::NOTIFICATION_RESOURCE_RESPONSE_STARTED, content::Source<WebContents>(controller_->tab_contents())); @@ -118,7 +118,7 @@ SSLManager::SSLManager(NavigationController* controller) content::Source<WebContents>(controller_->tab_contents())); registrar_.Add( this, content::NOTIFICATION_LOAD_FROM_MEMORY_CACHE, - content::Source<NavigationController>(controller_)); + content::Source<content::NavigationController>(controller_)); registrar_.Add( this, content::NOTIFICATION_SSL_INTERNAL_STATE_CHANGED, content::Source<content::BrowserContext>( @@ -263,7 +263,7 @@ void SSLManager::UpdateEntry(NavigationEntryImpl* entry) { if (!entry->GetSSL().Equals(original_ssl_status)) { content::NotificationService::current()->Notify( content::NOTIFICATION_SSL_VISIBLE_STATE_CHANGED, - content::Source<NavigationController>(controller_), + content::Source<content::NavigationController>(controller_), content::NotificationService::NoDetails()); } } diff --git a/content/browser/tab_contents/interstitial_page.cc b/content/browser/tab_contents/interstitial_page.cc index cbc0b29..41d9a32 100644 --- a/content/browser/tab_contents/interstitial_page.cc +++ b/content/browser/tab_contents/interstitial_page.cc @@ -211,9 +211,9 @@ void InterstitialPage::Show() { content::NOTIFICATION_WEB_CONTENTS_DESTROYED, content::Source<WebContents>(tab_)); notification_registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<NavigationController>(&tab_->GetController())); + content::Source<content::NavigationController>(&tab_->GetController())); notification_registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_PENDING, - content::Source<NavigationController>(&tab_->GetController())); + content::Source<content::NavigationController>(&tab_->GetController())); } void InterstitialPage::Hide() { diff --git a/content/browser/tab_contents/navigation_controller.cc b/content/browser/tab_contents/navigation_controller.cc index 55e6ce3..dbbf9d4 100644 --- a/content/browser/tab_contents/navigation_controller.cc +++ b/content/browser/tab_contents/navigation_controller.cc @@ -52,7 +52,7 @@ void NotifyPrunedEntries(NavigationController* nav_controller, details.count = count; content::NotificationService::current()->Notify( content::NOTIFICATION_NAV_LIST_PRUNED, - content::Source<NavigationController>(nav_controller), + content::Source<content::NavigationController>(nav_controller), content::Details<content::PrunedDetails>(&details)); } @@ -178,7 +178,7 @@ NavigationController::~NavigationController() { content::NotificationService::current()->Notify( content::NOTIFICATION_TAB_CLOSED, - content::Source<NavigationController>(this), + content::Source<content::NavigationController>(this), content::NotificationService::NoDetails()); } @@ -239,7 +239,7 @@ void NavigationController::ReloadInternal(bool check_for_repost, // with check_for_repost = false. content::NotificationService::current()->Notify( content::NOTIFICATION_REPOST_WARNING_SHOWN, - content::Source<NavigationController>(this), + content::Source<content::NavigationController>(this), content::NotificationService::NoDetails()); pending_reload_ = reload_type; @@ -300,7 +300,7 @@ void NavigationController::LoadEntry(NavigationEntryImpl* entry) { pending_entry_ = entry; content::NotificationService::current()->Notify( content::NOTIFICATION_NAV_ENTRY_PENDING, - content::Source<NavigationController>(this), + content::Source<content::NavigationController>(this), content::Details<NavigationEntry>(entry)); NavigateToPendingEntry(NO_RELOAD); } @@ -1229,7 +1229,7 @@ void NavigationController::NotifyNavigationEntryCommitted( content::NotificationService::current()->Notify( content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<NavigationController>(this), + content::Source<content::NavigationController>(this), notification_details); } @@ -1268,7 +1268,7 @@ void NavigationController::NotifyEntryChanged(const NavigationEntry* entry, det.index = index; content::NotificationService::current()->Notify( content::NOTIFICATION_NAV_ENTRY_CHANGED, - content::Source<NavigationController>(this), + content::Source<content::NavigationController>(this), content::Details<content::EntryChangedDetails>(&det)); } diff --git a/content/browser/tab_contents/navigation_controller_unittest.cc b/content/browser/tab_contents/navigation_controller_unittest.cc index b388f6d..e0d6827 100644 --- a/content/browser/tab_contents/navigation_controller_unittest.cc +++ b/content/browser/tab_contents/navigation_controller_unittest.cc @@ -48,11 +48,14 @@ class NavigationControllerTest : public RenderViewHostTestHarness { void RegisterForAllNavNotifications(TestNotificationTracker* tracker, NavigationController* controller) { tracker->ListenFor(content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<NavigationController>(controller)); + content::Source<content::NavigationController>( + controller)); tracker->ListenFor(content::NOTIFICATION_NAV_LIST_PRUNED, - content::Source<NavigationController>(controller)); + content::Source<content::NavigationController>( + controller)); tracker->ListenFor(content::NOTIFICATION_NAV_ENTRY_CHANGED, - content::Source<NavigationController>(controller)); + content::Source<content::NavigationController>( + controller)); } class TestWebContentsDelegate : public content::WebContentsDelegate { @@ -1393,7 +1396,7 @@ class PrunedListener : public content::NotificationObserver { explicit PrunedListener(NavigationController* controller) : notification_count_(0) { registrar_.Add(this, content::NOTIFICATION_NAV_LIST_PRUNED, - content::Source<NavigationController>(controller)); + content::Source<content::NavigationController>(controller)); } virtual void Observe(int type, diff --git a/content/browser/tab_contents/render_view_host_manager.cc b/content/browser/tab_contents/render_view_host_manager.cc index 2e64fd0..0963f8d 100644 --- a/content/browser/tab_contents/render_view_host_manager.cc +++ b/content/browser/tab_contents/render_view_host_manager.cc @@ -115,7 +115,7 @@ RenderViewHost* RenderViewHostManager::Navigate( details.old_host = NULL; content::NotificationService::current()->Notify( content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &delegate_->GetControllerForRenderManager()), content::Details<RenderViewHostSwitchedDetails>(&details)); } @@ -602,7 +602,7 @@ void RenderViewHostManager::CommitPending() { details.old_host = old_render_view_host; content::NotificationService::current()->Notify( content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED, - content::Source<NavigationController>( + content::Source<content::NavigationController>( &delegate_->GetControllerForRenderManager()), content::Details<RenderViewHostSwitchedDetails>(&details)); diff --git a/content/browser/tab_contents/render_view_host_manager_unittest.cc b/content/browser/tab_contents/render_view_host_manager_unittest.cc index 6621154..1b28b01 100644 --- a/content/browser/tab_contents/render_view_host_manager_unittest.cc +++ b/content/browser/tab_contents/render_view_host_manager_unittest.cc @@ -294,7 +294,8 @@ TEST_F(RenderViewHostManagerTest, Navigate) { TestTabContents tab_contents(browser_context(), instance); notifications.ListenFor( content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED, - content::Source<NavigationController>(&tab_contents.GetController())); + content::Source<content::NavigationController>( + &tab_contents.GetController())); // Create. RenderViewHostManager manager(&tab_contents, &tab_contents); @@ -382,7 +383,8 @@ TEST_F(RenderViewHostManagerTest, NavigateWithEarlyReNavigation) { TestTabContents tab_contents(browser_context(), instance); notifications.ListenFor( content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED, - content::Source<NavigationController>(&tab_contents.GetController())); + content::Source<content::NavigationController>( + &tab_contents.GetController())); // Create. RenderViewHostManager manager(&tab_contents, &tab_contents); diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc index f8399ff..b7ebf7e 100644 --- a/content/browser/tab_contents/tab_contents.cc +++ b/content/browser/tab_contents/tab_contents.cc @@ -1242,7 +1242,7 @@ void TabContents::OnDidFailProvisionalLoadWithError( content::NotificationService::current()->Notify( content::NOTIFICATION_FAIL_PROVISIONAL_LOAD_WITH_ERROR, - content::Source<NavigationController>(&controller_), + content::Source<content::NavigationController>(&controller_), content::Details<ProvisionalLoadDetails>(&details)); FOR_EACH_OBSERVER(WebContentsObserver, @@ -1276,7 +1276,7 @@ void TabContents::OnDidLoadResourceFromMemoryCache( content::NotificationService::current()->Notify( content::NOTIFICATION_LOAD_FROM_MEMORY_CACHE, - content::Source<NavigationController>(&controller_), + content::Source<content::NavigationController>(&controller_), content::Details<LoadFromMemoryCacheDetails>(&details)); } @@ -1438,7 +1438,7 @@ void TabContents::SetIsLoading(bool is_loading, if (details) det = content::Details<LoadNotificationDetails>(details); content::NotificationService::current()->Notify(type, - content::Source<NavigationController>(&controller_), + content::Source<content::NavigationController>(&controller_), det); } diff --git a/content/public/browser/notification_types.h b/content/public/browser/notification_types.h index 36499c6..0dfdcdd 100644 --- a/content/public/browser/notification_types.h +++ b/content/public/browser/notification_types.h @@ -301,9 +301,9 @@ enum NotificationType { NOTIFICATION_RENDERER_PROCESS_HANG, // This is sent to notify that the RenderViewHost displayed in a - // TabContents has changed. Source is the TabContents for which the change - // happened, details is the previous RenderViewHost (can be NULL when the - // first RenderViewHost is set). + // TabContents has changed. Source is the NavigationController for which the + // change happened, details is the previous RenderViewHost (can be NULL when + // the first RenderViewHost is set). NOTIFICATION_RENDER_VIEW_HOST_CHANGED, // Indicates that the render view host has received an accessibility tree |