diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-04 17:07:50 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-04 17:07:50 +0000 |
commit | c5eed4976490f601ad01f36e102260744c673b2d (patch) | |
tree | 64fb05d9ecf101bf0dc4460ecd26b56637b4e8d7 /chrome | |
parent | 8c64d197edc97f4cd646cff55a21af0b4733b942 (diff) | |
download | chromium_src-c5eed4976490f601ad01f36e102260744c673b2d.zip chromium_src-c5eed4976490f601ad01f36e102260744c673b2d.tar.gz chromium_src-c5eed4976490f601ad01f36e102260744c673b2d.tar.bz2 |
Get rid of content::NavigationController in cc file and use "using" instead.
BUG=98716
TBR=joi
Review URL: http://codereview.chromium.org/8983012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116328 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
76 files changed, 429 insertions, 404 deletions
diff --git a/chrome/browser/DEPS b/chrome/browser/DEPS index 98c0362..eb5d1e0 100644 --- a/chrome/browser/DEPS +++ b/chrome/browser/DEPS @@ -30,7 +30,7 @@ include_rules = [ # TODO(jam): this needs to be removed, and only use content/public. BUG=98716 "+content/browser", "-content/browser/notification_service_impl.h", - "-content/browser/tab_contents/navigation_controller.h", + "-content/browser/tab_contents/navigation_controller_impl.h", "-content/browser/tab_contents/navigation_entry_impl.h", "-content/browser/plugin_service_impl.h", "-content/browser/worker_service_impl.h", diff --git a/chrome/browser/alternate_nav_url_fetcher.cc b/chrome/browser/alternate_nav_url_fetcher.cc index 6c583d2..d2bf6f1 100644 --- a/chrome/browser/alternate_nav_url_fetcher.cc +++ b/chrome/browser/alternate_nav_url_fetcher.cc @@ -22,6 +22,7 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" +using content::NavigationController; using content::OpenURLParams; using content::Referrer; @@ -119,15 +120,15 @@ 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. - content::NavigationController* controller = - content::Source<content::NavigationController>(source).ptr(); + NavigationController* controller = + content::Source<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<content::NavigationController>( + content::Source<NavigationController>( controller)); StartFetch(controller); } @@ -136,7 +137,7 @@ void AlternateNavURLFetcher::Observe( case chrome::NOTIFICATION_INSTANT_COMMITTED: { // See above. - content::NavigationController* controller = + NavigationController* controller = &content::Source<TabContentsWrapper>(source)-> web_contents()->GetController(); if (controller_ == controller) { @@ -151,8 +152,7 @@ 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<content::NavigationController>( - controller_)); + content::Source<NavigationController>(controller_)); navigated_to_entry_ = true; ShowInfobarIfPossible(); // WARNING: |this| may be deleted! @@ -179,11 +179,10 @@ void AlternateNavURLFetcher::OnURLFetchComplete( // WARNING: |this| may be deleted! } -void AlternateNavURLFetcher::StartFetch( - content::NavigationController* controller) { +void AlternateNavURLFetcher::StartFetch(NavigationController* controller) { controller_ = controller; registrar_.Add(this, content::NOTIFICATION_TAB_CLOSED, - content::Source<content::NavigationController>(controller_)); + content::Source<NavigationController>(controller_)); DCHECK_EQ(NOT_STARTED, state_); state_ = IN_PROGRESS; diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index 47d6476..9e4b25f 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -104,6 +104,7 @@ using WebKit::WebFindOptions; using base::Time; using content::BrowserThread; using content::DownloadItem; +using content::NavigationController; using content::WebContents; namespace { @@ -291,19 +292,18 @@ void AutomationProvider::OnLoginWebuiReady() { Send(new AutomationMsg_InitialLoadsComplete()); } -void AutomationProvider::AddLoginHandler(content::NavigationController* tab, +void AutomationProvider::AddLoginHandler(NavigationController* tab, LoginHandler* handler) { login_handler_map_[tab] = handler; } -void AutomationProvider::RemoveLoginHandler(content::NavigationController* tab) { +void AutomationProvider::RemoveLoginHandler(NavigationController* tab) { DCHECK(login_handler_map_[tab]); login_handler_map_.erase(tab); } int AutomationProvider::GetIndexForNavigationController( - const content::NavigationController* controller, - const Browser* parent) const { + const NavigationController* controller, const Browser* parent) const { DCHECK(parent); return parent->GetIndexOfController(controller); } @@ -527,7 +527,7 @@ bool AutomationProvider::Send(IPC::Message* msg) { } Browser* AutomationProvider::FindAndActivateTab( - content::NavigationController* controller) { + NavigationController* controller) { int tab_index; Browser* browser = Browser::GetBrowserForController(controller, &tab_index); if (browser) @@ -546,7 +546,7 @@ void AutomationProvider::HandleFindRequest( return; } - content::NavigationController* nav = tab_tracker_->GetResource(handle); + NavigationController* nav = tab_tracker_->GetResource(handle); WebContents* web_contents = nav->GetWebContents(); SendFindRequest(web_contents, @@ -601,10 +601,9 @@ void AutomationProvider::SetProxyConfig(const std::string& new_proxy_config) { } WebContents* AutomationProvider::GetWebContentsForHandle( - int handle, content::NavigationController** tab) { + int handle, NavigationController** tab) { if (tab_tracker_->ContainsHandle(handle)) { - content::NavigationController* nav_controller = - tab_tracker_->GetResource(handle); + NavigationController* nav_controller = tab_tracker_->GetResource(handle); if (tab) *tab = nav_controller; return nav_controller->GetWebContents(); @@ -618,7 +617,7 @@ void AutomationProvider::OverrideEncoding(int tab_handle, bool* success) { *success = false; if (tab_tracker_->ContainsHandle(tab_handle)) { - content::NavigationController* nav = tab_tracker_->GetResource(tab_handle); + NavigationController* nav = tab_tracker_->GetResource(tab_handle); if (!nav) return; Browser* browser = FindAndActivateTab(nav); @@ -690,7 +689,7 @@ void AutomationProvider::Paste(int tab_handle) { void AutomationProvider::ReloadAsync(int tab_handle) { if (tab_tracker_->ContainsHandle(tab_handle)) { - content::NavigationController* tab = tab_tracker_->GetResource(tab_handle); + NavigationController* tab = tab_tracker_->GetResource(tab_handle); if (!tab) { NOTREACHED(); return; @@ -726,7 +725,7 @@ void AutomationProvider::OnSetPageFontSize(int tab_handle, } if (tab_tracker_->ContainsHandle(tab_handle)) { - content::NavigationController* tab = tab_tracker_->GetResource(tab_handle); + NavigationController* tab = tab_tracker_->GetResource(tab_handle); DCHECK(tab != NULL); if (tab && tab->GetWebContents()) { DCHECK(tab->GetWebContents()->GetBrowserContext() != NULL); @@ -797,7 +796,7 @@ void AutomationProvider::GetTracingOutput(std::string* chunk, RenderViewHost* AutomationProvider::GetViewForTab(int tab_handle) { if (tab_tracker_->ContainsHandle(tab_handle)) { - content::NavigationController* tab = tab_tracker_->GetResource(tab_handle); + NavigationController* tab = tab_tracker_->GetResource(tab_handle); if (!tab) { NOTREACHED(); return NULL; @@ -1005,7 +1004,7 @@ void AutomationProvider::GetExtensionProperty( } void AutomationProvider::SaveAsAsync(int tab_handle) { - content::NavigationController* tab = NULL; + NavigationController* tab = NULL; WebContents* web_contents = GetWebContentsForHandle(tab_handle, &tab); if (web_contents) web_contents->OnSavePage(); diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc index 6c39422..74eb429 100644 --- a/chrome/browser/automation/automation_provider_observers.cc +++ b/chrome/browser/automation/automation_provider_observers.cc @@ -89,6 +89,7 @@ using content::BrowserThread; using content::DownloadItem; using content::DownloadManager; +using content::NavigationController; using content::WebContents; // Holds onto start and stop timestamps for a particular tab @@ -233,7 +234,7 @@ void NewTabUILoadObserver::Observe(int type, NavigationControllerRestoredObserver::NavigationControllerRestoredObserver( AutomationProvider* automation, - content::NavigationController* controller, + NavigationController* controller, IPC::Message* reply_message) : automation_(automation->AsWeakPtr()), controller_(controller), @@ -273,7 +274,7 @@ void NavigationControllerRestoredObserver::SendDone() { } NavigationNotificationObserver::NavigationNotificationObserver( - content::NavigationController* controller, + NavigationController* controller, AutomationProvider* automation, IPC::Message* reply_message, int number_of_navigations, @@ -290,7 +291,7 @@ NavigationNotificationObserver::NavigationNotificationObserver( return; } DCHECK_LT(0, navigations_remaining_); - content::Source<content::NavigationController> source(controller_); + content::Source<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 +396,7 @@ void TabStripNotificationObserver::Observe( ObserveTab(&(content::Source<TabContentsWrapper>(source).ptr()-> tab_contents()->GetController())); } else { - ObserveTab(content::Source<content::NavigationController>(source).ptr()); + ObserveTab(content::Source<NavigationController>(source).ptr()); } delete this; } else { @@ -415,7 +416,7 @@ TabAppendedNotificationObserver::TabAppendedNotificationObserver( TabAppendedNotificationObserver::~TabAppendedNotificationObserver() {} void TabAppendedNotificationObserver::ObserveTab( - content::NavigationController* controller) { + NavigationController* controller) { if (!automation_) return; @@ -443,7 +444,7 @@ TabClosedNotificationObserver::TabClosedNotificationObserver( TabClosedNotificationObserver::~TabClosedNotificationObserver() {} void TabClosedNotificationObserver::ObserveTab( - content::NavigationController* controller) { + NavigationController* controller) { if (!automation_) return; @@ -885,8 +886,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. - content::NavigationController* controller = - content::Source<content::NavigationController>(source).ptr(); + NavigationController* controller = + content::Source<NavigationController>(source).ptr(); TabContentsWrapper* tab = TabContentsWrapper::GetCurrentWrapperForContents( controller->GetWebContents()); int window_id = tab ? tab->restore_tab_helper()->window_id().id() : -1; @@ -1900,13 +1901,13 @@ void AutomationProviderBrowsingDataObserver::OnBrowsingDataRemoverDone() { } OmniboxAcceptNotificationObserver::OmniboxAcceptNotificationObserver( - content::NavigationController* controller, + NavigationController* controller, AutomationProvider* automation, IPC::Message* reply_message) : automation_(automation->AsWeakPtr()), reply_message_(reply_message), controller_(controller) { - content::Source<content::NavigationController> source(controller_); + content::Source<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 +2199,7 @@ void NTPInfoObserver::OnTopSitesReceived( } AppLaunchObserver::AppLaunchObserver( - content::NavigationController* controller, + NavigationController* controller, AutomationProvider* automation, IPC::Message* reply_message, extension_misc::LaunchContainer launch_container) @@ -2209,7 +2210,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<content::NavigationController> source(controller_); + content::Source<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 +2237,8 @@ void AppLaunchObserver::Observe(int type, return; } else { // The app has launched only if the loaded tab is in the new window. - content::NavigationController* controller = - content::Source<content::NavigationController>(source).ptr(); + NavigationController* controller = + content::Source<NavigationController>(source).ptr(); TabContentsWrapper* tab = TabContentsWrapper::GetCurrentWrapperForContents( controller->GetWebContents()); @@ -2750,7 +2751,7 @@ void NewTabObserver::Observe(int type, const content::NotificationSource& source, const content::NotificationDetails& details) { DCHECK_EQ(content::NOTIFICATION_TAB_PARENTED, type); - content::NavigationController* controller = + NavigationController* controller = &(content::Source<TabContentsWrapper>(source).ptr()-> tab_contents()->GetController()); if (automation_) { @@ -2971,8 +2972,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. - content::NavigationController* controller = - content::Source<content::NavigationController>(source).ptr(); + NavigationController* controller = + content::Source<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_win.cc b/chrome/browser/automation/automation_provider_win.cc index bcafa0b..bcc8f63 100644 --- a/chrome/browser/automation/automation_provider_win.cc +++ b/chrome/browser/automation/automation_provider_win.cc @@ -31,6 +31,7 @@ #include "ui/views/focus/accelerator_handler.h" #include "ui/views/widget/root_view.h" +using content::NavigationController; using content::WebContents; namespace { @@ -249,7 +250,7 @@ void AutomationProvider::PrintAsync(int tab_handle) { ExternalTabContainer* AutomationProvider::GetExternalTabForHandle(int handle) { if (tab_tracker_->ContainsHandle(handle)) { - content::NavigationController* tab = tab_tracker_->GetResource(handle); + NavigationController* tab = tab_tracker_->GetResource(handle); return ExternalTabContainer::GetContainerForTab( tab->GetWebContents()->GetNativeView()); } @@ -291,7 +292,7 @@ void AutomationProvider::OnForwardContextMenuCommandToChrome(int tab_handle, if (!tab_tracker_->ContainsHandle(tab_handle)) return; - content::NavigationController* tab = tab_tracker_->GetResource(tab_handle); + NavigationController* tab = tab_tracker_->GetResource(tab_handle); if (!tab) { NOTREACHED(); return; @@ -371,7 +372,7 @@ void AutomationProvider::NavigateInExternalTab( *status = AUTOMATION_MSG_NAVIGATION_ERROR; if (tab_tracker_->ContainsHandle(handle)) { - content::NavigationController* tab = tab_tracker_->GetResource(handle); + NavigationController* tab = tab_tracker_->GetResource(handle); tab->LoadURL( url, content::Referrer(referrer, WebKit::WebReferrerPolicyDefault), @@ -386,7 +387,7 @@ void AutomationProvider::NavigateExternalTabAtIndex( *status = AUTOMATION_MSG_NAVIGATION_ERROR; if (tab_tracker_->ContainsHandle(handle)) { - content::NavigationController* tab = tab_tracker_->GetResource(handle); + NavigationController* tab = tab_tracker_->GetResource(handle); tab->GoToIndex(navigation_index); *status = AUTOMATION_MSG_NAVIGATION_SUCCESS; } @@ -402,7 +403,7 @@ void AutomationProvider::OnRunUnloadHandlers( void AutomationProvider::OnSetZoomLevel(int handle, int zoom_level) { if (tab_tracker_->ContainsHandle(handle)) { - content::NavigationController* tab = tab_tracker_->GetResource(handle); + 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 4d6c09a..7f7e2cc 100644 --- a/chrome/browser/automation/automation_tab_tracker.cc +++ b/chrome/browser/automation/automation_tab_tracker.cc @@ -8,35 +8,35 @@ #include "content/public/browser/navigation_controller.h" #include "content/public/browser/notification_source.h" +using content::NavigationController; + AutomationTabTracker::AutomationTabTracker(IPC::Message::Sender* automation) - : AutomationResourceTracker<content::NavigationController*>(automation) { + : AutomationResourceTracker<NavigationController*>(automation) { } AutomationTabTracker::~AutomationTabTracker() { } -void AutomationTabTracker::AddObserver( - content::NavigationController* resource) { +void AutomationTabTracker::AddObserver(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<content::NavigationController>(resource)); + content::Source<NavigationController>(resource)); registrar_.Add(this, chrome::NOTIFICATION_EXTERNAL_TAB_CLOSED, - content::Source<content::NavigationController>(resource)); + content::Source<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<content::NavigationController>(resource)); + content::Source<NavigationController>(resource)); } -void AutomationTabTracker::RemoveObserver( - content::NavigationController* resource) { +void AutomationTabTracker::RemoveObserver(NavigationController* resource) { registrar_.Remove(this, content::NOTIFICATION_TAB_CLOSING, - content::Source<content::NavigationController>(resource)); + content::Source<NavigationController>(resource)); registrar_.Remove(this, chrome::NOTIFICATION_EXTERNAL_TAB_CLOSED, - content::Source<content::NavigationController>(resource)); + content::Source<NavigationController>(resource)); registrar_.Remove(this, content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>(resource)); + content::Source<NavigationController>(resource)); } void AutomationTabTracker::Observe( @@ -46,15 +46,15 @@ void AutomationTabTracker::Observe( switch (type) { case content::NOTIFICATION_LOAD_STOP: last_navigation_times_[ - content::Source<content::NavigationController>(source).ptr()] = + content::Source<NavigationController>(source).ptr()] = base::Time::Now(); return; case chrome::NOTIFICATION_EXTERNAL_TAB_CLOSED: case content::NOTIFICATION_TAB_CLOSING: { - std::map<content::NavigationController*, base::Time>::iterator iter = + std::map<NavigationController*, base::Time>::iterator iter = last_navigation_times_.find( - content::Source<content::NavigationController>(source).ptr()); + content::Source<NavigationController>(source).ptr()); if (iter != last_navigation_times_.end()) last_navigation_times_.erase(iter); } @@ -62,15 +62,15 @@ void AutomationTabTracker::Observe( default: NOTREACHED(); } - AutomationResourceTracker<content::NavigationController*>::Observe( + AutomationResourceTracker<NavigationController*>::Observe( type, source, details); } base::Time AutomationTabTracker::GetLastNavigationTime(int handle) { if (ContainsHandle(handle)) { - content::NavigationController* controller = GetResource(handle); + NavigationController* controller = GetResource(handle); if (controller) { - std::map<content::NavigationController*, base::Time>::const_iterator iter + std::map<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/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc index ad9fa67..39d9225 100644 --- a/chrome/browser/automation/testing_automation_provider.cc +++ b/chrome/browser/automation/testing_automation_provider.cc @@ -155,6 +155,7 @@ using content::BrowserThread; using content::ChildProcessHost; using content::DownloadItem; using content::DownloadManager; +using content::NavigationController; using content::NavigationEntry; using content::PluginService; using content::OpenURLParams; @@ -571,8 +572,7 @@ void TestingAutomationProvider::CloseTab(int tab_handle, bool wait_until_closed, IPC::Message* reply_message) { if (tab_tracker_->ContainsHandle(tab_handle)) { - content::NavigationController* controller = - tab_tracker_->GetResource(tab_handle); + NavigationController* controller = tab_tracker_->GetResource(tab_handle); int index; Browser* browser = Browser::GetBrowserForController(controller, &index); DCHECK(browser); @@ -614,8 +614,7 @@ void TestingAutomationProvider::ShowCollectedCookiesDialog( int handle, bool* success) { *success = false; if (tab_tracker_->ContainsHandle(handle)) { - content::NavigationController* controller = - tab_tracker_->GetResource(handle); + NavigationController* controller = tab_tracker_->GetResource(handle); WebContents* tab_contents = controller->GetWebContents(); Browser* browser = Browser::GetBrowserForController(controller, NULL); browser->ShowCollectedCookiesDialog( @@ -628,7 +627,7 @@ void TestingAutomationProvider::NavigateToURLBlockUntilNavigationsComplete( int handle, const GURL& url, int number_of_navigations, IPC::Message* reply_message) { if (tab_tracker_->ContainsHandle(handle)) { - content::NavigationController* tab = tab_tracker_->GetResource(handle); + 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. @@ -665,7 +664,7 @@ void TestingAutomationProvider::NavigationAsyncWithDisposition( *status = false; if (tab_tracker_->ContainsHandle(handle)) { - content::NavigationController* tab = tab_tracker_->GetResource(handle); + 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. @@ -685,7 +684,7 @@ void TestingAutomationProvider::NavigationAsyncWithDisposition( void TestingAutomationProvider::Reload(int handle, IPC::Message* reply_message) { if (tab_tracker_->ContainsHandle(handle)) { - content::NavigationController* tab = tab_tracker_->GetResource(handle); + NavigationController* tab = tab_tracker_->GetResource(handle); Browser* browser = FindAndActivateTab(tab); if (browser && browser->command_updater()->IsCommandEnabled(IDC_RELOAD)) { new NavigationNotificationObserver( @@ -705,7 +704,7 @@ void TestingAutomationProvider::SetAuth(int tab_handle, const std::wstring& password, IPC::Message* reply_message) { if (tab_tracker_->ContainsHandle(tab_handle)) { - content::NavigationController* tab = tab_tracker_->GetResource(tab_handle); + NavigationController* tab = tab_tracker_->GetResource(tab_handle); LoginHandlerMap::iterator iter = login_handler_map_.find(tab); if (iter != login_handler_map_.end()) { @@ -728,7 +727,7 @@ void TestingAutomationProvider::SetAuth(int tab_handle, void TestingAutomationProvider::CancelAuth(int tab_handle, IPC::Message* reply_message) { if (tab_tracker_->ContainsHandle(tab_handle)) { - content::NavigationController* tab = tab_tracker_->GetResource(tab_handle); + NavigationController* tab = tab_tracker_->GetResource(tab_handle); LoginHandlerMap::iterator iter = login_handler_map_.find(tab); if (iter != login_handler_map_.end()) { @@ -750,7 +749,7 @@ void TestingAutomationProvider::NeedsAuth(int tab_handle, bool* needs_auth) { *needs_auth = false; if (tab_tracker_->ContainsHandle(tab_handle)) { - content::NavigationController* tab = tab_tracker_->GetResource(tab_handle); + NavigationController* tab = tab_tracker_->GetResource(tab_handle); LoginHandlerMap::iterator iter = login_handler_map_.find(tab); if (iter != login_handler_map_.end()) { @@ -766,7 +765,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)) { - content::NavigationController* tab = tab_tracker_->GetResource(tab_handle); + NavigationController* tab = tab_tracker_->GetResource(tab_handle); Profile* profile = Profile::FromBrowserContext(tab->GetBrowserContext()); HistoryService* history_service = profile->GetHistoryService(Profile::EXPLICIT_ACCESS); @@ -1286,7 +1285,7 @@ void TestingAutomationProvider::GetTabTitle(int handle, std::wstring* title) { *title_string_size = -1; // -1 is the error code if (tab_tracker_->ContainsHandle(handle)) { - content::NavigationController* tab = tab_tracker_->GetResource(handle); + NavigationController* tab = tab_tracker_->GetResource(handle); NavigationEntry* entry = tab->GetActiveEntry(); if (entry != NULL) { *title = UTF16ToWideHack(entry->GetTitleForDisplay("")); @@ -1301,7 +1300,7 @@ void TestingAutomationProvider::GetTabIndex(int handle, int* tabstrip_index) { *tabstrip_index = -1; // -1 is the error code if (tab_tracker_->ContainsHandle(handle)) { - content::NavigationController* tab = tab_tracker_->GetResource(handle); + NavigationController* tab = tab_tracker_->GetResource(handle); Browser* browser = Browser::GetBrowserForController(tab, NULL); *tabstrip_index = browser->tabstrip_model()->GetIndexOfController(tab); } @@ -1312,7 +1311,7 @@ void TestingAutomationProvider::GetTabURL(int handle, GURL* url) { *success = false; if (tab_tracker_->ContainsHandle(handle)) { - content::NavigationController* tab = tab_tracker_->GetResource(handle); + NavigationController* tab = tab_tracker_->GetResource(handle); // Return what the user would see in the location bar. *url = tab->GetActiveEntry()->GetVirtualURL(); *success = true; @@ -1401,7 +1400,7 @@ void TestingAutomationProvider::GetConstrainedWindowCount(int handle, int* count) { *count = -1; // -1 is the error code if (tab_tracker_->ContainsHandle(handle)) { - content::NavigationController* nav_controller = tab_tracker_->GetResource(handle); + NavigationController* nav_controller = tab_tracker_->GetResource(handle); WebContents* web_contents = nav_controller->GetWebContents(); if (web_contents) { TabContentsWrapper* wrapper = @@ -1431,7 +1430,7 @@ void TestingAutomationProvider::HandleInspectElementRequest( void TestingAutomationProvider::GetDownloadDirectory( int handle, FilePath* download_directory) { if (tab_tracker_->ContainsHandle(handle)) { - content::NavigationController* tab = tab_tracker_->GetResource(handle); + NavigationController* tab = tab_tracker_->GetResource(handle); DownloadManager* dlm = tab->GetBrowserContext()->GetDownloadManager(); *download_directory = DownloadPrefs::FromDownloadManager(dlm)->download_path(); @@ -1525,8 +1524,7 @@ void TestingAutomationProvider::ShowInterstitialPage( const std::string& html_text, IPC::Message* reply_message) { if (tab_tracker_->ContainsHandle(tab_handle)) { - content::NavigationController* controller = - tab_tracker_->GetResource(tab_handle); + NavigationController* controller = tab_tracker_->GetResource(tab_handle); WebContents* web_contents = controller->GetWebContents(); new NavigationNotificationObserver(controller, this, reply_message, 1, @@ -1559,7 +1557,7 @@ void TestingAutomationProvider::WaitForTabToBeRestored( int tab_handle, IPC::Message* reply_message) { if (tab_tracker_->ContainsHandle(tab_handle)) { - content::NavigationController* tab = tab_tracker_->GetResource(tab_handle); + NavigationController* tab = tab_tracker_->GetResource(tab_handle); restore_tracker_.reset( new NavigationControllerRestoredObserver(this, tab, reply_message)); } else { @@ -1576,7 +1574,7 @@ void TestingAutomationProvider::GetSecurityState( net::CertStatus* ssl_cert_status, int* insecure_content_status) { if (tab_tracker_->ContainsHandle(handle)) { - content::NavigationController* tab = tab_tracker_->GetResource(handle); + NavigationController* tab = tab_tracker_->GetResource(handle); NavigationEntry* entry = tab->GetActiveEntry(); *success = true; *security_style = entry->GetSSL().security_style; @@ -1595,7 +1593,7 @@ void TestingAutomationProvider::GetPageType( bool* success, content::PageType* page_type) { if (tab_tracker_->ContainsHandle(handle)) { - content::NavigationController* tab = tab_tracker_->GetResource(handle); + NavigationController* tab = tab_tracker_->GetResource(handle); NavigationEntry* entry = tab->GetActiveEntry(); *page_type = entry->GetPageType(); *success = true; @@ -1622,7 +1620,7 @@ void TestingAutomationProvider::ActionOnSSLBlockingPage( bool proceed, IPC::Message* reply_message) { if (tab_tracker_->ContainsHandle(handle)) { - content::NavigationController* tab = tab_tracker_->GetResource(handle); + NavigationController* tab = tab_tracker_->GetResource(handle); NavigationEntry* entry = tab->GetActiveEntry(); if (entry->GetPageType() == content::PAGE_TYPE_INTERSTITIAL) { WebContents* web_contents = tab->GetWebContents(); @@ -1672,7 +1670,7 @@ void TestingAutomationProvider::IsMenuCommandEnabled(int browser_handle, void TestingAutomationProvider::PrintNow(int tab_handle, IPC::Message* reply_message) { - content::NavigationController* tab = NULL; + NavigationController* tab = NULL; WebContents* web_contents = GetWebContentsForHandle(tab_handle, &tab); if (web_contents) { FindAndActivateTab(tab); @@ -1713,7 +1711,7 @@ void TestingAutomationProvider::SavePage(int tab_handle, return; } - content::NavigationController* nav = tab_tracker_->GetResource(tab_handle); + NavigationController* nav = tab_tracker_->GetResource(tab_handle); Browser* browser = FindAndActivateTab(nav); if (!browser->command_updater()->IsCommandEnabled(IDC_SAVE_PAGE)) { *success = false; @@ -1972,8 +1970,7 @@ 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)) { - content::NavigationController* nav_controller = - tab_tracker_->GetResource(handle); + NavigationController* nav_controller = tab_tracker_->GetResource(handle); if (nav_controller) { TabContentsWrapper* wrapper = TabContentsWrapper::GetCurrentWrapperForContents( @@ -1990,8 +1987,7 @@ void TestingAutomationProvider::ClickInfoBarAccept( IPC::Message* reply_message) { bool success = false; if (tab_tracker_->ContainsHandle(handle)) { - content::NavigationController* nav_controller = - tab_tracker_->GetResource(handle); + NavigationController* nav_controller = tab_tracker_->GetResource(handle); if (nav_controller) { InfoBarTabHelper* infobar_helper = TabContentsWrapper::GetCurrentWrapperForContents( @@ -2030,7 +2026,7 @@ void TestingAutomationProvider::GetLastNavigationTime( void TestingAutomationProvider::WaitForNavigation(int handle, int64 last_navigation_time, IPC::Message* reply_message) { - content::NavigationController* controller = tab_tracker_->GetResource(handle); + NavigationController* controller = tab_tracker_->GetResource(handle); base::Time time(tab_tracker_->GetLastNavigationTime(handle)); if (time.ToInternalValue() > last_navigation_time || !controller) { @@ -2161,7 +2157,7 @@ void TestingAutomationProvider::WaitForAppModalDialogToBeShown( void TestingAutomationProvider::GoBackBlockUntilNavigationsComplete( int handle, int number_of_navigations, IPC::Message* reply_message) { if (tab_tracker_->ContainsHandle(handle)) { - content::NavigationController* tab = tab_tracker_->GetResource(handle); + NavigationController* tab = tab_tracker_->GetResource(handle); Browser* browser = FindAndActivateTab(tab); if (browser && browser->command_updater()->IsCommandEnabled(IDC_BACK)) { new NavigationNotificationObserver(tab, this, reply_message, @@ -2179,7 +2175,7 @@ void TestingAutomationProvider::GoBackBlockUntilNavigationsComplete( void TestingAutomationProvider::GoForwardBlockUntilNavigationsComplete( int handle, int number_of_navigations, IPC::Message* reply_message) { if (tab_tracker_->ContainsHandle(handle)) { - content::NavigationController* tab = tab_tracker_->GetResource(handle); + NavigationController* tab = tab_tracker_->GetResource(handle); Browser* browser = FindAndActivateTab(tab); if (browser && browser->command_updater()->IsCommandEnabled(IDC_FORWARD)) { new NavigationNotificationObserver(tab, this, reply_message, @@ -2222,8 +2218,7 @@ 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)) { - content::NavigationController* nav_controller = - tab_tracker_->GetResource(handle); + NavigationController* nav_controller = tab_tracker_->GetResource(handle); TabContentsWrapper* tab_contents = TabContentsWrapper::GetCurrentWrapperForContents( nav_controller->GetWebContents()); @@ -2978,8 +2973,7 @@ void TestingAutomationProvider::GetNavigationInfo( return; } scoped_ptr<DictionaryValue> return_value(new DictionaryValue); - const content::NavigationController& controller = - web_contents->GetController(); + const NavigationController& controller = web_contents->GetController(); NavigationEntry* nav_entry = controller.GetActiveEntry(); DCHECK(nav_entry); @@ -3543,7 +3537,7 @@ void TestingAutomationProvider::OmniboxAcceptInput( Browser* browser, DictionaryValue* args, IPC::Message* reply_message) { - content::NavigationController& controller = + NavigationController& controller = browser->GetSelectedWebContents()->GetController(); new OmniboxAcceptNotificationObserver(&controller, this, reply_message); browser->window()->GetLocationBar()->AcceptInput(); @@ -6193,7 +6187,7 @@ void TestingAutomationProvider::GoForward( AutomationJSONReply(this, reply_message).SendError(error); return; } - content::NavigationController& controller = web_contents->GetController(); + NavigationController& controller = web_contents->GetController(); if (!controller.CanGoForward()) { DictionaryValue dict; dict.SetBoolean("did_go_forward", false); @@ -6217,7 +6211,7 @@ void TestingAutomationProvider::GoBack( AutomationJSONReply(this, reply_message).SendError(error); return; } - content::NavigationController& controller = web_contents->GetController(); + NavigationController& controller = web_contents->GetController(); if (!controller.CanGoBack()) { DictionaryValue dict; dict.SetBoolean("did_go_back", false); @@ -6241,7 +6235,7 @@ void TestingAutomationProvider::ReloadJSON( AutomationJSONReply(this, reply_message).SendError(error); return; } - content::NavigationController& controller = web_contents->GetController(); + NavigationController& controller = web_contents->GetController(); new NavigationNotificationObserver(&controller, this, reply_message, 1, false, true); controller.Reload(false); @@ -6570,8 +6564,7 @@ void TestingAutomationProvider::WaitForInfoBarCount( return; } - content::NavigationController* controller = - tab_tracker_->GetResource(tab_handle); + NavigationController* controller = tab_tracker_->GetResource(tab_handle); if (!controller) { AutomationMsg_WaitForInfoBarCount::WriteReplyParams(reply_message_, false); Send(reply_message_); @@ -6588,7 +6581,7 @@ void TestingAutomationProvider::WaitForInfoBarCount( void TestingAutomationProvider::GetPageCurrentEncoding( int tab_handle, std::string* current_encoding) { if (tab_tracker_->ContainsHandle(tab_handle)) { - content::NavigationController* nav = tab_tracker_->GetResource(tab_handle); + NavigationController* nav = tab_tracker_->GetResource(tab_handle); Browser* browser = FindAndActivateTab(nav); if (browser->command_updater()->IsCommandEnabled(IDC_ENCODING_MENU)) *current_encoding = nav->GetWebContents()->GetEncoding(); @@ -6634,7 +6627,7 @@ void TestingAutomationProvider::LoadBlockedPlugins(int tab_handle, bool* success) { *success = false; if (tab_tracker_->ContainsHandle(tab_handle)) { - content::NavigationController* nav = tab_tracker_->GetResource(tab_handle); + NavigationController* nav = tab_tracker_->GetResource(tab_handle); if (!nav) return; WebContents* contents = nav->GetWebContents(); @@ -6660,8 +6653,7 @@ void TestingAutomationProvider::GetParentBrowserOfTab(int tab_handle, bool* success) { *success = false; if (tab_tracker_->ContainsHandle(tab_handle)) { - content::NavigationController* controller = - tab_tracker_->GetResource(tab_handle); + 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 799548a..322f601 100644 --- a/chrome/browser/browser_focus_uitest.cc +++ b/chrome/browser/browser_focus_uitest.cc @@ -50,6 +50,7 @@ #include "base/string_util.h" #endif +using content::NavigationController; using content::WebContents; #if defined(OS_MACOSX) @@ -853,7 +854,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FocusOnReload) { { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController())); browser()->Reload(CURRENT_TAB); @@ -869,7 +870,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FocusOnReload) { { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController())); browser()->Reload(CURRENT_TAB); @@ -892,7 +893,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, DISABLED_FocusOnReloadCrashedTab) { { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController())); browser()->Reload(CURRENT_TAB); diff --git a/chrome/browser/browser_keyevents_browsertest.cc b/chrome/browser/browser_keyevents_browsertest.cc index c94ff75..80e6276 100644 --- a/chrome/browser/browser_keyevents_browsertest.cc +++ b/chrome/browser/browser_keyevents_browsertest.cc @@ -25,6 +25,8 @@ #include "net/test/test_server.h" #include "ui/base/keycodes/keyboard_codes.h" +using content::NavigationController; + namespace { const char kTestingPage[] = "files/keyevents_test.html"; @@ -712,7 +714,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, MAYBE_ReservedAccelerators) { ui_test_utils::WindowedNotificationObserver wait_for_tab_closed( content::NOTIFICATION_TAB_CLOSED, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &browser()->GetWebContentsAt(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 32aeaaf..1a50b31 100644 --- a/chrome/browser/chromeos/boot_times_loader.cc +++ b/chrome/browser/chromeos/boot_times_loader.cc @@ -33,11 +33,12 @@ #include "content/public/browser/web_contents.h" using content::BrowserThread; +using content::NavigationController; using content::WebContents; namespace { -RenderWidgetHost* GetRenderWidgetHost(content::NavigationController* tab) { +RenderWidgetHost* GetRenderWidgetHost(NavigationController* tab) { WebContents* web_contents = tab->GetWebContents(); if (web_contents) { RenderWidgetHostView* render_widget_host_view = @@ -440,8 +441,8 @@ void BootTimesLoader::Observe( break; } case content::NOTIFICATION_LOAD_START: { - content::NavigationController* tab = - content::Source<content::NavigationController>(source).ptr(); + NavigationController* tab = + content::Source<NavigationController>(source).ptr(); RenderWidgetHost* rwh = GetRenderWidgetHost(tab); DCHECK(rwh); AddLoginTimeMarker("TabLoad-Start: " + GetTabUrl(rwh), false); @@ -449,8 +450,8 @@ void BootTimesLoader::Observe( break; } case content::NOTIFICATION_LOAD_STOP: { - content::NavigationController* tab = - content::Source<content::NavigationController>(source).ptr(); + NavigationController* tab = + content::Source<NavigationController>(source).ptr(); RenderWidgetHost* rwh = GetRenderWidgetHost(tab); if (render_widget_hosts_loading_.find(rwh) != render_widget_hosts_loading_.end()) { diff --git a/chrome/browser/content_settings/tab_specific_content_settings.cc b/chrome/browser/content_settings/tab_specific_content_settings.cc index 33ab87d..959b5df 100644 --- a/chrome/browser/content_settings/tab_specific_content_settings.cc +++ b/chrome/browser/content_settings/tab_specific_content_settings.cc @@ -34,6 +34,7 @@ #include "webkit/fileapi/file_system_types.h" using content::BrowserThread; +using content::NavigationController; using content::NavigationEntry; using content::WebContents; @@ -469,8 +470,7 @@ void TabSpecificContentSettings::Observe( DCHECK(type == chrome::NOTIFICATION_CONTENT_SETTINGS_CHANGED); content::Details<const ContentSettingsDetails> settings_details(details); - const content::NavigationController& controller = - web_contents()->GetController(); + const NavigationController& controller = web_contents()->GetController(); NavigationEntry* entry = controller.GetActiveEntry(); GURL entry_url; if (entry) diff --git a/chrome/browser/crash_recovery_browsertest.cc b/chrome/browser/crash_recovery_browsertest.cc index 13d5b75..bcd4a342 100644 --- a/chrome/browser/crash_recovery_browsertest.cc +++ b/chrome/browser/crash_recovery_browsertest.cc @@ -14,6 +14,7 @@ #include "content/public/common/page_transition_types.h" #include "testing/gtest/include/gtest/gtest.h" +using content::NavigationController; using content::OpenURLParams; using content::Referrer; @@ -50,7 +51,7 @@ IN_PROC_BROWSER_TEST_F(CrashRecoveryBrowserTest, Reload) { SimulateRendererCrash(browser()); ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController())); browser()->Reload(CURRENT_TAB); @@ -80,7 +81,7 @@ IN_PROC_BROWSER_TEST_F(CrashRecoveryBrowserTest, LoadInNewTab) { SimulateRendererCrash(browser()); ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController())); browser()->Reload(CURRENT_TAB); diff --git a/chrome/browser/debugger/devtools_sanity_unittest.cc b/chrome/browser/debugger/devtools_sanity_unittest.cc index 0a65355..6f41933 100644 --- a/chrome/browser/debugger/devtools_sanity_unittest.cc +++ b/chrome/browser/debugger/devtools_sanity_unittest.cc @@ -41,6 +41,7 @@ using content::BrowserThread; using content::DevToolsManager; using content::DevToolsAgentHost; using content::DevToolsAgentHostRegistry; +using content::NavigationController; using content::WebContents; using content::WorkerService; using content::WorkerServiceObserver; @@ -414,7 +415,7 @@ class WorkerDevToolsSanityTest : public InProcessBrowserTest { if (client_contents->IsLoading()) { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &client_contents->GetController())); observer.Wait(); } @@ -527,7 +528,7 @@ IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestReattachAfterCrash) { ui_test_utils::CrashTab(GetInspectedTab()); ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController())); browser()->Reload(CURRENT_TAB); diff --git a/chrome/browser/debugger/devtools_window.cc b/chrome/browser/debugger/devtools_window.cc index d93c32d..110697a 100644 --- a/chrome/browser/debugger/devtools_window.cc +++ b/chrome/browser/debugger/devtools_window.cc @@ -58,6 +58,7 @@ using content::DevToolsAgentHost; using content::DevToolsAgentHostRegistry; using content::DevToolsClientHost; using content::DevToolsManager; +using content::NavigationController; using content::NavigationEntry; using content::OpenURLParams; using content::WebContents; @@ -206,12 +207,12 @@ DevToolsWindow::DevToolsWindow(TabContentsWrapper* tab_contents, registrar_.Add( this, content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &tab_contents_->web_contents()->GetController())); registrar_.Add( this, content::NOTIFICATION_TAB_CLOSING, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &tab_contents_->web_contents()->GetController())); registrar_.Add( this, @@ -383,7 +384,7 @@ bool DevToolsWindow::FindInspectedBrowserAndTabIndex(Browser** browser, if (!inspected_tab_) return false; - const content::NavigationController& controller = + const NavigationController& controller = inspected_tab_->tab_contents()->GetController(); for (BrowserList::const_iterator it = BrowserList::begin(); it != BrowserList::end(); ++it) { @@ -483,7 +484,7 @@ void DevToolsWindow::Observe(int type, DoAction(); AddDevToolsExtensionsToClient(); } else if (type == content::NOTIFICATION_TAB_CLOSING) { - if (content::Source<content::NavigationController>(source).ptr() == + if (content::Source<NavigationController>(source).ptr() == &tab_contents_->web_contents()->GetController()) { // This happens when browser closes all of its tabs as a result // of window.Close event. diff --git a/chrome/browser/download/download_request_limiter.cc b/chrome/browser/download/download_request_limiter.cc index 4264707..b5cc56e 100644 --- a/chrome/browser/download/download_request_limiter.cc +++ b/chrome/browser/download/download_request_limiter.cc @@ -21,6 +21,7 @@ #include "content/public/browser/web_contents_delegate.h" using content::BrowserThread; +using content::NavigationController; using content::NavigationEntry; using content::WebContents; @@ -28,15 +29,14 @@ using content::WebContents; DownloadRequestLimiter::TabDownloadState::TabDownloadState( DownloadRequestLimiter* host, - content::NavigationController* controller, - content::NavigationController* originating_controller) + NavigationController* controller, + NavigationController* originating_controller) : host_(host), controller_(controller), status_(DownloadRequestLimiter::ALLOW_ONE_DOWNLOAD), download_count_(0), infobar_(NULL) { - content::Source<content::NavigationController> notification_source( - controller); + content::Source<NavigationController> notification_source(controller); registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_PENDING, notification_source); registrar_.Add(this, content::NOTIFICATION_TAB_CLOSED, notification_source); @@ -103,8 +103,7 @@ void DownloadRequestLimiter::TabDownloadState::Observe( const content::NotificationDetails& details) { if ((type != content::NOTIFICATION_NAV_ENTRY_PENDING && type != content::NOTIFICATION_TAB_CLOSED) || - content::Source<content::NavigationController>(source).ptr() != - controller_) { + content::Source<NavigationController>(source).ptr() != controller_) { NOTREACHED(); return; } @@ -231,8 +230,8 @@ void DownloadRequestLimiter::SetTestingDelegate(TestingDelegate* delegate) { } DownloadRequestLimiter::TabDownloadState* DownloadRequestLimiter:: - GetDownloadState(content::NavigationController* controller, - content::NavigationController* originating_controller, + GetDownloadState(NavigationController* controller, + NavigationController* originating_controller, bool create) { DCHECK(controller); StateMap::iterator i = state_map_.find(controller); diff --git a/chrome/browser/errorpage_browsertest.cc b/chrome/browser/errorpage_browsertest.cc index 4351fce..431762f 100644 --- a/chrome/browser/errorpage_browsertest.cc +++ b/chrome/browser/errorpage_browsertest.cc @@ -15,6 +15,7 @@ #include "content/test/test_navigation_observer.h" using content::BrowserThread; +using content::NavigationController; class ErrorPageTest : public InProcessBrowserTest { public: @@ -81,7 +82,7 @@ class ErrorPageTest : public InProcessBrowserTest { ASCIIToUTF16(expected_title)); TestNavigationObserver test_navigation_observer( - content::Source<content::NavigationController>( + content::Source<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 45fe001..c1de458 100644 --- a/chrome/browser/extensions/app_process_apitest.cc +++ b/chrome/browser/extensions/app_process_apitest.cc @@ -24,6 +24,7 @@ #include "content/test/test_navigation_observer.h" #include "net/base/mock_host_resolver.h" +using content::NavigationController; using content::WebContents; class AppApiTest : public ExtensionApiTest { @@ -425,7 +426,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, DISABLED_ReloadIntoAppProcess) { EnableExtension(app->id()); ui_test_utils::WindowedNotificationObserver reload_observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController())); browser()->Reload(CURRENT_TAB); @@ -437,7 +438,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, DISABLED_ReloadIntoAppProcess) { DisableExtension(app->id()); ui_test_utils::WindowedNotificationObserver reload_observer2( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController())); browser()->Reload(CURRENT_TAB); @@ -449,7 +450,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<content::NavigationController>( + content::Source<NavigationController>( &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController())); ASSERT_TRUE(ui_test_utils::ExecuteJavaScript(contents->GetRenderViewHost(), @@ -462,7 +463,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<content::NavigationController>( + content::Source<NavigationController>( &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController())); ASSERT_TRUE(ui_test_utils::ExecuteJavaScript(contents->GetRenderViewHost(), @@ -516,8 +517,7 @@ 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<content::NavigationController>( - &(newtab->GetController()))); + content::Source<NavigationController>(&(newtab->GetController()))); observer.Wait(); } @@ -655,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<content::NavigationController>( + content::Source<NavigationController>( &browser()->GetSelectedTabContentsWrapper()->web_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 dc3777e..9fddf29 100644 --- a/chrome/browser/extensions/extension_browser_event_router.cc +++ b/chrome/browser/extensions/extension_browser_event_router.cc @@ -30,6 +30,7 @@ namespace events = extension_event_names; namespace tab_keys = extension_tabs_module_constants; namespace page_action_keys = extension_page_actions_module_constants; +using content::NavigationController; using content::WebContents; ExtensionBrowserEventRouter::TabEntry::TabEntry() @@ -149,8 +150,7 @@ void ExtensionBrowserEventRouter::RegisterForTabNotifications( WebContents* contents) { registrar_.Add( this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<content::NavigationController>( - &contents->GetController())); + content::Source<NavigationController>(&contents->GetController())); // Observing TAB_CONTENTS_DESTROYED is necessary because it's // possible for tabs to be created, detached and then destroyed without @@ -163,8 +163,7 @@ void ExtensionBrowserEventRouter::RegisterForTabNotifications( void ExtensionBrowserEventRouter::UnregisterForTabNotifications( WebContents* contents) { registrar_.Remove(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<content::NavigationController>( - &contents->GetController())); + content::Source<NavigationController>(&contents->GetController())); registrar_.Remove(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, content::Source<WebContents>(contents)); } @@ -542,15 +541,14 @@ void ExtensionBrowserEventRouter::Observe( const content::NotificationSource& source, const content::NotificationDetails& details) { if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) { - content::NavigationController* source_controller = - content::Source<content::NavigationController>(source).ptr(); + NavigationController* source_controller = + content::Source<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<content::NavigationController>( - &contents->GetController())); + content::Source<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 c0bc014..52b116f 100644 --- a/chrome/browser/extensions/extension_browsertests_misc.cc +++ b/chrome/browser/extensions/extension_browsertests_misc.cc @@ -38,6 +38,7 @@ #include "chrome/browser/ui/views/frame/browser_view.h" #endif +using content::NavigationController; using content::WebContents; const std::string kSubscribePage = "/subscribe.html"; @@ -811,7 +812,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, MAYBE_PluginLoadUnload) { { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController())); browser()->Reload(CURRENT_TAB); @@ -838,7 +839,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, MAYBE_PluginLoadUnload) { { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &browser()->GetSelectedTabContentsWrapper()->web_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 a63ea8d..553904e 100644 --- a/chrome/browser/extensions/extension_crash_recovery_browsertest.cc +++ b/chrome/browser/extensions/extension_crash_recovery_browsertest.cc @@ -23,6 +23,7 @@ #include "content/public/browser/web_contents.h" #include "content/public/common/result_codes.h" +using content::NavigationController; using content::WebContents; class ExtensionCrashRecoveryTest : public ExtensionBrowserTest { @@ -474,7 +475,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionCrashRecoveryTest, { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>( + content::Source<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 4af29cc..3b0559d 100644 --- a/chrome/browser/extensions/extension_navigation_observer.cc +++ b/chrome/browser/extensions/extension_navigation_observer.cc @@ -10,6 +10,7 @@ #include "content/public/browser/navigation_entry.h" #include "content/public/browser/notification_service.h" +using content::NavigationController; using content::NavigationEntry; ExtensionNavigationObserver::ExtensionNavigationObserver(Profile* profile) @@ -28,8 +29,8 @@ void ExtensionNavigationObserver::Observe( return; } - content::NavigationController* controller = - content::Source<content::NavigationController>(source).ptr(); + NavigationController* controller = + content::Source<NavigationController>(source).ptr(); if (!profile_->IsSameProfile( Profile::FromBrowserContext(controller->GetBrowserContext()))) return; @@ -43,7 +44,7 @@ void ExtensionNavigationObserver::RegisterForNotifications() { } void ExtensionNavigationObserver::PromptToEnableExtensionIfNecessary( - content::NavigationController* nav_controller) { + NavigationController* nav_controller) { // Bail out if we're already running a prompt. if (!in_progress_prompt_extension_id_.empty()) return; @@ -80,7 +81,7 @@ void ExtensionNavigationObserver::InstallUIProceed() { ExtensionService* extension_service = profile_->GetExtensionService(); const Extension* extension = extension_service->GetExtensionById( in_progress_prompt_extension_id_, true); - content::NavigationController* nav_controller = + NavigationController* nav_controller = in_progress_prompt_navigation_controller_; CHECK(extension); CHECK(nav_controller); diff --git a/chrome/browser/extensions/extension_tabs_module.cc b/chrome/browser/extensions/extension_tabs_module.cc index 4848529..6d75288 100644 --- a/chrome/browser/extensions/extension_tabs_module.cc +++ b/chrome/browser/extensions/extension_tabs_module.cc @@ -61,6 +61,7 @@ namespace keys = extension_tabs_module_constants; namespace errors = extension_manifest_errors; +using content::NavigationController; using content::NavigationEntry; using content::OpenURLParams; using content::Referrer; @@ -1072,8 +1073,7 @@ bool UpdateTabFunction::RunImpl() { NULL, &tab_strip, &contents, &tab_index, &error_)) { return false; } - content::NavigationController& controller = - contents->web_contents()->GetController(); + NavigationController& controller = contents->web_contents()->GetController(); // TODO(rafaelw): handle setting remaining tab properties: // -title @@ -1639,11 +1639,11 @@ bool DetectTabLanguageFunction::RunImpl() { content::Source<WebContents>(contents->web_contents())); registrar_.Add( this, content::NOTIFICATION_TAB_CLOSING, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &(contents->web_contents()->GetController()))); registrar_.Add( this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<content::NavigationController>( + content::Source<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 9a97fa4..43941c6 100644 --- a/chrome/browser/extensions/isolated_app_browsertest.cc +++ b/chrome/browser/extensions/isolated_app_browsertest.cc @@ -19,6 +19,7 @@ #include "content/public/browser/web_contents.h" #include "net/base/mock_host_resolver.h" +using content::NavigationController; using content::WebContents; namespace { @@ -121,7 +122,7 @@ IN_PROC_BROWSER_TEST_F(IsolatedAppTest, CookieIsolation) { ui_test_utils::CrashTab(tab1); ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController())); browser()->Reload(CURRENT_TAB); diff --git a/chrome/browser/extensions/webstore_installer.cc b/chrome/browser/extensions/webstore_installer.cc index c475c73..7b63d89 100644 --- a/chrome/browser/extensions/webstore_installer.cc +++ b/chrome/browser/extensions/webstore_installer.cc @@ -34,6 +34,7 @@ using content::BrowserThread; using content::DownloadFile; +using content::NavigationController; namespace { @@ -104,7 +105,7 @@ void GetDownloadFilePath(const std::string& id, WebstoreInstaller::WebstoreInstaller(Profile* profile, Delegate* delegate, - content::NavigationController* controller, + NavigationController* controller, const std::string& id, int flags) : profile_(profile), diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc index 6a948b1..9bae4f2 100644 --- a/chrome/browser/external_tab_container_win.cc +++ b/chrome/browser/external_tab_container_win.cc @@ -67,6 +67,7 @@ #include "ui/views/layout/grid_layout.h" using content::BrowserThread; +using content::NavigationController; using content::NavigationEntry; using content::OpenURLParams; using content::SSLStatus; @@ -201,14 +202,14 @@ bool ExternalTabContainer::Init(Profile* profile, content::BINDINGS_POLICY_EXTERNAL_HOST); } - content::NavigationController* controller = + NavigationController* controller = &tab_contents_->web_contents()->GetController(); registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<content::NavigationController>(controller)); + content::Source<NavigationController>(controller)); registrar_.Add(this, content::NOTIFICATION_FAIL_PROVISIONAL_LOAD_WITH_ERROR, - content::Source<content::NavigationController>(controller)); + content::Source<NavigationController>(controller)); registrar_.Add(this, content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>(controller)); + content::Source<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, @@ -258,7 +259,7 @@ void ExternalTabContainer::Uninitialize() { content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTERNAL_TAB_CLOSED, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &tab_contents_->web_contents()->GetController()), content::Details<ExternalTabContainer>(this)); diff --git a/chrome/browser/favicon/favicon_tab_helper.cc b/chrome/browser/favicon/favicon_tab_helper.cc index d6c74d3..2c09c75 100644 --- a/chrome/browser/favicon/favicon_tab_helper.cc +++ b/chrome/browser/favicon/favicon_tab_helper.cc @@ -23,6 +23,7 @@ #include "ui/gfx/image/image.h" using content::FaviconStatus; +using content::NavigationController; using content::NavigationEntry; using content::WebContents; @@ -48,8 +49,7 @@ void FaviconTabHelper::FetchFavicon(const GURL& url) { SkBitmap FaviconTabHelper::GetFavicon() const { // Like GetTitle(), we also want to use the favicon for the last committed // entry rather than a pending navigation entry. - const content::NavigationController& controller = - web_contents()->GetController(); + const NavigationController& controller = web_contents()->GetController(); NavigationEntry* entry = controller.GetTransientEntry(); if (entry) return entry->GetFavicon().bitmap; @@ -61,8 +61,7 @@ SkBitmap FaviconTabHelper::GetFavicon() const { } bool FaviconTabHelper::FaviconIsValid() const { - const content::NavigationController& controller = - web_contents()->GetController(); + const NavigationController& controller = web_contents()->GetController(); NavigationEntry* entry = controller.GetTransientEntry(); if (entry) return entry->GetFavicon().valid; @@ -76,8 +75,7 @@ bool FaviconTabHelper::FaviconIsValid() const { bool FaviconTabHelper::ShouldDisplayFavicon() { // Always display a throbber during pending loads. - const content::NavigationController& controller = - web_contents()->GetController(); + const NavigationController& controller = web_contents()->GetController(); if (controller.GetLastCommittedEntry() && controller.GetPendingEntry()) return true; @@ -156,8 +154,8 @@ void FaviconTabHelper::NotifyFaviconUpdated() { void FaviconTabHelper::NavigateToPendingEntry( const GURL& url, - content::NavigationController::ReloadType reload_type) { - if (reload_type != content::NavigationController::NO_RELOAD && + NavigationController::ReloadType reload_type) { + if (reload_type != NavigationController::NO_RELOAD && !profile_->IsOffTheRecord()) { FaviconService* favicon_service = profile_->GetFaviconService(Profile::IMPLICIT_ACCESS); diff --git a/chrome/browser/geolocation/geolocation_browsertest.cc b/chrome/browser/geolocation/geolocation_browsertest.cc index 3c2cc59..7d5cd85 100644 --- a/chrome/browser/geolocation/geolocation_browsertest.cc +++ b/chrome/browser/geolocation/geolocation_browsertest.cc @@ -35,6 +35,7 @@ #include "net/base/net_util.h" #include "net/test/test_server.h" +using content::NavigationController; using content::WebContents; namespace { @@ -48,10 +49,10 @@ class IFrameLoader : public content::NotificationObserver { IFrameLoader(Browser* browser, int iframe_id, const GURL& url) : navigation_completed_(false), javascript_completed_(false) { - content::NavigationController* controller = + NavigationController* controller = &browser->GetSelectedWebContents()->GetController(); registrar_.Add(this, content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>(controller)); + content::Source<NavigationController>(controller)); registrar_.Add(this, chrome::NOTIFICATION_DOM_OPERATION_RESPONSE, content::NotificationService::AllSources()); std::string script = base::StringPrintf( @@ -326,7 +327,7 @@ class GeolocationBrowserTest : public InProcessBrowserTest { { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &tab_contents_wrapper->web_contents()->GetController())); if (allowed) infobar_->AsConfirmInfoBarDelegate()->Accept(); @@ -509,7 +510,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<content::NavigationController>( + content::Source<NavigationController>( ¤t_browser_->GetSelectedWebContents()->GetController())); NotifyGeoposition(fresh_position); observer.Wait(); @@ -546,7 +547,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<content::NavigationController>( + content::Source<NavigationController>( ¤t_browser_->GetSelectedWebContents()->GetController())); NotifyGeoposition(cached_position); observer.Wait(); @@ -654,7 +655,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<content::NavigationController>( + content::Source<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 1270095..2df3568 100644 --- a/chrome/browser/google/google_url_tracker.cc +++ b/chrome/browser/google/google_url_tracker.cc @@ -32,6 +32,7 @@ #include "net/url_request/url_request_status.h" #include "ui/base/l10n/l10n_util.h" +using content::NavigationController; using content::OpenURLParams; using content::Referrer; using content::WebContents; @@ -323,8 +324,8 @@ void GoogleURLTracker::Observe(int type, const content::NotificationDetails& details) { switch (type) { case content::NOTIFICATION_NAV_ENTRY_PENDING: { - content::NavigationController* controller = - content::Source<content::NavigationController>(source).ptr(); + NavigationController* controller = + content::Source<NavigationController>(source).ptr(); OnNavigationPending(source, controller->GetPendingEntry()->GetURL()); break; } @@ -332,7 +333,7 @@ void GoogleURLTracker::Observe(int type, case content::NOTIFICATION_NAV_ENTRY_COMMITTED: case content::NOTIFICATION_TAB_CLOSED: OnNavigationCommittedOrTabClosed( - content::Source<content::NavigationController>(source).ptr()-> + content::Source<NavigationController>(source).ptr()-> GetWebContents(), type); break; @@ -358,16 +359,16 @@ void GoogleURLTracker::SearchCommitted() { void GoogleURLTracker::OnNavigationPending( const content::NotificationSource& source, const GURL& pending_url) { - controller_ = content::Source<content::NavigationController>(source).ptr(); + controller_ = content::Source<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<content::NavigationController>(controller_)); + content::Source<NavigationController>(controller_)); registrar_.Add(this, content::NOTIFICATION_TAB_CLOSED, - content::Source<content::NavigationController>(controller_)); + content::Source<NavigationController>(controller_)); } void GoogleURLTracker::OnNavigationCommittedOrTabClosed( diff --git a/chrome/browser/history/top_sites.cc b/chrome/browser/history/top_sites.cc index 96c9099a..cd7debc 100644 --- a/chrome/browser/history/top_sites.cc +++ b/chrome/browser/history/top_sites.cc @@ -42,6 +42,7 @@ #include "ui/gfx/image/image_util.h" using content::BrowserThread; +using content::NavigationController; namespace history { @@ -845,8 +846,8 @@ void TopSites::Observe(int type, } StartQueryForMostVisited(); } else if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) { - content::NavigationController* controller = - content::Source<content::NavigationController>(source).ptr(); + NavigationController* controller = + content::Source<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 ce08e27..d2a4d55 100644 --- a/chrome/browser/infobars/infobar_tab_helper.cc +++ b/chrome/browser/infobars/infobar_tab_helper.cc @@ -13,6 +13,7 @@ #include "content/public/browser/notification_service.h" #include "content/public/browser/web_contents.h" +using content::NavigationController; using content::WebContents; InfoBarTabHelper::InfoBarTabHelper(WebContents* web_contents) @@ -58,7 +59,7 @@ void InfoBarTabHelper::AddInfoBar(InfoBarDelegate* delegate) { if (infobars_.size() == 1) { registrar_.Add( this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &web_contents()->GetController())); } } @@ -124,7 +125,7 @@ void InfoBarTabHelper::RemoveInfoBarInternal(InfoBarDelegate* delegate, if (infobars_.empty()) { registrar_.Remove( this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &web_contents()->GetController())); } } @@ -183,7 +184,7 @@ void InfoBarTabHelper::Observe(int type, switch (type) { case content::NOTIFICATION_NAV_ENTRY_COMMITTED: { DCHECK(&web_contents()->GetController() == - content::Source<content::NavigationController>(source).ptr()); + content::Source<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 b7cb3c4..9f44950 100644 --- a/chrome/browser/instant/instant_loader.cc +++ b/chrome/browser/instant/instant_loader.cc @@ -52,6 +52,7 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/codec/png_codec.h" +using content::NavigationController; using content::NavigationEntry; using content::WebContents; @@ -296,7 +297,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<content::NavigationController>( + content::Source<NavigationController>( &loader->preview_contents()->web_contents()->GetController())); } @@ -779,7 +780,7 @@ TabContentsWrapper* InstantLoader::ReleasePreviewContents( registrar_.Remove( this, content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &preview_contents_->web_contents()->GetController())); #endif } @@ -999,13 +1000,13 @@ void InstantLoader::ReplacePreviewContents(TabContentsWrapper* old_tc, registrar_.Remove( this, content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &old_tc->web_contents()->GetController())); #endif registrar_.Remove( this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &old_tc->web_contents()->GetController())); // We prerendered so we should be ready to show. If we're ready, swap in @@ -1045,14 +1046,14 @@ void InstantLoader::SetupPreviewContents(TabContentsWrapper* tab_contents) { registrar_.Add( this, content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &preview_contents_->web_contents()->GetController())); #endif registrar_.Add( this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<content::NavigationController>( + content::Source<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 dc6725f..5cf0591 100644 --- a/chrome/browser/omnibox_search_hint.cc +++ b/chrome/browser/omnibox_search_hint.cc @@ -38,6 +38,7 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" +using content::NavigationController; using content::NavigationEntry; // The URLs of search engines for which we want to trigger the infobar. @@ -154,12 +155,11 @@ bool HintInfoBar::Accept() { // OmniboxSearchHint ---------------------------------------------------------- OmniboxSearchHint::OmniboxSearchHint(TabContentsWrapper* tab) : tab_(tab) { - content::NavigationController* controller = - &(tab->web_contents()->GetController()); + NavigationController* controller = &(tab->web_contents()->GetController()); notification_registrar_.Add( this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<content::NavigationController>(controller)); + content::Source<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; diff --git a/chrome/browser/prerender/prerender_browsertest.cc b/chrome/browser/prerender/prerender_browsertest.cc index 73eab87..1c7f99d 100644 --- a/chrome/browser/prerender/prerender_browsertest.cc +++ b/chrome/browser/prerender/prerender_browsertest.cc @@ -50,6 +50,7 @@ using content::DevToolsAgentHost; using content::DevToolsAgentHostRegistry; using content::DevToolsClientHost; using content::DevToolsManager; +using content::NavigationController; using content::OpenURLParams; using content::Referrer; using content::WebContents; @@ -587,7 +588,7 @@ class PrerenderBrowserTest : public InProcessBrowserTest { EXPECT_FALSE(tab->IsLoading()); ui_test_utils::WindowedNotificationObserver back_nav_observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>(&tab->GetController())); + content::Source<NavigationController>(&tab->GetController())); browser->GoBack(CURRENT_TAB); back_nav_observer.Wait(); bool js_result; @@ -766,7 +767,7 @@ class PrerenderBrowserTest : public InProcessBrowserTest { page_load_observer.reset( new ui_test_utils::WindowedNotificationObserver( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &tab_contents->GetController()))); } diff --git a/chrome/browser/printing/print_dialog_cloud.cc b/chrome/browser/printing/print_dialog_cloud.cc index bdb3ad3..69c66e4 100644 --- a/chrome/browser/printing/print_dialog_cloud.cc +++ b/chrome/browser/printing/print_dialog_cloud.cc @@ -106,6 +106,7 @@ // bringing up the dialog) isn't what we want. using content::BrowserThread; +using content::NavigationController; using content::NavigationEntry; using content::WebContents; using content::WebUIMessageHandler; @@ -303,7 +304,7 @@ void CloudPrintFlowHandler::RegisterMessages() { // Register for appropriate notifications, and re-direct the URL // to the real server URL, now that we've gotten an HTML dialog // going. - content::NavigationController* controller = + NavigationController* controller = &web_ui()->web_contents()->GetController(); NavigationEntry* pending_entry = controller->GetPendingEntry(); if (pending_entry) { @@ -312,7 +313,7 @@ void CloudPrintFlowHandler::RegisterMessages() { CloudPrintURL(profile).GetCloudPrintServiceDialogURL()); } registrar_.Add(this, content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>(controller)); + content::Source<NavigationController>(controller)); } void CloudPrintFlowHandler::Observe( diff --git a/chrome/browser/printing/print_preview_message_handler.cc b/chrome/browser/printing/print_preview_message_handler.cc index 85e84f8..e4a4d77 100644 --- a/chrome/browser/printing/print_preview_message_handler.cc +++ b/chrome/browser/printing/print_preview_message_handler.cc @@ -25,6 +25,7 @@ #include "printing/print_job_constants.h" using content::BrowserThread; +using content::NavigationController; namespace { @@ -246,13 +247,13 @@ bool PrintPreviewMessageHandler::OnMessageReceived( void PrintPreviewMessageHandler::NavigateToPendingEntry( const GURL& url, - content::NavigationController::ReloadType reload_type) { + NavigationController::ReloadType reload_type) { TabContentsWrapper* tab = tab_contents_wrapper(); TabContentsWrapper* preview_tab = GetPrintPreviewTab(); if (tab == preview_tab) { // Cloud print sign-in reloads the page. DCHECK(PrintPreviewTabController::IsPrintPreviewURL(url)); - DCHECK_EQ(content::NavigationController::RELOAD, reload_type); + DCHECK_EQ(NavigationController::RELOAD, reload_type); return; } // If |tab| is navigating and it has a print preview tab, notify |tab| to diff --git a/chrome/browser/printing/print_preview_tab_controller.cc b/chrome/browser/printing/print_preview_tab_controller.cc index 3b2bfad..d666c05 100644 --- a/chrome/browser/printing/print_preview_tab_controller.cc +++ b/chrome/browser/printing/print_preview_tab_controller.cc @@ -40,6 +40,7 @@ #include "content/public/browser/render_process_host.h" #include "webkit/plugins/webplugininfo.h" +using content::NavigationController; using content::WebContents; using content::WebUIMessageHandler; @@ -222,8 +223,8 @@ void PrintPreviewTabController::Observe( break; } case content::NOTIFICATION_NAV_ENTRY_COMMITTED: { - content::NavigationController* controller = - content::Source<content::NavigationController>(source).ptr(); + NavigationController* controller = + content::Source<NavigationController>(source).ptr(); TabContentsWrapper* wrapper = TabContentsWrapper::GetCurrentWrapperForContents( controller->GetWebContents()); @@ -416,8 +417,7 @@ void PrintPreviewTabController::AddObservers(TabContentsWrapper* tab) { content::Source<WebContents>(contents)); registrar_.Add( this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<content::NavigationController>( - &contents->GetController())); + content::Source<NavigationController>(&contents->GetController())); // Multiple sites may share the same RenderProcessHost, so check if this // notification has already been added. @@ -437,8 +437,7 @@ void PrintPreviewTabController::RemoveObservers(TabContentsWrapper* tab) { content::Source<WebContents>(contents)); registrar_.Remove( this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<content::NavigationController>( - &contents->GetController())); + content::Source<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 b1874d5..794d3a7 100644 --- a/chrome/browser/repost_form_warning_controller.cc +++ b/chrome/browser/repost_form_warning_controller.cc @@ -17,6 +17,7 @@ #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" +using content::NavigationController; using content::WebContents; RepostFormWarningController::RepostFormWarningController( @@ -24,7 +25,7 @@ RepostFormWarningController::RepostFormWarningController( : TabModalConfirmDialogDelegate(web_contents), navigation_controller_(&web_contents->GetController()) { registrar_.Add(this, content::NOTIFICATION_REPOST_WARNING_SHOWN, - content::Source<content::NavigationController>( + content::Source<NavigationController>( navigation_controller_)); } diff --git a/chrome/browser/safe_browsing/browser_feature_extractor.cc b/chrome/browser/safe_browsing/browser_feature_extractor.cc index de42d04..4c694c4 100644 --- a/chrome/browser/safe_browsing/browser_feature_extractor.cc +++ b/chrome/browser/safe_browsing/browser_feature_extractor.cc @@ -29,6 +29,7 @@ #include "googleurl/src/gurl.h" using content::BrowserThread; +using content::NavigationController; using content::NavigationEntry; using content::WebContents; @@ -51,7 +52,7 @@ static void AddFeature(const std::string& feature_name, static void AddNavigationFeatures( const std::string& feature_prefix, - const content::NavigationController& controller, + const NavigationController& controller, int index, const std::vector<GURL>& redirect_chain, ClientPhishingRequest* request) { @@ -156,7 +157,7 @@ void BrowserFeatureExtractor::ExtractFeatures(const BrowseInfo* info, } // Extract features pertaining to this navigation. - const content::NavigationController& controller = tab_->GetController(); + const NavigationController& controller = tab_->GetController(); int url_index = -1; int first_host_index = -1; 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 0195c7e..0df79d6 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc @@ -27,6 +27,7 @@ #include "content/test/test_browser_thread.h" using content::BrowserThread; +using content::NavigationController; using content::WebContents; // A SafeBrowingService class that allows us to inject the malicious URLs. @@ -430,7 +431,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<content::NavigationController>( + content::Source<NavigationController>( &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController())); SendCommand("\"proceed\""); // Simulate the user clicking "proceed" @@ -462,7 +463,7 @@ IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageTest, PhishingProceed) { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController())); SendCommand("\"proceed\""); // Simulate the user clicking "proceed". @@ -481,7 +482,7 @@ IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageTest, PhishingReportError) { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController())); SendCommand("\"reportError\""); // Simulate the user clicking "report error" @@ -504,7 +505,7 @@ IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageTest, ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController())); SendCommand("\"learnMore\""); // Simulate the user clicking "learn more" @@ -527,7 +528,7 @@ IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageTest, MalwareIframeDontProceed) { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<content::NavigationController>( + content::Source<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 48e7385..88d7b36 100644 --- a/chrome/browser/sessions/session_restore.cc +++ b/chrome/browser/sessions/session_restore.cc @@ -42,6 +42,7 @@ #include "chrome/browser/chromeos/boot_times_loader.h" #endif +using content::NavigationController; using content::WebContents; // Are we in the process of restoring? @@ -69,11 +70,11 @@ class TabLoader : public content::NotificationObserver, virtual ~TabLoader(); // Schedules a tab for loading. - void ScheduleLoad(content::NavigationController* controller); + void ScheduleLoad(NavigationController* controller); // Notifies the loader that a tab has been scheduled for loading through // some other mechanism. - void TabIsLoading(content::NavigationController* controller); + void TabIsLoading(NavigationController* controller); // Invokes |LoadNextTab| to load a tab. // @@ -81,8 +82,8 @@ class TabLoader : public content::NotificationObserver, void StartLoading(); private: - typedef std::set<content::NavigationController*> TabsLoading; - typedef std::list<content::NavigationController*> TabsToLoad; + typedef std::set<NavigationController*> TabsLoading; + typedef std::list<NavigationController*> TabsToLoad; typedef std::set<RenderWidgetHost*> RenderWidgetHostSet; // Loads the next tab. If there are no more tabs to load this deletes itself, @@ -101,7 +102,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(content::NavigationController* tab); + void RemoveTab(NavigationController* tab); // Invoked from |force_load_timer_|. Doubles |force_load_delay_| and invokes // |LoadNextTab| to load the next tab @@ -109,14 +110,13 @@ class TabLoader : public content::NotificationObserver, // Returns the RenderWidgetHost associated with a tab if there is one, // NULL otherwise. - static RenderWidgetHost* GetRenderWidgetHost( - content::NavigationController* tab); + static RenderWidgetHost* GetRenderWidgetHost(NavigationController* tab); // Register for necessary notificaitons on a tab navigation controller. - void RegisterForNotifications(content::NavigationController* controller); + void RegisterForNotifications(NavigationController* controller); // Called when a tab goes away or a load completes. - void HandleTabClosedOrLoaded(content::NavigationController* controller); + void HandleTabClosedOrLoaded(NavigationController* controller); content::NotificationRegistrar registrar_; @@ -168,7 +168,7 @@ TabLoader::~TabLoader() { net::NetworkChangeNotifier::RemoveOnlineStateObserver(this); } -void TabLoader::ScheduleLoad(content::NavigationController* controller) { +void TabLoader::ScheduleLoad(NavigationController* controller) { DCHECK(controller); DCHECK(find(tabs_to_load_.begin(), tabs_to_load_.end(), controller) == tabs_to_load_.end()); @@ -176,7 +176,7 @@ void TabLoader::ScheduleLoad(content::NavigationController* controller) { RegisterForNotifications(controller); } -void TabLoader::TabIsLoading(content::NavigationController* controller) { +void TabLoader::TabIsLoading(NavigationController* controller) { DCHECK(controller); DCHECK(find(tabs_loading_.begin(), tabs_loading_.end(), controller) == tabs_loading_.end()); @@ -205,7 +205,7 @@ void TabLoader::StartLoading() { void TabLoader::LoadNextTab() { if (!tabs_to_load_.empty()) { - content::NavigationController* tab = tabs_to_load_.front(); + NavigationController* tab = tabs_to_load_.front(); DCHECK(tab); tabs_loading_.insert(tab); tabs_to_load_.pop_front(); @@ -244,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. - content::NavigationController* tab = - content::Source<content::NavigationController>(source).ptr(); + NavigationController* tab = + content::Source<NavigationController>(source).ptr(); RenderWidgetHost* render_widget_host = GetRenderWidgetHost(tab); DCHECK(render_widget_host); render_widget_hosts_loading_.insert(render_widget_host); @@ -262,8 +262,8 @@ void TabLoader::Observe(int type, break; } case content::NOTIFICATION_LOAD_STOP: { - content::NavigationController* tab = - content::Source<content::NavigationController>(source).ptr(); + NavigationController* tab = + content::Source<NavigationController>(source).ptr(); render_widget_hosts_to_paint_.insert(GetRenderWidgetHost(tab)); HandleTabClosedOrLoaded(tab); break; @@ -328,13 +328,13 @@ void TabLoader::OnOnlineStateChanged(bool online) { } } -void TabLoader::RemoveTab(content::NavigationController* tab) { +void TabLoader::RemoveTab(NavigationController* tab) { registrar_.Remove(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, content::Source<WebContents>(tab->GetWebContents())); registrar_.Remove(this, content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>(tab)); + content::Source<NavigationController>(tab)); registrar_.Remove(this, content::NOTIFICATION_LOAD_START, - content::Source<content::NavigationController>(tab)); + content::Source<NavigationController>(tab)); TabsLoading::iterator i = tabs_loading_.find(tab); if (i != tabs_loading_.end()) @@ -351,8 +351,7 @@ void TabLoader::ForceLoadTimerFired() { LoadNextTab(); } -RenderWidgetHost* TabLoader::GetRenderWidgetHost( - content::NavigationController* tab) { +RenderWidgetHost* TabLoader::GetRenderWidgetHost(NavigationController* tab) { WebContents* web_contents = tab->GetWebContents(); if (web_contents) { RenderWidgetHostView* render_widget_host_view = @@ -363,18 +362,17 @@ RenderWidgetHost* TabLoader::GetRenderWidgetHost( return NULL; } -void TabLoader::RegisterForNotifications( - content::NavigationController* controller) { +void TabLoader::RegisterForNotifications(NavigationController* controller) { registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, content::Source<WebContents>(controller->GetWebContents())); registrar_.Add(this, content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>(controller)); + content::Source<NavigationController>(controller)); registrar_.Add(this, content::NOTIFICATION_LOAD_START, - content::Source<content::NavigationController>(controller)); + content::Source<NavigationController>(controller)); ++tab_count_; } -void TabLoader::HandleTabClosedOrLoaded(content::NavigationController* tab) { +void TabLoader::HandleTabClosedOrLoaded(NavigationController* tab) { RemoveTab(tab); if (loading_) LoadNextTab(); diff --git a/chrome/browser/sessions/tab_restore_service.cc b/chrome/browser/sessions/tab_restore_service.cc index 50de7c0..ff2c6d9 100644 --- a/chrome/browser/sessions/tab_restore_service.cc +++ b/chrome/browser/sessions/tab_restore_service.cc @@ -32,6 +32,7 @@ #include "content/public/browser/web_contents.h" using base::Time; +using content::NavigationController; using content::NavigationEntry; using content::WebContents; @@ -218,7 +219,7 @@ void TabRestoreService::RemoveObserver(TabRestoreServiceObserver* observer) { observer_list_.RemoveObserver(observer); } -void TabRestoreService::CreateHistoricalTab(content::NavigationController* tab, +void TabRestoreService::CreateHistoricalTab(NavigationController* tab, int index) { if (restoring_) return; @@ -486,7 +487,7 @@ void TabRestoreService::Save() { void TabRestoreService::PopulateTab(Tab* tab, int index, TabRestoreServiceDelegate* delegate, - content::NavigationController* controller) { + NavigationController* controller) { const int pending_index = controller->GetPendingEntryIndex(); int entry_count = controller->GetEntryCount(); if (entry_count == 0 && pending_index == 0) diff --git a/chrome/browser/sidebar/sidebar_browsertest.cc b/chrome/browser/sidebar/sidebar_browsertest.cc index bdafed8..5172ca3 100644 --- a/chrome/browser/sidebar/sidebar_browsertest.cc +++ b/chrome/browser/sidebar/sidebar_browsertest.cc @@ -23,6 +23,8 @@ #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/profiles/profile.h" +using content::NavigationController; + namespace { const char kSimplePage[] = "files/sidebar/simple_page.html"; @@ -79,7 +81,7 @@ class SidebarTest : public ExtensionBrowserTest { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>( + content::Source<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 ad30ac9..76442f9 100644 --- a/chrome/browser/ssl/ssl_blocking_page.cc +++ b/chrome/browser/ssl/ssl_blocking_page.cc @@ -28,6 +28,7 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" +using content::NavigationController; using content::NavigationEntry; namespace { @@ -124,7 +125,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<content::NavigationController>(&tab()->GetController()), + content::Source<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 5b125a4..7c0cd06 100644 --- a/chrome/browser/ssl/ssl_browser_tests.cc +++ b/chrome/browser/ssl/ssl_browser_tests.cc @@ -25,6 +25,7 @@ #include "net/base/cert_status_flags.h" #include "net/test/test_server.h" +using content::NavigationController; using content::NavigationEntry; using content::SSLStatus; using content::WebContents; @@ -141,7 +142,7 @@ class SSLUITest : public InProcessBrowserTest { ASSERT_TRUE(interstitial_page); ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>(&tab->GetController())); + content::Source<NavigationController>(&tab->GetController())); interstitial_page->Proceed(); observer.Wait(); } @@ -450,7 +451,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestHTTPSExpiredCertAndGoForward) { { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>(&tab->GetController())); + content::Source<NavigationController>(&tab->GetController())); tab->GetController().GoBack(); observer.Wait(); } @@ -468,7 +469,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestHTTPSExpiredCertAndGoForward) { { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>(&tab->GetController())); + content::Source<NavigationController>(&tab->GetController())); tab->GetController().GoToOffset(1); observer.Wait(); } @@ -1052,7 +1053,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestGoodFrameNavigation) { { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>(&tab->GetController())); + content::Source<NavigationController>(&tab->GetController())); EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( tab->GetRenderViewHost(), std::wstring(), L"window.domAutomationController.send(clickLink('goodHTTPSLink'));", @@ -1068,7 +1069,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestGoodFrameNavigation) { { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>(&tab->GetController())); + content::Source<NavigationController>(&tab->GetController())); EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( tab->GetRenderViewHost(), std::wstring(), L"window.domAutomationController.send(clickLink('badHTTPSLink'));", @@ -1094,7 +1095,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestGoodFrameNavigation) { { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>(&tab->GetController())); + content::Source<NavigationController>(&tab->GetController())); tab->GetController().GoBack(); observer.Wait(); } @@ -1104,7 +1105,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestGoodFrameNavigation) { { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>(&tab->GetController())); + content::Source<NavigationController>(&tab->GetController())); EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( tab->GetRenderViewHost(), std::wstring(), L"window.domAutomationController.send(clickLink('HTTPLink'));", @@ -1120,7 +1121,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestGoodFrameNavigation) { { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>(&tab->GetController())); + content::Source<NavigationController>(&tab->GetController())); tab->GetController().GoBack(); observer.Wait(); } @@ -1152,7 +1153,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestBadFrameNavigation) { bool success = false; ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>(&tab->GetController())); + content::Source<NavigationController>(&tab->GetController())); EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( tab->GetRenderViewHost(), std::wstring(), L"window.domAutomationController.send(clickLink('goodHTTPSLink'));", @@ -1189,7 +1190,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestUnauthenticatedFrameNavigation) { bool success = false; ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>(&tab->GetController())); + content::Source<NavigationController>(&tab->GetController())); EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( tab->GetRenderViewHost(), std::wstring(), L"window.domAutomationController.send(clickLink('goodHTTPSLink'));", @@ -1206,7 +1207,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestUnauthenticatedFrameNavigation) { bool success = false; ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>(&tab->GetController())); + content::Source<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 79035bc..4cefc2a 100644 --- a/chrome/browser/sync/glue/session_change_processor.cc +++ b/chrome/browser/sync/glue/session_change_processor.cc @@ -27,6 +27,7 @@ #include "content/public/browser/web_contents.h" using content::BrowserThread; +using content::NavigationController; using content::WebContents; namespace browser_sync { @@ -38,8 +39,7 @@ namespace { SyncedTabDelegate* ExtractSyncedTabDelegate( const content::NotificationSource& source) { TabContentsWrapper* tab = TabContentsWrapper::GetCurrentWrapperForContents( - content::Source<content::NavigationController>(source).ptr()-> - GetWebContents()); + content::Source<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 c9dd131..1189a56 100644 --- a/chrome/browser/tabs/tab_strip_model.cc +++ b/chrome/browser/tabs/tab_strip_model.cc @@ -35,6 +35,7 @@ #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_delegate.h" +using content::NavigationController; using content::NavigationEntry; using content::UserMetricsAction; using content::WebContents; @@ -389,7 +390,7 @@ int TabStripModel::GetWrapperIndex(const WebContents* contents) const { } int TabStripModel::GetIndexOfController( - const content::NavigationController* controller) const { + const NavigationController* controller) const { int index = 0; TabContentsDataVector::const_iterator iter = contents_data_.begin(); for (; iter != contents_data_.end(); ++iter, ++index) { @@ -433,14 +434,13 @@ bool TabStripModel::TabsAreLoading() const { return false; } -content::NavigationController* TabStripModel::GetOpenerOfTabContentsAt( - int index) { +NavigationController* TabStripModel::GetOpenerOfTabContentsAt(int index) { DCHECK(ContainsIndex(index)); return contents_data_.at(index)->opener; } int TabStripModel::GetIndexOfNextTabContentsOpenedBy( - const content::NavigationController* opener, + const NavigationController* opener, int start_index, bool use_group) const { DCHECK(opener); @@ -460,8 +460,7 @@ int TabStripModel::GetIndexOfNextTabContentsOpenedBy( } int TabStripModel::GetIndexOfFirstTabContentsOpenedBy( - const content::NavigationController* opener, - int start_index) const { + const NavigationController* opener, int start_index) const { DCHECK(opener); DCHECK(ContainsIndex(start_index)); @@ -473,7 +472,7 @@ int TabStripModel::GetIndexOfFirstTabContentsOpenedBy( } int TabStripModel::GetIndexOfLastTabContentsOpenedBy( - const content::NavigationController* opener, int start_index) const { + const NavigationController* opener, int start_index) const { DCHECK(opener); DCHECK(ContainsIndex(start_index)); @@ -1093,7 +1092,7 @@ void TabStripModel::GetIndicesWithSameDomain(int index, void TabStripModel::GetIndicesWithSameOpener(int index, std::vector<int>* indices) { - content::NavigationController* opener = contents_data_[index]->group; + NavigationController* opener = contents_data_[index]->group; if (!opener) { // If there is no group, find all tabs with the selected tab as the opener. opener = &(GetTabContentsAt(index)->web_contents()->GetController()); @@ -1322,13 +1321,13 @@ void TabStripModel::MoveSelectedTabsToImpl(int index, // static bool TabStripModel::OpenerMatches(const TabContentsData* data, - const content::NavigationController* opener, + const NavigationController* opener, bool use_group) { return data->opener == opener || (use_group && data->group == opener); } void TabStripModel::ForgetOpenersAndGroupsReferencing( - const content::NavigationController* tab) { + const NavigationController* tab) { for (TabContentsDataVector::const_iterator i = contents_data_.begin(); i != contents_data_.end(); ++i) { if ((*i)->group == tab) diff --git a/chrome/browser/tabs/tab_strip_model_order_controller.cc b/chrome/browser/tabs/tab_strip_model_order_controller.cc index dacd574..82260dc 100644 --- a/chrome/browser/tabs/tab_strip_model_order_controller.cc +++ b/chrome/browser/tabs/tab_strip_model_order_controller.cc @@ -7,6 +7,8 @@ #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "content/public/browser/web_contents.h" +using content::NavigationController; + /////////////////////////////////////////////////////////////////////////////// // TabStripModelOrderController, public: @@ -39,7 +41,7 @@ int TabStripModelOrderController::DetermineInsertionIndex( // tab, insert it adjacent to the tab that opened that link. return tabstrip_->active_index() + delta; } - content::NavigationController* opener = + NavigationController* opener = &tabstrip_->GetActiveTabContents()->web_contents()->GetController(); // Get the index of the next item opened by this tab, and insert after // it... @@ -69,12 +71,12 @@ int TabStripModelOrderController::DetermineNewSelectedIndex( int removing_index) const { int tab_count = tabstrip_->count(); DCHECK(removing_index >= 0 && removing_index < tab_count); - content::NavigationController* parent_opener = + NavigationController* parent_opener = tabstrip_->GetOpenerOfTabContentsAt(removing_index); // First see if the index being removed has any "child" tabs. If it does, we // want to select the first in that child group, not the next tab in the same // group of the removed tab. - content::NavigationController* removed_controller = + NavigationController* removed_controller = &tabstrip_->GetTabContentsAt(removing_index)-> web_contents()->GetController(); // The parent opener should never be the same as the controller being removed. @@ -114,7 +116,7 @@ void TabStripModelOrderController::ActiveTabChanged( TabContentsWrapper* new_contents, int index, bool user_gesture) { - content::NavigationController* old_opener = NULL; + NavigationController* old_opener = NULL; if (old_contents) { int index = tabstrip_->GetIndexOfTabContents(old_contents); if (index != TabStripModel::kNoTab) { @@ -126,8 +128,7 @@ void TabStripModelOrderController::ActiveTabChanged( tabstrip_->ForgetGroup(old_contents); } } - content::NavigationController* new_opener = - tabstrip_->GetOpenerOfTabContentsAt(index); + NavigationController* new_opener = tabstrip_->GetOpenerOfTabContentsAt(index); if (user_gesture && new_opener != old_opener && ((old_contents == NULL && new_opener == NULL) || diff --git a/chrome/browser/tabs/tab_strip_model_unittest.cc b/chrome/browser/tabs/tab_strip_model_unittest.cc index 801af15..413f88b 100644 --- a/chrome/browser/tabs/tab_strip_model_unittest.cc +++ b/chrome/browser/tabs/tab_strip_model_unittest.cc @@ -41,6 +41,7 @@ #include "testing/gtest/include/gtest/gtest.h" using content::BrowserThread; +using content::NavigationController; using content::WebContents; using testing::_; @@ -640,7 +641,7 @@ TEST_F(TabStripModelTest, TestBasicOpenerAPI) { // background with opener_contents set as their opener. TabContentsWrapper* opener_contents = CreateTabContents(); - content::NavigationController* opener = + NavigationController* opener = &opener_contents->tab_contents()->GetController(); tabstrip.AppendTabContents(opener_contents, true); TabContentsWrapper* contents1 = CreateTabContents(); @@ -679,8 +680,7 @@ TEST_F(TabStripModelTest, TestBasicOpenerAPI) { // For a tab that has opened no other tabs, the return value should always be // -1... - content::NavigationController* o1 = - &contents1->tab_contents()->GetController(); + NavigationController* o1 = &contents1->tab_contents()->GetController(); EXPECT_EQ(-1, tabstrip.GetIndexOfNextTabContentsOpenedBy(o1, 3, false)); EXPECT_EQ(-1, tabstrip.GetIndexOfLastTabContentsOpenedBy(o1, 3)); @@ -793,7 +793,7 @@ TEST_F(TabStripModelTest, TestInsertionIndexDetermination) { EXPECT_TRUE(tabstrip.empty()); TabContentsWrapper* opener_contents = CreateTabContents(); - content::NavigationController* opener = + NavigationController* opener = &opener_contents->tab_contents()->GetController(); tabstrip.AppendTabContents(opener_contents, true); diff --git a/chrome/browser/translate/translate_manager.cc b/chrome/browser/translate/translate_manager.cc index d87d91f..8fd0c4f 100644 --- a/chrome/browser/translate/translate_manager.cc +++ b/chrome/browser/translate/translate_manager.cc @@ -50,6 +50,7 @@ #include "net/url_request/url_request_status.h" #include "ui/base/resource/resource_bundle.h" +using content::NavigationController; using content::NavigationEntry; using content::WebContents; @@ -261,8 +262,8 @@ void TranslateManager::Observe(int type, const content::NotificationDetails& details) { switch (type) { case content::NOTIFICATION_NAV_ENTRY_COMMITTED: { - content::NavigationController* controller = - content::Source<content::NavigationController>(source).ptr(); + NavigationController* controller = + content::Source<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 9078736..67e44c0 100644 --- a/chrome/browser/translate/translate_manager_browsertest.cc +++ b/chrome/browser/translate/translate_manager_browsertest.cc @@ -46,6 +46,7 @@ #endif using content::BrowserThread; +using content::NavigationController; using content::WebContents; using testing::_; using testing::Pointee; @@ -269,7 +270,7 @@ class NavEntryCommittedObserver : public content::NotificationObserver { public: explicit NavEntryCommittedObserver(TabContents* tab_contents) { registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &tab_contents->GetController())); } diff --git a/chrome/browser/ui/auto_login_prompter.cc b/chrome/browser/ui/auto_login_prompter.cc index 6e74f97..ecd8acc 100644 --- a/chrome/browser/ui/auto_login_prompter.cc +++ b/chrome/browser/ui/auto_login_prompter.cc @@ -30,6 +30,7 @@ #include "net/url_request/url_request.h" using content::BrowserThread; +using content::NavigationController; using content::WebContents; AutoLoginPrompter::AutoLoginPrompter( @@ -40,7 +41,7 @@ AutoLoginPrompter::AutoLoginPrompter( username_(username), args_(args) { registrar_.Add(this, content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>( + content::Source<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 9f1f931..35bf83d 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -207,6 +207,7 @@ #endif using base::TimeDelta; +using content::NavigationController; using content::NavigationEntry; using content::OpenURLParams; using content::PluginService; @@ -1179,7 +1180,7 @@ int Browser::active_index() const { } int Browser::GetIndexOfController( - const content::NavigationController* controller) const { + const NavigationController* controller) const { return tab_handler_->GetTabStripModel()->GetIndexOfController(controller); } @@ -1373,7 +1374,7 @@ bool Browser::CanRestoreTab() { bool Browser::NavigateToIndexWithDisposition(int index, WindowOpenDisposition disp) { - content::NavigationController& controller = + NavigationController& controller = GetOrCloneTabForDisposition(disp)->GetController(); if (index < 0 || index >= controller.GetEntryCount()) return false; @@ -2521,7 +2522,7 @@ bool Browser::RunUnloadEventsHelper(TabContents* contents) { // static Browser* Browser::GetBrowserForController( - const content::NavigationController* controller, int* index_result) { + const NavigationController* controller, int* index_result) { BrowserList::const_iterator it; for (it = BrowserList::begin(); it != BrowserList::end(); ++it) { int index = (*it)->tab_handler_->GetTabStripModel()->GetIndexOfController( @@ -3103,7 +3104,7 @@ TabContentsWrapper* Browser::CreateTabContentsForURL( } bool Browser::CanDuplicateContentsAt(int index) { - content::NavigationController& nc = GetWebContentsAt(index)->GetController(); + NavigationController& nc = GetWebContentsAt(index)->GetController(); return nc.GetWebContents() && nc.GetLastCommittedEntry(); } @@ -3273,7 +3274,7 @@ void Browser::TabClosingAt(TabStripModel* tab_strip_model, fullscreen_controller_->OnTabClosing(contents->tab_contents()); content::NotificationService::current()->Notify( content::NOTIFICATION_TAB_CLOSING, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &contents->web_contents()->GetController()), content::NotificationService::NoDetails()); @@ -4109,7 +4110,7 @@ void Browser::Observe(int type, // closing of this one. if (GetSelectedWebContents() && &GetSelectedWebContents()->GetController() == - content::Source<content::NavigationController>(source).ptr()) + content::Source<NavigationController>(source).ptr()) UpdateToolbar(false); break; @@ -4596,7 +4597,7 @@ void Browser::UpdateCommandsForTabState() { return; // Navigation commands - content::NavigationController& nc = current_tab->GetController(); + NavigationController& nc = current_tab->GetController(); command_updater_.UpdateCommandEnabled(IDC_BACK, nc.CanGoBack()); command_updater_.UpdateCommandEnabled(IDC_FORWARD, nc.CanGoForward()); command_updater_.UpdateCommandEnabled(IDC_RELOAD, diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc index 21a5419..c0c4dac 100644 --- a/chrome/browser/ui/browser_browsertest.cc +++ b/chrome/browser/ui/browser_browsertest.cc @@ -62,6 +62,7 @@ #include "chrome/browser/browser_process.h" #endif +using content::NavigationController; using content::NavigationEntry; using content::OpenURLParams; using content::Referrer; @@ -1158,7 +1159,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, ForwardDisabledOnForward) { ui_test_utils::WindowedNotificationObserver back_nav_load_observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &browser()->GetSelectedWebContents()->GetController())); browser()->GoBack(CURRENT_TAB); back_nav_load_observer.Wait(); @@ -1166,7 +1167,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, ForwardDisabledOnForward) { ui_test_utils::WindowedNotificationObserver forward_nav_load_observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>( + content::Source<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/browser_tab_restore_service_delegate.cc b/chrome/browser/ui/browser_tab_restore_service_delegate.cc index 9006c2c..c6c5789 100644 --- a/chrome/browser/ui/browser_tab_restore_service_delegate.cc +++ b/chrome/browser/ui/browser_tab_restore_service_delegate.cc @@ -9,6 +9,7 @@ #include "chrome/browser/ui/browser_window.h" #include "content/public/browser/navigation_controller.h" +using content::NavigationController; using content::WebContents; void BrowserTabRestoreServiceDelegate::ShowBrowserWindow() { @@ -82,7 +83,7 @@ TabRestoreServiceDelegate* TabRestoreServiceDelegate::Create(Profile* profile) { // static TabRestoreServiceDelegate* TabRestoreServiceDelegate::FindDelegateForController( - const content::NavigationController* controller, + const NavigationController* controller, int* index) { Browser* browser = Browser::GetBrowserForController(controller, index); if (browser) diff --git a/chrome/browser/ui/cocoa/applescript/tab_applescript.mm b/chrome/browser/ui/cocoa/applescript/tab_applescript.mm index de73ebd..1f1ca8f 100644 --- a/chrome/browser/ui/cocoa/applescript/tab_applescript.mm +++ b/chrome/browser/ui/cocoa/applescript/tab_applescript.mm @@ -26,6 +26,7 @@ #include "content/public/browser/web_contents_delegate.h" #include "googleurl/src/gurl.h" +using content::NavigationController; using content::NavigationEntry; using content::OpenURLParams; using content::Referrer; @@ -308,21 +309,21 @@ static NSAppleEventDescriptor* valueToDescriptor(Value* value) { } - (void)handlesGoBackScriptCommand:(NSScriptCommand*)command { - content::NavigationController& navigationController = + NavigationController& navigationController = tabContents_->tab_contents()->GetController(); if (navigationController.CanGoBack()) navigationController.GoBack(); } - (void)handlesGoForwardScriptCommand:(NSScriptCommand*)command { - content::NavigationController& navigationController = + NavigationController& navigationController = tabContents_->tab_contents()->GetController(); if (navigationController.CanGoForward()) navigationController.GoForward(); } - (void)handlesReloadScriptCommand:(NSScriptCommand*)command { - content::NavigationController& navigationController = + NavigationController& navigationController = tabContents_->tab_contents()->GetController(); const bool checkForRepost = true; navigationController.Reload(checkForRepost); 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 6282c0b..5a1de8f 100644 --- a/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm +++ b/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm @@ -15,6 +15,7 @@ #include "content/public/browser/notification_source.h" #include "content/public/browser/notification_types.h" +using content::NavigationController; using content::WebContents; @interface TabContentsController(Private) @@ -68,8 +69,7 @@ void TabContentsNotificationBridge::ChangeWebContents(WebContents* contents) { registrar_.Add( this, content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED, - content::Source<content::NavigationController>( - &contents->GetController())); + content::Source<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 41a1646..354a233 100644 --- a/chrome/browser/ui/find_bar/find_bar_controller.cc +++ b/chrome/browser/ui/find_bar/find_bar_controller.cc @@ -20,6 +20,7 @@ #include "content/public/browser/notification_source.h" #include "ui/gfx/rect.h" +using content::NavigationController; using content::WebContents; // The minimum space between the FindInPage window and the search result. @@ -94,7 +95,7 @@ void FindBarController::ChangeTabContents(TabContentsWrapper* contents) { registrar_.Add( this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &tab_contents_->web_contents()->GetController())); MaybeSetPrepopulateText(); @@ -133,8 +134,8 @@ void FindBarController::Observe(int type, } } } else if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) { - content::NavigationController* source_controller = - content::Source<content::NavigationController>(source).ptr(); + NavigationController* source_controller = + content::Source<NavigationController>(source).ptr(); if (source_controller == &tab_contents_->web_contents()->GetController()) { content::LoadCommittedDetails* commit_details = content::Details<content::LoadCommittedDetails>(details).ptr(); 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 994ebbc..ac5eddb 100644 --- a/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc +++ b/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc @@ -38,6 +38,8 @@ #include "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h" #endif +using content::NavigationController; + const std::string kSimplePage = "404_is_enough_for_us.html"; const std::string kFramePage = "files/find_in_page/frames.html"; const std::string kFrameData = "files/find_in_page/framedata_general.html"; @@ -587,7 +589,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<content::NavigationController>( + content::Source<NavigationController>( &browser()->GetSelectedTabContentsWrapper()->tab_contents()-> GetController())); browser()->Reload(CURRENT_TAB); @@ -1114,7 +1116,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<content::NavigationController>( + content::Source<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 e406c37..d6a88fa 100644 --- a/chrome/browser/ui/intents/web_intent_picker_controller.cc +++ b/chrome/browser/ui/intents/web_intent_picker_controller.cc @@ -26,6 +26,8 @@ #include "ui/gfx/codec/png_codec.h" #include "webkit/glue/web_intent_service_data.h" +using content::NavigationController; + namespace { // Gets the favicon service for the profile in |tab_contents|. @@ -116,12 +118,11 @@ WebIntentPickerController::WebIntentPickerController( picker_(NULL), pending_async_count_(0), service_tab_(NULL) { - content::NavigationController* controller = - &wrapper->tab_contents()->GetController(); + NavigationController* controller = &wrapper->tab_contents()->GetController(); registrar_.Add(this, content::NOTIFICATION_LOAD_START, - content::Source<content::NavigationController>(controller)); + content::Source<NavigationController>(controller)); registrar_.Add(this, content::NOTIFICATION_TAB_CLOSING, - content::Source<content::NavigationController>(controller)); + content::Source<NavigationController>(controller)); } WebIntentPickerController::~WebIntentPickerController() { diff --git a/chrome/browser/ui/login/login_prompt.cc b/chrome/browser/ui/login/login_prompt.cc index 6f6301f..525f98a 100644 --- a/chrome/browser/ui/login/login_prompt.cc +++ b/chrome/browser/ui/login/login_prompt.cc @@ -32,6 +32,7 @@ #include "ui/base/text/text_elider.h" using content::BrowserThread; +using content::NavigationController; using webkit::forms::PasswordForm; class LoginHandlerImpl; @@ -278,7 +279,7 @@ void LoginHandler::NotifyAuthNeeded() { content::NotificationService* service = content::NotificationService::current(); - content::NavigationController* controller = NULL; + NavigationController* controller = NULL; TabContents* requesting_contents = GetTabContentsForLogin(); if (requesting_contents) @@ -287,7 +288,7 @@ void LoginHandler::NotifyAuthNeeded() { LoginNotificationDetails details(this); service->Notify(chrome::NOTIFICATION_AUTH_NEEDED, - content::Source<content::NavigationController>(controller), + content::Source<NavigationController>(controller), content::Details<LoginNotificationDetails>(&details)); } @@ -297,7 +298,7 @@ void LoginHandler::NotifyAuthCancelled() { content::NotificationService* service = content::NotificationService::current(); - content::NavigationController* controller = NULL; + NavigationController* controller = NULL; TabContents* requesting_contents = GetTabContentsForLogin(); if (requesting_contents) @@ -306,7 +307,7 @@ void LoginHandler::NotifyAuthCancelled() { LoginNotificationDetails details(this); service->Notify(chrome::NOTIFICATION_AUTH_CANCELLED, - content::Source<content::NavigationController>(controller), + content::Source<NavigationController>(controller), content::Details<LoginNotificationDetails>(&details)); } @@ -321,13 +322,13 @@ void LoginHandler::NotifyAuthSupplied(const string16& username, content::NotificationService* service = content::NotificationService::current(); - content::NavigationController* controller = + NavigationController* controller = &requesting_contents->GetController(); AuthSuppliedLoginNotificationDetails details(this, username, password); service->Notify( chrome::NOTIFICATION_AUTH_SUPPLIED, - content::Source<content::NavigationController>(controller), + content::Source<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 822360a..114260d 100644 --- a/chrome/browser/ui/login/login_prompt_browsertest.cc +++ b/chrome/browser/ui/login/login_prompt_browsertest.cc @@ -22,6 +22,7 @@ #include "net/base/auth.h" #include "net/base/mock_host_resolver.h" +using content::NavigationController; using content::OpenURLParams; using content::Referrer; @@ -158,9 +159,9 @@ template <int T> class WindowedNavigationObserver : public ui_test_utils::WindowedNotificationObserver { public: - explicit WindowedNavigationObserver(content::NavigationController* controller) + explicit WindowedNavigationObserver(NavigationController* controller) : ui_test_utils::WindowedNotificationObserver( - T, content::Source<content::NavigationController>(controller)) {} + T, content::Source<NavigationController>(controller)) {} }; // LOAD_STOP observer is special since we want to be able to wait for @@ -168,7 +169,7 @@ class WindowedNavigationObserver class WindowedLoadStopObserver : public WindowedNavigationObserver<content::NOTIFICATION_LOAD_STOP> { public: - WindowedLoadStopObserver(content::NavigationController* controller, + WindowedLoadStopObserver(NavigationController* controller, int notification_count) : WindowedNavigationObserver<content::NOTIFICATION_LOAD_STOP>(controller), remaining_notification_count_(notification_count) {} @@ -244,11 +245,10 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, PrefetchAuthCancels) { TabContentsWrapper* contents = browser()->GetSelectedTabContentsWrapper(); ASSERT_TRUE(contents); - content::NavigationController* controller = - &contents->web_contents()->GetController(); + NavigationController* controller = &contents->web_contents()->GetController(); LoginPromptBrowserTestObserver observer; - observer.Register(content::Source<content::NavigationController>(controller)); + observer.Register(content::Source<NavigationController>(controller)); WindowedLoadStopObserver load_stop_waiter(controller, 1); browser()->OpenURL(OpenURLParams( @@ -272,11 +272,10 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, TestCancelAuth) { browser()->GetSelectedTabContentsWrapper(); ASSERT_TRUE(contents); - content::NavigationController* controller = - &contents->web_contents()->GetController(); + NavigationController* controller = &contents->web_contents()->GetController(); LoginPromptBrowserTestObserver observer; - observer.Register(content::Source<content::NavigationController>(controller)); + observer.Register(content::Source<NavigationController>(controller)); // First navigate to an unauthenticated page so we have something to // go back to. @@ -372,11 +371,10 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, MultipleRealmCancellation) { browser()->GetSelectedTabContentsWrapper(); ASSERT_TRUE(contents); - content::NavigationController* controller = - &contents->web_contents()->GetController(); + NavigationController* controller = &contents->web_contents()->GetController(); LoginPromptBrowserTestObserver observer; - observer.Register(content::Source<content::NavigationController>(controller)); + observer.Register(content::Source<NavigationController>(controller)); WindowedLoadStopObserver load_stop_waiter(controller, 1); @@ -426,11 +424,10 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, MultipleRealmConfirmation) { browser()->GetSelectedTabContentsWrapper(); ASSERT_TRUE(contents); - content::NavigationController* controller = - &contents->web_contents()->GetController(); + NavigationController* controller = &contents->web_contents()->GetController(); LoginPromptBrowserTestObserver observer; - observer.Register(content::Source<content::NavigationController>(controller)); + observer.Register(content::Source<NavigationController>(controller)); WindowedLoadStopObserver load_stop_waiter(controller, 1); int n_handlers = 0; @@ -480,11 +477,10 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, IncorrectConfirmation) { browser()->GetSelectedTabContentsWrapper(); ASSERT_TRUE(contents); - content::NavigationController* controller = - &contents->web_contents()->GetController(); + NavigationController* controller = &contents->web_contents()->GetController(); LoginPromptBrowserTestObserver observer; - observer.Register(content::Source<content::NavigationController>(controller)); + observer.Register(content::Source<NavigationController>(controller)); { WindowedAuthNeededObserver auth_needed_waiter(controller); @@ -553,11 +549,10 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, NoLoginPromptForFavicon) { browser()->GetSelectedTabContentsWrapper(); ASSERT_TRUE(contents); - content::NavigationController* controller = - &contents->web_contents()->GetController(); + NavigationController* controller = &contents->web_contents()->GetController(); LoginPromptBrowserTestObserver observer; - observer.Register(content::Source<content::NavigationController>(controller)); + observer.Register(content::Source<NavigationController>(controller)); // First load a page that has a favicon that requires // authentication. There should be no login prompt. @@ -611,10 +606,9 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, BlockCrossdomainPrompt) { TabContentsWrapper* contents = browser()->GetSelectedTabContentsWrapper(); ASSERT_TRUE(contents); - content::NavigationController* controller = - &contents->web_contents()->GetController(); + NavigationController* controller = &contents->web_contents()->GetController(); LoginPromptBrowserTestObserver observer; - observer.Register(content::Source<content::NavigationController>(controller)); + observer.Register(content::Source<NavigationController>(controller)); // Load a page that has a cross-domain sub-resource authentication. // There should be no login prompt. @@ -679,7 +673,7 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, SupplyRedundantAuths) { TabContentsWrapper* contents_1 = browser()->GetSelectedTabContentsWrapper(); ASSERT_TRUE(contents_1); - content::NavigationController* controller_1 = + NavigationController* controller_1 = &contents_1->web_contents()->GetController(); // Open a new tab. @@ -694,14 +688,12 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, SupplyRedundantAuths) { browser()->GetSelectedTabContentsWrapper(); ASSERT_TRUE(contents_2); ASSERT_NE(contents_1, contents_2); - content::NavigationController* controller_2 = + NavigationController* controller_2 = &contents_2->web_contents()->GetController(); LoginPromptBrowserTestObserver observer; - observer.Register(content::Source<content::NavigationController>( - controller_1)); - observer.Register(content::Source<content::NavigationController>( - controller_2)); + observer.Register(content::Source<NavigationController>(controller_1)); + observer.Register(content::Source<NavigationController>(controller_2)); { // Open different auth urls in each tab. @@ -749,7 +741,7 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, CancelRedundantAuths) { TabContentsWrapper* contents_1 = browser()->GetSelectedTabContentsWrapper(); ASSERT_TRUE(contents_1); - content::NavigationController* controller_1 = + NavigationController* controller_1 = &contents_1->web_contents()->GetController(); // Open a new tab. @@ -764,14 +756,12 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, CancelRedundantAuths) { browser()->GetSelectedTabContentsWrapper(); ASSERT_TRUE(contents_2); ASSERT_NE(contents_1, contents_2); - content::NavigationController* controller_2 = + NavigationController* controller_2 = &contents_2->web_contents()->GetController(); LoginPromptBrowserTestObserver observer; - observer.Register(content::Source<content::NavigationController>( - controller_1)); - observer.Register(content::Source<content::NavigationController>( - controller_2)); + observer.Register(content::Source<NavigationController>(controller_1)); + observer.Register(content::Source<NavigationController>(controller_2)); { // Open different auth urls in each tab. @@ -820,8 +810,7 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, TabContentsWrapper* contents = browser()->GetSelectedTabContentsWrapper(); ASSERT_TRUE(contents); - content::NavigationController* controller = - &contents->web_contents()->GetController(); + NavigationController* controller = &contents->web_contents()->GetController(); // Open an incognito window. Browser* browser_incognito = CreateIncognitoBrowser(); @@ -831,14 +820,14 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, browser_incognito->GetSelectedTabContentsWrapper(); ASSERT_TRUE(contents_incognito); ASSERT_NE(contents, contents_incognito); - content::NavigationController* controller_incognito = + NavigationController* controller_incognito = &contents_incognito->web_contents()->GetController(); LoginPromptBrowserTestObserver observer; - observer.Register(content::Source<content::NavigationController>(controller)); + observer.Register(content::Source<NavigationController>(controller)); LoginPromptBrowserTestObserver observer_incognito; observer_incognito.Register( - content::Source<content::NavigationController>(controller_incognito)); + content::Source<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 63b9a56..d1877ff 100644 --- a/chrome/browser/ui/pdf/pdf_browsertest.cc +++ b/chrome/browser/ui/pdf/pdf_browsertest.cc @@ -25,6 +25,7 @@ #include "ui/gfx/codec/png_codec.h" #include "ui/gfx/screen.h" +using content::NavigationController; using content::WebContents; namespace { @@ -285,12 +286,12 @@ IN_PROC_BROWSER_TEST_F(PDFBrowserTest, MAYBE_FindAndCopy) { IN_PROC_BROWSER_TEST_F(PDFBrowserTest, FLAKY_SLOW_Loading) { ASSERT_TRUE(pdf_test_server()->Start()); - content::NavigationController* controller = + NavigationController* controller = &(browser()->GetSelectedWebContents()->GetController()); content::NotificationRegistrar registrar; registrar.Add(this, content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>(controller)); + content::Source<NavigationController>(controller)); std::string base_url = std::string("files/"); file_util::FileEnumerator file_enumerator( @@ -351,7 +352,7 @@ IN_PROC_BROWSER_TEST_F(PDFBrowserTest, MAYBE_OnLoadAndReload) { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &browser()->GetSelectedWebContents()->GetController())); ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( browser()->GetSelectedWebContents()->GetRenderViewHost(), diff --git a/chrome/browser/ui/search_engines/search_engine_tab_helper.cc b/chrome/browser/ui/search_engines/search_engine_tab_helper.cc index 8db0224..6d36d5a 100644 --- a/chrome/browser/ui/search_engines/search_engine_tab_helper.cc +++ b/chrome/browser/ui/search_engines/search_engine_tab_helper.cc @@ -17,6 +17,7 @@ #include "content/public/browser/web_contents.h" #include "content/public/common/frame_navigate_params.h" +using content::NavigationController; using content::NavigationEntry; using content::WebContents; @@ -92,8 +93,7 @@ void SearchEngineTabHelper::OnPageHasOSDD( return; } - const content::NavigationController& controller = - web_contents()->GetController(); + const NavigationController& controller = web_contents()->GetController(); const NavigationEntry* entry = controller.GetLastCommittedEntry(); DCHECK(entry); @@ -143,8 +143,7 @@ void SearchEngineTabHelper::GenerateKeywordIfNecessary( if (profile->IsOffTheRecord()) return; - const content::NavigationController& controller = - web_contents()->GetController(); + const NavigationController& controller = web_contents()->GetController(); int last_index = controller.GetLastCommittedEntryIndex(); // When there was no previous page, the last index will be 0. This is // normally due to a form submit that opened in a new tab. diff --git a/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc b/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc index a4dc58b..1a81142 100644 --- a/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc +++ b/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc @@ -11,17 +11,18 @@ #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" +using content::NavigationController; using content::WebContents; TabModalConfirmDialogDelegate::TabModalConfirmDialogDelegate( WebContents* web_contents) : window_(NULL), closing_(false) { - content::NavigationController* controller = &web_contents->GetController(); + NavigationController* controller = &web_contents->GetController(); registrar_.Add(this, content::NOTIFICATION_LOAD_START, - content::Source<content::NavigationController>(controller)); + content::Source<NavigationController>(controller)); registrar_.Add(this, content::NOTIFICATION_TAB_CLOSING, - content::Source<content::NavigationController>(controller)); + content::Source<NavigationController>(controller)); } TabModalConfirmDialogDelegate::~TabModalConfirmDialogDelegate() { diff --git a/chrome/browser/ui/toolbar/back_forward_menu_model.cc b/chrome/browser/ui/toolbar/back_forward_menu_model.cc index 299d11f..de085cf 100644 --- a/chrome/browser/ui/toolbar/back_forward_menu_model.cc +++ b/chrome/browser/ui/toolbar/back_forward_menu_model.cc @@ -30,6 +30,7 @@ #include "ui/base/text/text_elider.h" #include "ui/gfx/codec/png_codec.h" +using content::NavigationController; using content::NavigationEntry; using content::UserMetricsAction; using content::WebContents; @@ -335,7 +336,7 @@ int BackForwardMenuModel::GetChapterStopCount(int history_items) const { int BackForwardMenuModel::GetIndexOfNextChapterStop(int start_from, bool forward) const { WebContents* contents = GetWebContents(); - content::NavigationController& controller = contents->GetController(); + NavigationController& controller = contents->GetController(); int max_count = controller.GetEntryCount(); if (start_from < 0 || start_from >= max_count) @@ -445,7 +446,7 @@ int BackForwardMenuModel::MenuIndexToNavEntryIndex(int index) const { NavigationEntry* BackForwardMenuModel::GetNavigationEntry(int index) const { int controller_index = MenuIndexToNavEntryIndex(index); - content::NavigationController& controller = GetWebContents()->GetController(); + NavigationController& controller = GetWebContents()->GetController(); if (controller_index >= 0 && controller_index < controller.GetEntryCount()) return controller.GetEntryAtIndex(controller_index); diff --git a/chrome/browser/ui/toolbar/toolbar_model.cc b/chrome/browser/ui/toolbar/toolbar_model.cc index 175828f..cd5217b 100644 --- a/chrome/browser/ui/toolbar/toolbar_model.cc +++ b/chrome/browser/ui/toolbar/toolbar_model.cc @@ -27,6 +27,7 @@ #include "net/base/net_util.h" #include "ui/base/l10n/l10n_util.h" +using content::NavigationController; using content::NavigationEntry; using content::SSLStatus; using content::WebContents; @@ -44,8 +45,7 @@ string16 ToolbarModel::GetText() const { GURL url(chrome::kAboutBlankURL); std::string languages; // Empty if we don't have a |navigation_controller|. - content::NavigationController* navigation_controller = - GetNavigationController(); + NavigationController* navigation_controller = GetNavigationController(); if (navigation_controller) { Profile* profile = Profile::FromBrowserContext(navigation_controller->GetBrowserContext()); @@ -75,8 +75,7 @@ bool ToolbarModel::ShouldDisplayURL() const { // - The view-source test must come before the WebUI test because of the case // of view-source:chrome://newtab, which should display its URL despite what // chrome://newtab's WebUI says. - content::NavigationController* controller = - GetNavigationController(); + NavigationController* controller = GetNavigationController(); NavigationEntry* entry = controller ? controller->GetVisibleEntry() : NULL; if (entry) { if (entry->IsViewSourceMode() || @@ -99,8 +98,7 @@ ToolbarModel::SecurityLevel ToolbarModel::GetSecurityLevel() const { if (input_in_progress_) // When editing, assume no security style. return NONE; - content::NavigationController* navigation_controller = - GetNavigationController(); + NavigationController* navigation_controller = GetNavigationController(); if (!navigation_controller) // We might not have a controller on init. return NONE; @@ -172,7 +170,7 @@ string16 ToolbarModel::GetEVCertName(const net::X509Certificate& cert) { UTF8ToUTF16(cert.subject().country_name)); } -content::NavigationController* ToolbarModel::GetNavigationController() const { +NavigationController* ToolbarModel::GetNavigationController() const { // This |current_tab| can be NULL during the initialization of the // toolbar during window creation (i.e. before any tabs have been added // to the window). 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 098746a..eb143f9 100644 --- a/chrome/browser/ui/views/tab_contents/tab_contents_container.cc +++ b/chrome/browser/ui/views/tab_contents/tab_contents_container.cc @@ -15,6 +15,7 @@ #include "content/public/browser/notification_types.h" #include "ui/base/accessibility/accessible_view_state.h" +using content::NavigationController; using content::WebContents; //////////////////////////////////////////////////////////////////////////////// @@ -169,8 +170,7 @@ void TabContentsContainer::AddObservers() { registrar_.Add( this, content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED, - content::Source<content::NavigationController>( - &web_contents_->GetController())); + content::Source<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 5b18dac..024a181 100644 --- a/chrome/browser/ui/web_applications/web_app_ui.cc +++ b/chrome/browser/ui/web_applications/web_app_ui.cc @@ -28,6 +28,7 @@ #endif using content::BrowserThread; +using content::NavigationController; namespace { @@ -103,7 +104,7 @@ UpdateShortcutWorker::UpdateShortcutWorker(TabContentsWrapper* tab_contents) registrar_.Add( this, content::NOTIFICATION_TAB_CLOSING, - content::Source<content::NavigationController>( + content::Source<NavigationController>( &tab_contents_->web_contents()->GetController())); } @@ -117,7 +118,7 @@ void UpdateShortcutWorker::Observe( const content::NotificationSource& source, const content::NotificationDetails& details) { if (type == content::NOTIFICATION_TAB_CLOSING && - content::Source<content::NavigationController>(source).ptr() == + content::Source<NavigationController>(source).ptr() == &tab_contents_->web_contents()->GetController()) { // Underlying tab is closing. tab_contents_ = NULL; diff --git a/chrome/browser/ui/webui/cloud_print_signin_dialog.cc b/chrome/browser/ui/webui/cloud_print_signin_dialog.cc index 94f9385..bab26c2 100644 --- a/chrome/browser/ui/webui/cloud_print_signin_dialog.cc +++ b/chrome/browser/ui/webui/cloud_print_signin_dialog.cc @@ -29,6 +29,7 @@ #include "content/public/browser/web_ui_message_handler.h" using content::BrowserThread; +using content::NavigationController; using content::NavigationEntry; using content::WebContents; using content::WebUIMessageHandler; @@ -65,14 +66,14 @@ CloudPrintSigninFlowHandler::CloudPrintSigninFlowHandler( void CloudPrintSigninFlowHandler::RegisterMessages() { if (web_ui() && web_ui()->web_contents()) { - content::NavigationController* controller = + NavigationController* controller = &web_ui()->web_contents()->GetController(); NavigationEntry* pending_entry = controller->GetPendingEntry(); if (pending_entry) pending_entry->SetURL(CloudPrintURL( Profile::FromWebUI(web_ui())).GetCloudPrintSigninURL()); registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - content::Source<content::NavigationController>(controller)); + content::Source<NavigationController>(controller)); } } 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 13923b4..3a5e802 100644 --- a/chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc +++ b/chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc @@ -27,6 +27,7 @@ #include "content/public/browser/notification_service.h" #include "content/public/browser/web_contents.h" +using content::NavigationController; using content::OpenURLParams; using content::Referrer; @@ -91,7 +92,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<content::NavigationController>( + content::Source<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 a66efaa..ead8ed2 100644 --- a/chrome/browser/ui/webui/web_ui_browsertest.cc +++ b/chrome/browser/ui/webui/web_ui_browsertest.cc @@ -29,6 +29,7 @@ #include "testing/gtest/include/gtest/gtest-spi.h" #include "ui/base/resource/resource_bundle.h" +using content::NavigationController; using content::WebContents; using content::WebUIMessageHandler; @@ -182,7 +183,7 @@ void WebUIBrowserTest::PreLoadJavascriptLibraries( void WebUIBrowserTest::BrowsePreload(const GURL& browse_to) { TestNavigationObserver navigation_observer( - content::Source<content::NavigationController>( + content::Source<NavigationController>( &browser()->GetSelectedTabContentsWrapper()->web_contents()-> GetController()), this, 1); diff --git a/chrome/browser/ui/webui/web_ui_unittest.cc b/chrome/browser/ui/webui/web_ui_unittest.cc index c586de7..269e068 100644 --- a/chrome/browser/ui/webui/web_ui_unittest.cc +++ b/chrome/browser/ui/webui/web_ui_unittest.cc @@ -15,6 +15,7 @@ #include "testing/gtest/include/gtest/gtest.h" using content::BrowserThread; +using content::NavigationController; class WebUITest : public TabContentsWrapperTestHarness { public: @@ -26,7 +27,7 @@ class WebUITest : public TabContentsWrapperTestHarness { // values. This must be increasing for the life of the tests. static void DoNavigationTest(TabContentsWrapper* wrapper, int page_id) { TabContents* contents = wrapper->tab_contents(); - content::NavigationController* controller = &contents->GetController(); + NavigationController* controller = &contents->GetController(); // Start a pending load. GURL new_tab_url(chrome::kChromeUINewTabURL); diff --git a/chrome/test/base/browser_with_test_window_test.cc b/chrome/test/base/browser_with_test_window_test.cc index 3879f50..79ef96d 100644 --- a/chrome/test/base/browser_with_test_window_test.cc +++ b/chrome/test/base/browser_with_test_window_test.cc @@ -20,6 +20,7 @@ #include "content/public/common/page_transition_types.h" using content::BrowserThread; +using content::NavigationController; using content::WebContents; BrowserWithTestWindowTest::BrowserWithTestWindowTest() @@ -72,7 +73,7 @@ void BrowserWithTestWindowTest::AddTab(Browser* browser, const GURL& url) { } void BrowserWithTestWindowTest::CommitPendingLoad( - content::NavigationController* controller) { + NavigationController* controller) { if (!controller->GetPendingEntry()) return; // Nothing to commit. @@ -115,7 +116,7 @@ void BrowserWithTestWindowTest::CommitPendingLoad( } void BrowserWithTestWindowTest::NavigateAndCommit( - content::NavigationController* controller, + NavigationController* controller, const GURL& url) { controller->LoadURL( url, content::Referrer(), content::PAGE_TRANSITION_LINK, std::string()); diff --git a/chrome/test/base/test_html_dialog_observer.cc b/chrome/test/base/test_html_dialog_observer.cc index 2d4e228..b9d19bc 100644 --- a/chrome/test/base/test_html_dialog_observer.cc +++ b/chrome/test/base/test_html_dialog_observer.cc @@ -15,6 +15,8 @@ #include "content/public/browser/notification_types.h" #include "content/public/browser/web_contents.h" +using content::NavigationController; + TestHtmlDialogObserver::TestHtmlDialogObserver( JsInjectionReadyObserver* js_injection_ready_observer) : js_injection_ready_observer_(js_injection_ready_observer), @@ -47,13 +49,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<content::NavigationController>( + content::Source<NavigationController>( &web_ui_->web_contents()->GetController())); break; case content::NOTIFICATION_LOAD_STOP: DCHECK(web_ui_); registrar_.Remove(this, content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>( + content::Source<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 e3f926c..b09920d 100644 --- a/chrome/test/base/test_tab_strip_model_observer.cc +++ b/chrome/test/base/test_tab_strip_model_observer.cc @@ -12,6 +12,8 @@ #include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/notification_source.h" +using content::NavigationController; + TestTabStripModelObserver::TestTabStripModelObserver( TabStripModel* tab_strip_model, JsInjectionReadyObserver* js_injection_ready_observer) @@ -42,7 +44,7 @@ void TestTabStripModelObserver::ObservePrintPreviewTabContents( TabContentsWrapper* preview_tab = tab_controller->GetPrintPreviewForTab(contents); if (preview_tab) { - RegisterAsObserver(content::Source<content::NavigationController>( + RegisterAsObserver(content::Source<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 f9339b2..5a07dce 100644 --- a/chrome/test/base/ui_test_utils.cc +++ b/chrome/test/base/ui_test_utils.cc @@ -69,6 +69,7 @@ #include "ui/aura/root_window.h" #endif +using content::NavigationController; using content::NavigationEntry; using content::OpenURLParams; using content::Referrer; @@ -315,10 +316,10 @@ bool GetCurrentTabTitle(const Browser* browser, string16* title) { return true; } -void WaitForNavigations(content::NavigationController* controller, +void WaitForNavigations(NavigationController* controller, int number_of_navigations) { TestNavigationObserver observer( - content::Source<content::NavigationController>(controller), NULL, + content::Source<NavigationController>(controller), NULL, number_of_navigations); observer.WaitForObservation( base::Bind(&ui_test_utils::RunMessageLoop), @@ -342,7 +343,7 @@ void WaitForBrowserActionUpdated(ExtensionAction* browser_action) { void WaitForLoadStop(WebContents* tab) { WindowedNotificationObserver load_stop_observer( content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>(&tab->GetController())); + content::Source<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,11 +404,11 @@ static void NavigateToURLWithDispositionBlockUntilNavigationsComplete( int browser_test_flags) { if (disposition == CURRENT_TAB && browser->GetSelectedWebContents()) WaitForLoadStop(browser->GetSelectedWebContents()); - content::NavigationController* controller = + NavigationController* controller = browser->GetSelectedWebContents() ? &browser->GetSelectedWebContents()->GetController() : NULL; TestNavigationObserver same_tab_observer( - content::Source<content::NavigationController>(controller), + content::Source<NavigationController>(controller), NULL, number_of_navigations); @@ -453,7 +454,7 @@ static void NavigateToURLWithDispositionBlockUntilNavigationsComplete( base::Unretained(MessageLoopForUI::current()))); return; } else if (web_contents) { - content::NavigationController* controller = &web_contents->GetController(); + NavigationController* controller = &web_contents->GetController(); WaitForNavigations(controller, number_of_navigations); return; } @@ -932,8 +933,7 @@ TitleWatcher::TitleWatcher(WebContents* web_contents, notification_registrar_.Add( this, content::NOTIFICATION_LOAD_STOP, - content::Source<content::NavigationController>( - &web_contents->GetController())); + content::Source<NavigationController>(&web_contents->GetController())); } void TitleWatcher::AlsoWaitForTitle(const string16& expected_title) { @@ -958,8 +958,8 @@ void TitleWatcher::Observe(int type, WebContents* source_contents = content::Source<WebContents>(source).ptr(); ASSERT_EQ(web_contents_, source_contents); } else if (type == content::NOTIFICATION_LOAD_STOP) { - content::NavigationController* controller = - content::Source<content::NavigationController>(source).ptr(); + NavigationController* controller = + content::Source<NavigationController>(source).ptr(); ASSERT_EQ(&web_contents_->GetController(), controller); } else { FAIL() << "Unexpected notification received."; |