diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-04 07:53:47 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-04 07:53:47 +0000 |
commit | d202a7c07fad32d83cd8c640ca03eafd36856881 (patch) | |
tree | fc805fb8fa9ab6907f54ae7a3b3955298470d8b5 /content | |
parent | 9dc034d24c21816b763f51a50d53008237fd9da6 (diff) | |
download | chromium_src-d202a7c07fad32d83cd8c640ca03eafd36856881.zip chromium_src-d202a7c07fad32d83cd8c640ca03eafd36856881.tar.gz chromium_src-d202a7c07fad32d83cd8c640ca03eafd36856881.tar.bz2 |
Rename NavigationController to NavigationControllerImpl. I'll get rid of content::NavigationController in a separate change.
BUG=98716
TBR=joi
Review URL: http://codereview.chromium.org/9091002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116288 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
22 files changed, 163 insertions, 154 deletions
diff --git a/content/browser/load_notification_details.h b/content/browser/load_notification_details.h index f12179c..e517c9c 100644 --- a/content/browser/load_notification_details.h +++ b/content/browser/load_notification_details.h @@ -12,7 +12,7 @@ #include "base/basictypes.h" #include "base/time.h" -#include "content/browser/tab_contents/navigation_controller.h" +#include "content/public/browser/navigation_controller.h" #include "content/public/common/page_transition_types.h" #include "googleurl/src/gurl.h" @@ -21,7 +21,7 @@ class LoadNotificationDetails { LoadNotificationDetails(const GURL& url, content::PageTransition origin, base::TimeDelta load_time, - NavigationController* controller, + content::NavigationController* controller, int session_index) : url_(url), load_time_(load_time), @@ -35,7 +35,7 @@ class LoadNotificationDetails { content::PageTransition origin() const { return origin_; } base::TimeDelta load_time() const { return load_time_; } int session_index() const { return session_index_; } - NavigationController* controller() const { return controller_; } + content::NavigationController* controller() const { return controller_; } private: // The URL loaded. @@ -51,7 +51,7 @@ class LoadNotificationDetails { content::PageTransition origin_; // The NavigationController for the load. - NavigationController* controller_; + content::NavigationController* controller_; LoadNotificationDetails() {} diff --git a/content/browser/renderer_host/render_view_host_unittest.cc b/content/browser/renderer_host/render_view_host_unittest.cc index 042ce44..17a3fee 100644 --- a/content/browser/renderer_host/render_view_host_unittest.cc +++ b/content/browser/renderer_host/render_view_host_unittest.cc @@ -3,7 +3,7 @@ // found in the LICENSE file. #include "content/browser/renderer_host/test_render_view_host.h" -#include "content/browser/tab_contents/navigation_controller.h" +#include "content/browser/tab_contents/navigation_controller_impl.h" #include "content/browser/tab_contents/test_tab_contents.h" #include "content/common/view_messages.h" #include "content/public/browser/navigation_entry.h" diff --git a/content/browser/renderer_host/test_render_view_host.cc b/content/browser/renderer_host/test_render_view_host.cc index ff4756b..fcdac3b 100644 --- a/content/browser/renderer_host/test_render_view_host.cc +++ b/content/browser/renderer_host/test_render_view_host.cc @@ -7,7 +7,7 @@ #include "content/browser/renderer_host/test_backing_store.h" #include "content/browser/renderer_host/test_render_view_host.h" #include "content/browser/site_instance.h" -#include "content/browser/tab_contents/navigation_controller.h" +#include "content/browser/tab_contents/navigation_controller_impl.h" #include "content/browser/tab_contents/navigation_entry_impl.h" #include "content/browser/tab_contents/test_tab_contents.h" #include "content/common/dom_storage_common.h" @@ -310,7 +310,7 @@ RenderViewHostTestHarness::RenderViewHostTestHarness() RenderViewHostTestHarness::~RenderViewHostTestHarness() { } -NavigationController& RenderViewHostTestHarness::controller() { +NavigationControllerImpl& RenderViewHostTestHarness::controller() { return contents()->GetControllerImpl(); } diff --git a/content/browser/renderer_host/test_render_view_host.h b/content/browser/renderer_host/test_render_view_host.h index 40e21b2..84b9288 100644 --- a/content/browser/renderer_host/test_render_view_host.h +++ b/content/browser/renderer_host/test_render_view_host.h @@ -17,7 +17,7 @@ #include "content/public/common/page_transition_types.h" #include "testing/gtest/include/gtest/gtest.h" -class NavigationController; +class NavigationControllerImpl; namespace content { class BrowserContext; @@ -296,7 +296,7 @@ class RenderViewHostTestHarness : public testing::Test { RenderViewHostTestHarness(); virtual ~RenderViewHostTestHarness(); - NavigationController& controller(); + NavigationControllerImpl& controller(); virtual TestTabContents* contents(); TestRenderViewHost* rvh(); TestRenderViewHost* pending_rvh(); diff --git a/content/browser/ssl/ssl_error_handler.cc b/content/browser/ssl/ssl_error_handler.cc index 07c28d1..7b5ea68 100644 --- a/content/browser/ssl/ssl_error_handler.cc +++ b/content/browser/ssl/ssl_error_handler.cc @@ -9,7 +9,7 @@ #include "content/browser/renderer_host/resource_dispatcher_host.h" #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" #include "content/browser/ssl/ssl_cert_error_handler.h" -#include "content/browser/tab_contents/navigation_controller.h" +#include "content/browser/tab_contents/navigation_controller_impl.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/browser_thread.h" #include "net/base/net_errors.h" diff --git a/content/browser/ssl/ssl_manager.cc b/content/browser/ssl/ssl_manager.cc index 518217a..a3e1c03 100644 --- a/content/browser/ssl/ssl_manager.cc +++ b/content/browser/ssl/ssl_manager.cc @@ -56,7 +56,7 @@ void SSLManager::OnSSLCertificateError(ResourceDispatcherHost* rdh, // static void SSLManager::NotifySSLInternalStateChanged( - NavigationController* controller) { + NavigationControllerImpl* controller) { content::NotificationService::current()->Notify( content::NOTIFICATION_SSL_INTERNAL_STATE_CHANGED, content::Source<content::BrowserContext>(controller->GetBrowserContext()), @@ -101,7 +101,7 @@ bool SSLManager::DeserializeSecurityInfo(const std::string& state, pickle.ReadInt(&iter, ssl_connection_status); } -SSLManager::SSLManager(NavigationController* controller) +SSLManager::SSLManager(NavigationControllerImpl* controller) : backend_(controller), policy_(new SSLPolicy(&backend_)), controller_(controller) { diff --git a/content/browser/ssl/ssl_manager.h b/content/browser/ssl/ssl_manager.h index 6aa98cc..83deee8 100644 --- a/content/browser/ssl/ssl_manager.h +++ b/content/browser/ssl/ssl_manager.h @@ -19,7 +19,7 @@ #include "net/base/net_errors.h" class LoadFromMemoryCacheDetails; -class NavigationController; +class NavigationControllerImpl; class ResourceDispatcherHost; class ResourceRedirectDetails; class ResourceRequestDetails; @@ -57,7 +57,8 @@ class SSLManager : public content::NotificationObserver { // Called when SSL state for a host or tab changes. Broadcasts the // SSL_INTERNAL_STATE_CHANGED notification. - static void NotifySSLInternalStateChanged(NavigationController* controller); + static void NotifySSLInternalStateChanged( + NavigationControllerImpl* controller); // Convenience methods for serializing/deserializing the security info. static std::string SerializeSecurityInfo(int cert_id, @@ -73,7 +74,7 @@ class SSLManager : public content::NotificationObserver { // Construct an SSLManager for the specified tab. // If |delegate| is NULL, SSLPolicy::GetDefaultPolicy() is used. - explicit SSLManager(NavigationController* controller); + explicit SSLManager(NavigationControllerImpl* controller); virtual ~SSLManager(); SSLPolicy* policy() { return policy_.get(); } @@ -81,7 +82,7 @@ class SSLManager : public content::NotificationObserver { // The navigation controller associated with this SSLManager. The // NavigationController is guaranteed to outlive the SSLManager. - NavigationController* controller() { return controller_; } + NavigationControllerImpl* controller() { return controller_; } // This entry point is called directly (instead of via the notification // service) because we need more precise control of the order in which folks @@ -123,7 +124,7 @@ class SSLManager : public content::NotificationObserver { // The NavigationController that owns this SSLManager. We are responsible // for the security UI of this tab. - NavigationController* controller_; + NavigationControllerImpl* controller_; // Handles registering notifications with the NotificationService. content::NotificationRegistrar registrar_; diff --git a/content/browser/ssl/ssl_policy_backend.cc b/content/browser/ssl/ssl_policy_backend.cc index f44c26c..b19965a 100644 --- a/content/browser/ssl/ssl_policy_backend.cc +++ b/content/browser/ssl/ssl_policy_backend.cc @@ -5,10 +5,10 @@ #include "content/browser/ssl/ssl_policy_backend.h" #include "content/browser/ssl/ssl_host_state.h" -#include "content/browser/tab_contents/navigation_controller.h" +#include "content/browser/tab_contents/navigation_controller_impl.h" #include "content/public/browser/browser_context.h" -SSLPolicyBackend::SSLPolicyBackend(NavigationController* controller) +SSLPolicyBackend::SSLPolicyBackend(NavigationControllerImpl* controller) : ssl_host_state_(controller->GetBrowserContext()->GetSSLHostState()), controller_(controller) { DCHECK(controller_); diff --git a/content/browser/ssl/ssl_policy_backend.h b/content/browser/ssl/ssl_policy_backend.h index 8c88af5..470312b 100644 --- a/content/browser/ssl/ssl_policy_backend.h +++ b/content/browser/ssl/ssl_policy_backend.h @@ -13,12 +13,12 @@ #include "base/string16.h" #include "net/base/x509_certificate.h" -class NavigationController; +class NavigationControllerImpl; class SSLHostState; class SSLPolicyBackend { public: - explicit SSLPolicyBackend(NavigationController* controller); + explicit SSLPolicyBackend(NavigationControllerImpl* controller); // Records that a host has run insecure content. void HostRanInsecureContent(const std::string& host, int pid); @@ -40,7 +40,7 @@ class SSLPolicyBackend { // SSL state specific for each host. SSLHostState* ssl_host_state_; - NavigationController* controller_; + NavigationControllerImpl* controller_; DISALLOW_COPY_AND_ASSIGN(SSLPolicyBackend); }; diff --git a/content/browser/tab_contents/interstitial_page.cc b/content/browser/tab_contents/interstitial_page.cc index 439130f..1b6fb22 100644 --- a/content/browser/tab_contents/interstitial_page.cc +++ b/content/browser/tab_contents/interstitial_page.cc @@ -17,7 +17,7 @@ #include "content/browser/renderer_host/render_widget_host_view.h" #include "content/browser/renderer_host/resource_dispatcher_host.h" #include "content/browser/site_instance.h" -#include "content/browser/tab_contents/navigation_controller.h" +#include "content/browser/tab_contents/navigation_controller_impl.h" #include "content/browser/tab_contents/navigation_entry_impl.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_view.h" diff --git a/content/browser/tab_contents/navigation_controller.cc b/content/browser/tab_contents/navigation_controller_impl.cc index 307a694..7cac6fc 100644 --- a/content/browser/tab_contents/navigation_controller.cc +++ b/content/browser/tab_contents/navigation_controller_impl.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/browser/tab_contents/navigation_controller.h" +#include "content/browser/tab_contents/navigation_controller_impl.h" #include "base/file_util.h" #include "base/logging.h" @@ -45,7 +45,7 @@ const int kInvalidateAll = 0xFFFFFFFF; // Invoked when entries have been pruned, or removed. For example, if the // current entries are [google, digg, yahoo], with the current entry google, // and the user types in cnet, then digg and yahoo are pruned. -void NotifyPrunedEntries(NavigationController* nav_controller, +void NotifyPrunedEntries(NavigationControllerImpl* nav_controller, bool from_front, int count) { content::PrunedDetails details; @@ -108,12 +108,12 @@ bool AreURLsInPageNavigation(const GURL& existing_url, const GURL& new_url) { } // namespace -// NavigationController --------------------------------------------------- +// NavigationControllerImpl ---------------------------------------------------- const size_t kMaxEntryCountForTestingNotSet = -1; // static -size_t NavigationController::max_entry_count_for_testing_ = +size_t NavigationControllerImpl::max_entry_count_for_testing_ = kMaxEntryCountForTestingNotSet; // Should Reload check for post data? The default is true, but is set to false @@ -161,7 +161,7 @@ void NavigationController::DisablePromptOnRepost() { } // namespace content -NavigationController::NavigationController( +NavigationControllerImpl::NavigationControllerImpl( TabContents* contents, BrowserContext* browser_context, SessionStorageNamespace* session_storage_namespace) @@ -183,7 +183,7 @@ NavigationController::NavigationController( } } -NavigationController::~NavigationController() { +NavigationControllerImpl::~NavigationControllerImpl() { DiscardNonCommittedEntriesInternal(); content::NotificationService::current()->Notify( @@ -192,19 +192,20 @@ NavigationController::~NavigationController() { content::NotificationService::NoDetails()); } -WebContents* NavigationController::GetWebContents() const { +WebContents* NavigationControllerImpl::GetWebContents() const { return tab_contents_; } -BrowserContext* NavigationController::GetBrowserContext() const { +BrowserContext* NavigationControllerImpl::GetBrowserContext() const { return browser_context_; } -void NavigationController::SetBrowserContext(BrowserContext* browser_context) { +void NavigationControllerImpl::SetBrowserContext( + BrowserContext* browser_context) { browser_context_ = browser_context; } -void NavigationController::Restore( +void NavigationControllerImpl::Restore( int selected_navigation, bool from_last_session, std::vector<NavigationEntry*>* entries) { @@ -225,15 +226,15 @@ void NavigationController::Restore( FinishRestore(selected_navigation, from_last_session); } -void NavigationController::Reload(bool check_for_repost) { +void NavigationControllerImpl::Reload(bool check_for_repost) { ReloadInternal(check_for_repost, RELOAD); } -void NavigationController::ReloadIgnoringCache(bool check_for_repost) { +void NavigationControllerImpl::ReloadIgnoringCache(bool check_for_repost) { ReloadInternal(check_for_repost, RELOAD_IGNORING_CACHE); } -void NavigationController::ReloadInternal(bool check_for_repost, - ReloadType reload_type) { +void NavigationControllerImpl::ReloadInternal(bool check_for_repost, + ReloadType reload_type) { // Reloading a transient entry does nothing. if (transient_entry_index_ != -1) return; @@ -269,12 +270,12 @@ void NavigationController::ReloadInternal(bool check_for_repost, } } -void NavigationController::CancelPendingReload() { +void NavigationControllerImpl::CancelPendingReload() { DCHECK(pending_reload_ != NO_RELOAD); pending_reload_ = NO_RELOAD; } -void NavigationController::ContinuePendingReload() { +void NavigationControllerImpl::ContinuePendingReload() { if (pending_reload_ == NO_RELOAD) { NOTREACHED(); } else { @@ -283,17 +284,17 @@ void NavigationController::ContinuePendingReload() { } } -bool NavigationController::IsInitialNavigation() { +bool NavigationControllerImpl::IsInitialNavigation() { return last_document_loaded_.is_null(); } -NavigationEntryImpl* NavigationController::GetEntryWithPageID( +NavigationEntryImpl* NavigationControllerImpl::GetEntryWithPageID( SiteInstance* instance, int32 page_id) const { int index = GetEntryIndexWithPageID(instance, page_id); return (index != -1) ? entries_[index].get() : NULL; } -void NavigationController::LoadEntry(NavigationEntryImpl* entry) { +void NavigationControllerImpl::LoadEntry(NavigationEntryImpl* entry) { // Don't navigate to URLs disabled by policy. This prevents showing the URL // on the Omnibar when it is also going to be blocked by // ChildProcessSecurityPolicy::CanRequestURL. @@ -319,7 +320,7 @@ void NavigationController::LoadEntry(NavigationEntryImpl* entry) { NavigateToPendingEntry(NO_RELOAD); } -NavigationEntry* NavigationController::GetActiveEntry() const { +NavigationEntry* NavigationControllerImpl::GetActiveEntry() const { if (transient_entry_index_ != -1) return entries_[transient_entry_index_].get(); if (pending_entry_) @@ -327,7 +328,7 @@ NavigationEntry* NavigationController::GetActiveEntry() const { return GetLastCommittedEntry(); } -NavigationEntry* NavigationController::GetVisibleEntry() const { +NavigationEntry* NavigationControllerImpl::GetVisibleEntry() const { if (transient_entry_index_ != -1) return entries_[transient_entry_index_].get(); // Only return the pending_entry for new (non-history), browser-initiated @@ -343,7 +344,7 @@ NavigationEntry* NavigationController::GetVisibleEntry() const { return GetLastCommittedEntry(); } -int NavigationController::GetCurrentEntryIndex() const { +int NavigationControllerImpl::GetCurrentEntryIndex() const { if (transient_entry_index_ != -1) return transient_entry_index_; if (pending_entry_index_ != -1) @@ -351,13 +352,13 @@ int NavigationController::GetCurrentEntryIndex() const { return last_committed_entry_index_; } -NavigationEntry* NavigationController::GetLastCommittedEntry() const { +NavigationEntry* NavigationControllerImpl::GetLastCommittedEntry() const { if (last_committed_entry_index_ == -1) return NULL; return entries_[last_committed_entry_index_].get(); } -bool NavigationController::CanViewSource() const { +bool NavigationControllerImpl::CanViewSource() const { bool is_supported_mime_type = net::IsSupportedNonImageMimeType( tab_contents_->GetContentsMimeType().c_str()); NavigationEntry* active_entry = GetActiveEntry(); @@ -365,20 +366,20 @@ bool NavigationController::CanViewSource() const { is_supported_mime_type && !tab_contents_->GetInterstitialPage(); } -int NavigationController::GetLastCommittedEntryIndex() const { +int NavigationControllerImpl::GetLastCommittedEntryIndex() const { return last_committed_entry_index_; } -int NavigationController::GetEntryCount() const { +int NavigationControllerImpl::GetEntryCount() const { return static_cast<int>(entries_.size()); } -NavigationEntry* NavigationController::GetEntryAtIndex( +NavigationEntry* NavigationControllerImpl::GetEntryAtIndex( int index) const { return entries_.at(index).get(); } -NavigationEntry* NavigationController::GetEntryAtOffset( +NavigationEntry* NavigationControllerImpl::GetEntryAtOffset( int offset) const { int index = (transient_entry_index_ != -1) ? transient_entry_index_ + offset : @@ -389,16 +390,16 @@ NavigationEntry* NavigationController::GetEntryAtOffset( return entries_[index].get(); } -bool NavigationController::CanGoBack() const { +bool NavigationControllerImpl::CanGoBack() const { return entries_.size() > 1 && GetCurrentEntryIndex() > 0; } -bool NavigationController::CanGoForward() const { +bool NavigationControllerImpl::CanGoForward() const { int index = GetCurrentEntryIndex(); return index >= 0 && index < (static_cast<int>(entries_.size()) - 1); } -void NavigationController::GoBack() { +void NavigationControllerImpl::GoBack() { if (!CanGoBack()) { NOTREACHED(); return; @@ -417,7 +418,7 @@ void NavigationController::GoBack() { NavigateToPendingEntry(NO_RELOAD); } -void NavigationController::GoForward() { +void NavigationControllerImpl::GoForward() { if (!CanGoForward()) { NOTREACHED(); return; @@ -443,7 +444,7 @@ void NavigationController::GoForward() { NavigateToPendingEntry(NO_RELOAD); } -void NavigationController::GoToIndex(int index) { +void NavigationControllerImpl::GoToIndex(int index) { if (index < 0 || index >= static_cast<int>(entries_.size())) { NOTREACHED(); return; @@ -470,7 +471,7 @@ void NavigationController::GoToIndex(int index) { NavigateToPendingEntry(NO_RELOAD); } -void NavigationController::GoToOffset(int offset) { +void NavigationControllerImpl::GoToOffset(int offset) { int index = (transient_entry_index_ != -1) ? transient_entry_index_ + offset : last_committed_entry_index_ + offset; @@ -480,14 +481,14 @@ void NavigationController::GoToOffset(int offset) { GoToIndex(index); } -void NavigationController::RemoveEntryAtIndex(int index) { +void NavigationControllerImpl::RemoveEntryAtIndex(int index) { if (index == last_committed_entry_index_) return; RemoveEntryAtIndexInternal(index); } -void NavigationController::UpdateVirtualURLToURL( +void NavigationControllerImpl::UpdateVirtualURLToURL( NavigationEntryImpl* entry, const GURL& new_url) { GURL new_virtual_url(new_url); if (BrowserURLHandler::GetInstance()->ReverseURLRewrite( @@ -496,7 +497,7 @@ void NavigationController::UpdateVirtualURLToURL( } } -void NavigationController::AddTransientEntry(NavigationEntryImpl* entry) { +void NavigationControllerImpl::AddTransientEntry(NavigationEntryImpl* entry) { // Discard any current transient entry, we can only have one at a time. int index = 0; if (last_committed_entry_index_ != -1) @@ -508,7 +509,7 @@ void NavigationController::AddTransientEntry(NavigationEntryImpl* entry) { tab_contents_->NotifyNavigationStateChanged(kInvalidateAll); } -void NavigationController::TransferURL( +void NavigationControllerImpl::TransferURL( const GURL& url, const content::Referrer& referrer, content::PageTransition transition, @@ -527,7 +528,7 @@ void NavigationController::TransferURL( LoadEntry(entry); } -void NavigationController::LoadURL( +void NavigationControllerImpl::LoadURL( const GURL& url, const content::Referrer& referrer, content::PageTransition transition, @@ -542,7 +543,7 @@ void NavigationController::LoadURL( LoadEntry(entry); } -void NavigationController::LoadURLFromRenderer( +void NavigationControllerImpl::LoadURLFromRenderer( const GURL& url, const content::Referrer& referrer, content::PageTransition transition, @@ -557,11 +558,11 @@ void NavigationController::LoadURLFromRenderer( LoadEntry(entry); } -void NavigationController::DocumentLoadedInFrame() { +void NavigationControllerImpl::DocumentLoadedInFrame() { last_document_loaded_ = base::TimeTicks::Now(); } -bool NavigationController::RendererDidNavigate( +bool NavigationControllerImpl::RendererDidNavigate( const ViewHostMsg_FrameNavigate_Params& params, content::LoadCommittedDetails* details) { @@ -645,7 +646,7 @@ bool NavigationController::RendererDidNavigate( return true; } -content::NavigationType NavigationController::ClassifyNavigation( +content::NavigationType NavigationControllerImpl::ClassifyNavigation( const ViewHostMsg_FrameNavigate_Params& params) const { if (params.page_id == -1) { // The renderer generates the page IDs, and so if it gives us the invalid @@ -770,7 +771,7 @@ content::NavigationType NavigationController::ClassifyNavigation( return content::NAVIGATION_TYPE_EXISTING_PAGE; } -bool NavigationController::IsRedirect( +bool NavigationControllerImpl::IsRedirect( const ViewHostMsg_FrameNavigate_Params& params) { // For main frame transition, we judge by params.transition. // Otherwise, by params.redirects. @@ -780,7 +781,7 @@ bool NavigationController::IsRedirect( return params.redirects.size() > 1; } -void NavigationController::RendererDidNavigateToNewPage( +void NavigationControllerImpl::RendererDidNavigateToNewPage( const ViewHostMsg_FrameNavigate_Params& params, bool* did_replace_entry) { NavigationEntryImpl* new_entry; bool update_virtual_url; @@ -816,7 +817,7 @@ void NavigationController::RendererDidNavigateToNewPage( InsertOrReplaceEntry(new_entry, *did_replace_entry); } -void NavigationController::RendererDidNavigateToExistingPage( +void NavigationControllerImpl::RendererDidNavigateToExistingPage( const ViewHostMsg_FrameNavigate_Params& params) { // We should only get here for main frame navigations. DCHECK(content::PageTransitionIsMainFrame(params.transition)); @@ -860,7 +861,7 @@ void NavigationController::RendererDidNavigateToExistingPage( GetEntryIndexWithPageID(tab_contents_->GetSiteInstance(), params.page_id); } -void NavigationController::RendererDidNavigateToSamePage( +void NavigationControllerImpl::RendererDidNavigateToSamePage( const ViewHostMsg_FrameNavigate_Params& params) { // This mode implies we have a pending entry that's the same as an existing // entry for this page ID. This entry is guaranteed to exist by @@ -881,7 +882,7 @@ void NavigationController::RendererDidNavigateToSamePage( DiscardNonCommittedEntries(); } -void NavigationController::RendererDidNavigateInPage( +void NavigationControllerImpl::RendererDidNavigateInPage( const ViewHostMsg_FrameNavigate_Params& params, bool* did_replace_entry) { DCHECK(content::PageTransitionIsMainFrame(params.transition)) << "WebKit should only tell us about in-page navs for the main frame."; @@ -909,7 +910,7 @@ void NavigationController::RendererDidNavigateInPage( GetEntryIndexWithPageID(tab_contents_->GetSiteInstance(), params.page_id); } -void NavigationController::RendererDidNavigateNewSubframe( +void NavigationControllerImpl::RendererDidNavigateNewSubframe( const ViewHostMsg_FrameNavigate_Params& params) { if (content::PageTransitionStripQualifier(params.transition) == content::PAGE_TRANSITION_AUTO_SUBFRAME) { @@ -929,7 +930,7 @@ void NavigationController::RendererDidNavigateNewSubframe( InsertOrReplaceEntry(new_entry, false); } -bool NavigationController::RendererDidNavigateAutoSubframe( +bool NavigationControllerImpl::RendererDidNavigateAutoSubframe( const ViewHostMsg_FrameNavigate_Params& params) { // We're guaranteed to have a previously committed entry, and we now need to // handle navigation inside of a subframe in it without creating a new entry. @@ -955,7 +956,7 @@ bool NavigationController::RendererDidNavigateAutoSubframe( return false; } -int NavigationController::GetIndexOfEntry( +int NavigationControllerImpl::GetIndexOfEntry( const NavigationEntryImpl* entry) const { const NavigationEntries::const_iterator i(std::find( entries_.begin(), @@ -964,17 +965,17 @@ int NavigationController::GetIndexOfEntry( return (i == entries_.end()) ? -1 : static_cast<int>(i - entries_.begin()); } -bool NavigationController::IsURLInPageNavigation(const GURL& url) const { +bool NavigationControllerImpl::IsURLInPageNavigation(const GURL& url) const { NavigationEntry* last_committed = GetLastCommittedEntry(); if (!last_committed) return false; return AreURLsInPageNavigation(last_committed->GetURL(), url); } -void NavigationController::CopyStateFrom( +void NavigationControllerImpl::CopyStateFrom( const content::NavigationController& temp) { - const NavigationController& source = - static_cast<const NavigationController&>(temp); + const NavigationControllerImpl& source = + static_cast<const NavigationControllerImpl&>(temp); // Verify that we look new. DCHECK(GetEntryCount() == 0 && !GetPendingEntry()); @@ -989,9 +990,10 @@ void NavigationController::CopyStateFrom( FinishRestore(source.last_committed_entry_index_, false); } -void NavigationController::CopyStateFromAndPrune( +void NavigationControllerImpl::CopyStateFromAndPrune( content::NavigationController* temp) { - NavigationController* source = static_cast<NavigationController*>(temp); + NavigationControllerImpl* source = + static_cast<NavigationControllerImpl*>(temp); // The SiteInstance and page_id of the last committed entry needs to be // remembered at this point, in case there is only one committed entry // and it is pruned. @@ -1039,7 +1041,7 @@ void NavigationController::CopyStateFromAndPrune( minimum_page_id); } -void NavigationController::PruneAllButActive() { +void NavigationControllerImpl::PruneAllButActive() { if (transient_entry_index_ != -1) { // There is a transient entry. Prune up to it. DCHECK_EQ(GetEntryCount() - 1, transient_entry_index_); @@ -1077,27 +1079,28 @@ void NavigationController::PruneAllButActive() { } } -SSLManager* NavigationController::GetSSLManager() { +SSLManager* NavigationControllerImpl::GetSSLManager() { return &ssl_manager_; } -void NavigationController::SetMaxRestoredPageID(int32 max_id) { +void NavigationControllerImpl::SetMaxRestoredPageID(int32 max_id) { max_restored_page_id_ = max_id; } -int32 NavigationController::GetMaxRestoredPageID() const { +int32 NavigationControllerImpl::GetMaxRestoredPageID() const { return max_restored_page_id_; } SessionStorageNamespace* - NavigationController::GetSessionStorageNamespace() const { + NavigationControllerImpl::GetSessionStorageNamespace() const { return session_storage_namespace_; } -bool NavigationController::NeedsReload() const { + +bool NavigationControllerImpl::NeedsReload() const { return needs_reload_; } -void NavigationController::RemoveEntryAtIndexInternal(int index) { +void NavigationControllerImpl::RemoveEntryAtIndexInternal(int index) { DCHECK(index < GetEntryCount()); DCHECK(index != last_committed_entry_index_); @@ -1108,7 +1111,7 @@ void NavigationController::RemoveEntryAtIndexInternal(int index) { last_committed_entry_index_--; } -void NavigationController::DiscardNonCommittedEntries() { +void NavigationControllerImpl::DiscardNonCommittedEntries() { bool transient = transient_entry_index_ != -1; DiscardNonCommittedEntriesInternal(); @@ -1119,16 +1122,16 @@ void NavigationController::DiscardNonCommittedEntries() { } } -NavigationEntry* NavigationController::GetPendingEntry() const { +NavigationEntry* NavigationControllerImpl::GetPendingEntry() const { return pending_entry_; } -int NavigationController::GetPendingEntryIndex() const { +int NavigationControllerImpl::GetPendingEntryIndex() const { return pending_entry_index_; } -void NavigationController::InsertOrReplaceEntry(NavigationEntryImpl* entry, - bool replace) { +void NavigationControllerImpl::InsertOrReplaceEntry(NavigationEntryImpl* entry, + bool replace) { DCHECK(entry->GetTransitionType() != content::PAGE_TRANSITION_AUTO_SUBFRAME); // Copy the pending entry's unique ID to the committed entry. @@ -1175,7 +1178,7 @@ void NavigationController::InsertOrReplaceEntry(NavigationEntryImpl* entry, tab_contents_->UpdateMaxPageID(entry->GetPageID()); } -void NavigationController::NavigateToPendingEntry(ReloadType reload_type) { +void NavigationControllerImpl::NavigateToPendingEntry(ReloadType reload_type) { needs_reload_ = false; // If we were navigating to a slow-to-commit page, and the user performs @@ -1228,7 +1231,7 @@ void NavigationController::NavigateToPendingEntry(ReloadType reload_type) { } } -void NavigationController::NotifyNavigationEntryCommitted( +void NavigationControllerImpl::NotifyNavigationEntryCommitted( content::LoadCommittedDetails* details) { details->entry = GetActiveEntry(); content::NotificationDetails notification_details = @@ -1251,18 +1254,18 @@ void NavigationController::NotifyNavigationEntryCommitted( } // static -size_t NavigationController::max_entry_count() { +size_t NavigationControllerImpl::max_entry_count() { if (max_entry_count_for_testing_ != kMaxEntryCountForTestingNotSet) return max_entry_count_for_testing_; return content::kMaxSessionHistoryEntries; } -void NavigationController::SetActive(bool is_active) { +void NavigationControllerImpl::SetActive(bool is_active) { if (is_active && needs_reload_) LoadIfNecessary(); } -void NavigationController::LoadIfNecessary() { +void NavigationControllerImpl::LoadIfNecessary() { if (!needs_reload_) return; @@ -1273,8 +1276,8 @@ void NavigationController::LoadIfNecessary() { NavigateToPendingEntry(NO_RELOAD); } -void NavigationController::NotifyEntryChanged(const NavigationEntry* entry, - int index) { +void NavigationControllerImpl::NotifyEntryChanged(const NavigationEntry* entry, + int index) { content::EntryChangedDetails det; det.changed_entry = entry; det.index = index; @@ -1284,8 +1287,8 @@ void NavigationController::NotifyEntryChanged(const NavigationEntry* entry, content::Details<content::EntryChangedDetails>(&det)); } -void NavigationController::FinishRestore(int selected_index, - bool from_last_session) { +void NavigationControllerImpl::FinishRestore(int selected_index, + bool from_last_session) { DCHECK(selected_index >= 0 && selected_index < GetEntryCount()); ConfigureEntriesForRestore(&entries_, from_last_session); @@ -1294,7 +1297,7 @@ void NavigationController::FinishRestore(int selected_index, last_committed_entry_index_ = selected_index; } -void NavigationController::DiscardNonCommittedEntriesInternal() { +void NavigationControllerImpl::DiscardNonCommittedEntriesInternal() { if (pending_entry_index_ == -1) delete pending_entry_; pending_entry_ = NULL; @@ -1303,7 +1306,7 @@ void NavigationController::DiscardNonCommittedEntriesInternal() { DiscardTransientEntry(); } -void NavigationController::DiscardTransientEntry() { +void NavigationControllerImpl::DiscardTransientEntry() { if (transient_entry_index_ == -1) return; entries_.erase(entries_.begin() + transient_entry_index_); @@ -1312,7 +1315,7 @@ void NavigationController::DiscardTransientEntry() { transient_entry_index_ = -1; } -int NavigationController::GetEntryIndexWithPageID( +int NavigationControllerImpl::GetEntryIndexWithPageID( SiteInstance* instance, int32 page_id) const { for (int i = static_cast<int>(entries_.size()) - 1; i >= 0; --i) { if ((entries_[i]->site_instance() == instance) && @@ -1322,14 +1325,14 @@ int NavigationController::GetEntryIndexWithPageID( return -1; } -NavigationEntry* NavigationController::GetTransientEntry() const { +NavigationEntry* NavigationControllerImpl::GetTransientEntry() const { if (transient_entry_index_ == -1) return NULL; return entries_[transient_entry_index_].get(); } -void NavigationController::InsertEntriesFrom( - const NavigationController& source, +void NavigationControllerImpl::InsertEntriesFrom( + const NavigationControllerImpl& source, int max_index) { DCHECK_LE(max_index, source.GetEntryCount()); size_t insert_index = 0; diff --git a/content/browser/tab_contents/navigation_controller.h b/content/browser/tab_contents/navigation_controller_impl.h index 7625906..b8567f2 100644 --- a/content/browser/tab_contents/navigation_controller.h +++ b/content/browser/tab_contents/navigation_controller_impl.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ -#define CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ +#ifndef CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_IMPL_H_ +#define CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_IMPL_H_ #pragma once #include "build/build_config.h" @@ -23,14 +23,13 @@ class NavigationEntryImpl; struct LoadCommittedDetails; } -// TODO(jam): rename to NavigationControllerImpl once chrome only uses the i/f. -class CONTENT_EXPORT NavigationController +class CONTENT_EXPORT NavigationControllerImpl : public NON_EXPORTED_BASE(content::NavigationController) { public: - NavigationController(TabContents* tab_contents, - content::BrowserContext* browser_context, - SessionStorageNamespace* session_storage_namespace); - virtual ~NavigationController(); + NavigationControllerImpl(TabContents* tab_contents, + content::BrowserContext* browser_context, + SessionStorageNamespace* session_storage_namespace); + virtual ~NavigationControllerImpl(); // NavigationController implementation: virtual content::WebContents* GetWebContents() const OVERRIDE; @@ -255,7 +254,7 @@ class CONTENT_EXPORT NavigationController // adjust any of the members that reference entries_ // (last_committed_entry_index_, pending_entry_index_ or // transient_entry_index_). - void InsertEntriesFrom(const NavigationController& source, int max_index); + void InsertEntriesFrom(const NavigationControllerImpl& source, int max_index); // --------------------------------------------------------------------------- @@ -318,7 +317,7 @@ class CONTENT_EXPORT NavigationController // NO_RELOAD otherwise. ReloadType pending_reload_; - DISALLOW_COPY_AND_ASSIGN(NavigationController); + DISALLOW_COPY_AND_ASSIGN(NavigationControllerImpl); }; -#endif // CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ +#endif // CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_IMPL_H_ diff --git a/content/browser/tab_contents/navigation_controller_unittest.cc b/content/browser/tab_contents/navigation_controller_impl_unittest.cc index b109b324..96e448a 100644 --- a/content/browser/tab_contents/navigation_controller_unittest.cc +++ b/content/browser/tab_contents/navigation_controller_impl_unittest.cc @@ -18,7 +18,7 @@ // #include "chrome/browser/sessions/session_types.h" #include "content/browser/renderer_host/test_render_view_host.h" #include "content/browser/site_instance.h" -#include "content/browser/tab_contents/navigation_controller.h" +#include "content/browser/tab_contents/navigation_controller_impl.h" #include "content/browser/tab_contents/navigation_entry_impl.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/test_tab_contents.h" @@ -46,7 +46,7 @@ class NavigationControllerTest : public RenderViewHostTestHarness { }; void RegisterForAllNavNotifications(TestNotificationTracker* tracker, - NavigationController* controller) { + NavigationControllerImpl* controller) { tracker->ListenFor(content::NOTIFICATION_NAV_ENTRY_COMMITTED, content::Source<content::NavigationController>( controller)); @@ -1393,7 +1393,7 @@ TEST_F(NavigationControllerTest, ClientRedirectAfterInPageNavigation) { // content::NOTIFICATION_NAV_LIST_PRUNED method. class PrunedListener : public content::NotificationObserver { public: - explicit PrunedListener(NavigationController* controller) + explicit PrunedListener(NavigationControllerImpl* controller) : notification_count_(0) { registrar_.Add(this, content::NOTIFICATION_NAV_LIST_PRUNED, content::Source<content::NavigationController>(controller)); @@ -1422,10 +1422,10 @@ class PrunedListener : public content::NotificationObserver { // Tests that we limit the number of navigation entries created correctly. TEST_F(NavigationControllerTest, EnforceMaxNavigationCount) { - size_t original_count = NavigationController::max_entry_count(); + size_t original_count = NavigationControllerImpl::max_entry_count(); const int kMaxEntryCount = 5; - NavigationController::set_max_entry_count_for_testing(kMaxEntryCount); + NavigationControllerImpl::set_max_entry_count_for_testing(kMaxEntryCount); int url_index; // Load up to the max count, all entries should be there. @@ -1472,7 +1472,7 @@ TEST_F(NavigationControllerTest, EnforceMaxNavigationCount) { EXPECT_EQ(controller().GetEntryAtIndex(0)->GetURL(), GURL("http:////www.a.com/4")); - NavigationController::set_max_entry_count_for_testing(original_count); + NavigationControllerImpl::set_max_entry_count_for_testing(original_count); } // Tests that we can do a restore and navigate to the restored entries and @@ -1482,7 +1482,7 @@ TEST_F(NavigationControllerTest, RestoreNavigate) { // Create a NavigationController with a restored set of tabs. GURL url("http://foo"); std::vector<NavigationEntry*> entries; - NavigationEntry* entry = NavigationController::CreateNavigationEntry( + NavigationEntry* entry = NavigationControllerImpl::CreateNavigationEntry( url, content::Referrer(), content::PAGE_TRANSITION_RELOAD, false, std::string(), browser_context()); entry->SetPageID(0); @@ -1491,7 +1491,7 @@ TEST_F(NavigationControllerTest, RestoreNavigate) { entries.push_back(entry); TabContents our_contents( browser_context(), NULL, MSG_ROUTING_NONE, NULL, NULL); - NavigationController& our_controller = our_contents.GetControllerImpl(); + NavigationControllerImpl& our_controller = our_contents.GetControllerImpl(); our_controller.Restore(0, true, &entries); ASSERT_EQ(0u, entries.size()); @@ -1549,7 +1549,7 @@ TEST_F(NavigationControllerTest, RestoreNavigateAfterFailure) { // Create a NavigationController with a restored set of tabs. GURL url("http://foo"); std::vector<NavigationEntry*> entries; - NavigationEntry* entry = NavigationController::CreateNavigationEntry( + NavigationEntry* entry = NavigationControllerImpl::CreateNavigationEntry( url, content::Referrer(), content::PAGE_TRANSITION_RELOAD, false, std::string(), browser_context()); entry->SetPageID(0); @@ -1558,7 +1558,7 @@ TEST_F(NavigationControllerTest, RestoreNavigateAfterFailure) { entries.push_back(entry); TabContents our_contents( browser_context(), NULL, MSG_ROUTING_NONE, NULL, NULL); - NavigationController& our_controller = our_contents.GetControllerImpl(); + NavigationControllerImpl& our_controller = our_contents.GetControllerImpl(); our_controller.Restore(0, true, &entries); ASSERT_EQ(0u, entries.size()); @@ -2012,7 +2012,8 @@ TEST_F(NavigationControllerTest, CopyStateFromAndPrune) { NavigateAndCommit(url2); scoped_ptr<TestTabContents> other_contents(CreateTestTabContents()); - NavigationController& other_controller = other_contents->GetControllerImpl(); + NavigationControllerImpl& other_controller = + other_contents->GetControllerImpl(); other_contents->NavigateAndCommit(url3); other_contents->ExpectSetHistoryLengthAndPrune( NavigationEntryImpl::FromNavigationEntry( @@ -2043,7 +2044,8 @@ TEST_F(NavigationControllerTest, CopyStateFromAndPrune2) { controller().GoBack(); scoped_ptr<TestTabContents> other_contents(CreateTestTabContents()); - NavigationController& other_controller = other_contents->GetControllerImpl(); + NavigationControllerImpl& other_controller = + other_contents->GetControllerImpl(); other_contents->ExpectSetHistoryLengthAndPrune(NULL, 1, -1); other_controller.CopyStateFromAndPrune(&controller()); @@ -2068,7 +2070,8 @@ TEST_F(NavigationControllerTest, CopyStateFromAndPrune3) { controller().GoBack(); scoped_ptr<TestTabContents> other_contents(CreateTestTabContents()); - NavigationController& other_controller = other_contents->GetControllerImpl(); + NavigationControllerImpl& other_controller = + other_contents->GetControllerImpl(); other_controller.LoadURL( url3, content::Referrer(), content::PAGE_TRANSITION_TYPED, std::string()); other_contents->ExpectSetHistoryLengthAndPrune(NULL, 1, -1); diff --git a/content/browser/tab_contents/render_view_host_manager.cc b/content/browser/tab_contents/render_view_host_manager.cc index 0963f8d..fbbe49c 100644 --- a/content/browser/tab_contents/render_view_host_manager.cc +++ b/content/browser/tab_contents/render_view_host_manager.cc @@ -12,7 +12,7 @@ #include "content/browser/renderer_host/render_view_host_factory.h" #include "content/browser/renderer_host/render_widget_host_view.h" #include "content/browser/site_instance.h" -#include "content/browser/tab_contents/navigation_controller.h" +#include "content/browser/tab_contents/navigation_controller_impl.h" #include "content/browser/tab_contents/navigation_entry_impl.h" #include "content/browser/tab_contents/tab_contents_view.h" #include "content/browser/webui/web_ui.h" @@ -379,7 +379,8 @@ SiteInstance* RenderViewHostManager::GetSiteInstanceForEntry( // NOTE: This is only called when ShouldTransitionCrossSite is true. const GURL& dest_url = entry.GetURL(); - NavigationController& controller = delegate_->GetControllerForRenderManager(); + NavigationControllerImpl& controller = + delegate_->GetControllerForRenderManager(); content::BrowserContext* browser_context = controller.GetBrowserContext(); // If the entry has an instance already we should use it. diff --git a/content/browser/tab_contents/render_view_host_manager.h b/content/browser/tab_contents/render_view_host_manager.h index a8051f2..73c2fca 100644 --- a/content/browser/tab_contents/render_view_host_manager.h +++ b/content/browser/tab_contents/render_view_host_manager.h @@ -16,7 +16,7 @@ #include "content/public/browser/notification_registrar.h" class InterstitialPage; -class NavigationController; +class NavigationControllerImpl; class RenderViewHost; class RenderWidgetHostView; class WebUI; @@ -63,7 +63,7 @@ class CONTENT_EXPORT RenderViewHostManager RenderViewHost* render_view_host) = 0; virtual void UpdateRenderViewSizeForRenderManager() = 0; virtual void NotifySwappedFromRenderManager() = 0; - virtual NavigationController& GetControllerForRenderManager() = 0; + virtual NavigationControllerImpl& GetControllerForRenderManager() = 0; // Creates a WebUI object for the given URL if one applies. Ownership of the // returned pointer will be passed to the caller. If no WebUI applies, diff --git a/content/browser/tab_contents/render_view_host_manager_unittest.cc b/content/browser/tab_contents/render_view_host_manager_unittest.cc index 1b28b01..c94a809 100644 --- a/content/browser/tab_contents/render_view_host_manager_unittest.cc +++ b/content/browser/tab_contents/render_view_host_manager_unittest.cc @@ -7,7 +7,7 @@ #include "content/browser/mock_content_browser_client.h" #include "content/browser/renderer_host/test_render_view_host.h" #include "content/browser/site_instance.h" -#include "content/browser/tab_contents/navigation_controller.h" +#include "content/browser/tab_contents/navigation_controller_impl.h" #include "content/browser/tab_contents/navigation_entry_impl.h" #include "content/browser/tab_contents/render_view_host_manager.h" #include "content/browser/tab_contents/test_tab_contents.h" diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc index 7683fd2..523bd55 100644 --- a/content/browser/tab_contents/tab_contents.cc +++ b/content/browser/tab_contents/tab_contents.cc @@ -144,11 +144,11 @@ ViewMsg_Navigate_Type::Value GetNavigationType( content::BrowserContext* browser_context, const NavigationEntryImpl& entry, content::NavigationController::ReloadType reload_type) { switch (reload_type) { - case NavigationController::RELOAD: + case NavigationControllerImpl::RELOAD: return ViewMsg_Navigate_Type::RELOAD; - case NavigationController::RELOAD_IGNORING_CACHE: + case NavigationControllerImpl::RELOAD_IGNORING_CACHE: return ViewMsg_Navigate_Type::RELOAD_IGNORING_CACHE; - case NavigationController::NO_RELOAD: + case NavigationControllerImpl::NO_RELOAD: break; // Fall through to rest of function. } @@ -160,7 +160,7 @@ ViewMsg_Navigate_Type::Value GetNavigationType( } void MakeNavigateParams(const NavigationEntryImpl& entry, - const NavigationController& controller, + const NavigationControllerImpl& controller, content::WebContentsDelegate* delegate, content::NavigationController::ReloadType reload_type, ViewMsg_Navigate_Params* params) { @@ -291,7 +291,7 @@ TabContents::~TabContents() { SetDelegate(NULL); } -NavigationController& TabContents::GetControllerImpl() { +NavigationControllerImpl& TabContents::GetControllerImpl() { return controller_; } @@ -1346,7 +1346,7 @@ void TabContents::OnGoToEntryAtOffset(int offset) { content::PageTransitionFromInt( entry->GetTransitionType() | content::PAGE_TRANSITION_FORWARD_BACK)); - NavigateToEntry(*entry, NavigationController::NO_RELOAD); + NavigateToEntry(*entry, NavigationControllerImpl::NO_RELOAD); // If the entry is being restored and doesn't have a SiteInstance yet, fill // it in now that we know. This allows us to find the entry when it commits. @@ -2161,7 +2161,7 @@ void TabContents::NotifySwappedFromRenderManager() { NotifySwapped(); } -NavigationController& TabContents::GetControllerForRenderManager() { +NavigationControllerImpl& TabContents::GetControllerForRenderManager() { return GetControllerImpl(); } diff --git a/content/browser/tab_contents/tab_contents.h b/content/browser/tab_contents/tab_contents.h index 0904d33..504ac90 100644 --- a/content/browser/tab_contents/tab_contents.h +++ b/content/browser/tab_contents/tab_contents.h @@ -18,7 +18,7 @@ #include "content/browser/javascript_dialogs.h" #include "content/browser/renderer_host/java/java_bridge_dispatcher_host_manager.h" #include "content/browser/renderer_host/render_view_host_delegate.h" -#include "content/browser/tab_contents/navigation_controller.h" +#include "content/browser/tab_contents/navigation_controller_impl.h" #include "content/browser/tab_contents/render_view_host_manager.h" #include "content/common/content_export.h" #include "content/public/browser/web_contents.h" @@ -119,7 +119,7 @@ class CONTENT_EXPORT TabContents } // Like GetController from WebContents, but returns the concrete object. - NavigationController& GetControllerImpl(); + NavigationControllerImpl& GetControllerImpl(); // content::WebContents ------------------------------------------------------ virtual const base::PropertyBag* GetPropertyBag() const OVERRIDE; @@ -326,7 +326,7 @@ class CONTENT_EXPORT TabContents RenderViewHost* render_view_host) OVERRIDE; virtual void UpdateRenderViewSizeForRenderManager() OVERRIDE; virtual void NotifySwappedFromRenderManager() OVERRIDE; - virtual NavigationController& GetControllerForRenderManager() OVERRIDE; + virtual NavigationControllerImpl& GetControllerForRenderManager() OVERRIDE; virtual WebUI* CreateWebUIForRenderManager(const GURL& url) OVERRIDE; virtual content::NavigationEntry* GetLastCommittedNavigationEntryForRenderManager() OVERRIDE; @@ -352,7 +352,7 @@ class CONTENT_EXPORT TabContents void RemoveObserver(content::WebContentsObserver* observer); private: - friend class NavigationController; + friend class NavigationControllerImpl; FRIEND_TEST_ALL_PREFIXES(TabContentsTest, NoJSMessageOnInterstitials); FRIEND_TEST_ALL_PREFIXES(TabContentsTest, UpdateTitle); @@ -505,7 +505,7 @@ class CONTENT_EXPORT TabContents content::WebContentsDelegate* delegate_; // Handles the back/forward list and loading. - NavigationController controller_; + NavigationControllerImpl controller_; // The corresponding view. scoped_ptr<TabContentsView> view_; diff --git a/content/browser/tab_contents/tab_contents_unittest.cc b/content/browser/tab_contents/tab_contents_unittest.cc index c4b73db..0f6d1e1 100644 --- a/content/browser/tab_contents/tab_contents_unittest.cc +++ b/content/browser/tab_contents/tab_contents_unittest.cc @@ -1755,7 +1755,8 @@ TEST_F(TabContentsTest, CopyStateFromAndPruneSourceInterstitial) { // Create another NavigationController. GURL url3("http://foo2"); scoped_ptr<TestTabContents> other_contents(CreateTestTabContents()); - NavigationController& other_controller = other_contents->GetControllerImpl(); + NavigationControllerImpl& other_controller = + other_contents->GetControllerImpl(); other_contents->NavigateAndCommit(url3); other_contents->ExpectSetHistoryLengthAndPrune( NavigationEntryImpl::FromNavigationEntry( @@ -1782,7 +1783,8 @@ TEST_F(TabContentsTest, CopyStateFromAndPruneTargetInterstitial) { // Create another NavigationController. scoped_ptr<TestTabContents> other_contents(CreateTestTabContents()); - NavigationController& other_controller = other_contents->GetControllerImpl(); + NavigationControllerImpl& other_controller = + other_contents->GetControllerImpl(); // Navigate it to url2. GURL url2("http://foo2"); diff --git a/content/content_browser.gypi b/content/content_browser.gypi index 75fde8e..4b1a93c 100644 --- a/content/content_browser.gypi +++ b/content/content_browser.gypi @@ -594,8 +594,8 @@ 'browser/tab_contents/drag_utils_gtk.h', 'browser/tab_contents/interstitial_page.cc', 'browser/tab_contents/interstitial_page.h', - 'browser/tab_contents/navigation_controller.cc', - 'browser/tab_contents/navigation_controller.h', + 'browser/tab_contents/navigation_controller_impl.cc', + 'browser/tab_contents/navigation_controller_impl.h', 'browser/tab_contents/navigation_entry_impl.cc', 'browser/tab_contents/navigation_entry_impl.h', 'browser/tab_contents/popup_menu_helper_mac.h', diff --git a/content/content_tests.gypi b/content/content_tests.gypi index f4d321b..ef917ea 100644 --- a/content/content_tests.gypi +++ b/content/content_tests.gypi @@ -233,7 +233,7 @@ 'browser/speech/speech_recognition_request_unittest.cc', 'browser/speech/speech_recognizer_unittest.cc', 'browser/ssl/ssl_host_state_unittest.cc', - 'browser/tab_contents/navigation_controller_unittest.cc', + 'browser/tab_contents/navigation_controller_impl_unittest.cc', 'browser/tab_contents/navigation_entry_impl_unittest.cc', 'browser/tab_contents/render_view_host_manager_unittest.cc', 'browser/tab_contents/tab_contents_delegate_unittest.cc', diff --git a/content/shell/shell.cc b/content/shell/shell.cc index 71baa66..95e1e24 100644 --- a/content/shell/shell.cc +++ b/content/shell/shell.cc @@ -7,7 +7,7 @@ #include "base/message_loop.h" #include "base/path_service.h" #include "base/string_util.h" -#include "content/browser/tab_contents/navigation_controller.h" +#include "content/browser/tab_contents/navigation_controller_impl.h" #include "content/browser/tab_contents/tab_contents.h" #include "ui/gfx/size.h" |