diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-25 03:59:51 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-25 03:59:51 +0000 |
commit | 36fc039f12944d61df900690238a5d0303f457dd (patch) | |
tree | 1f53b1b2a137bb60bf4e696dd5e6cb706833cc2d /chrome | |
parent | 12f75ab37393f57fcac33c39673793f1579b665c (diff) | |
download | chromium_src-36fc039f12944d61df900690238a5d0303f457dd.zip chromium_src-36fc039f12944d61df900690238a5d0303f457dd.tar.gz chromium_src-36fc039f12944d61df900690238a5d0303f457dd.tar.bz2 |
Create a Content API around NavigationEntry that's in content/public/browser. NavigationEntry will be renamed to NavigationEntryImpl in a later change. It now derives from content::NavigationEntry. Most of this change is changing unix_hacker functions to CamelCase and updating callers.
BUG=98716
TBR=brettw
Review URL: http://codereview.chromium.org/9007043
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115766 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
79 files changed, 203 insertions, 209 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index a7448cd..7df0658 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -82,7 +82,6 @@ #include "content/browser/download/save_package.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/ssl/ssl_manager.h" -#include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_view.h" #include "content/public/browser/browser_thread.h" diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h index 9bbe149..3be4f6b 100644 --- a/chrome/browser/automation/automation_provider.h +++ b/chrome/browser/automation/automation_provider.h @@ -27,7 +27,6 @@ #include "chrome/common/automation_constants.h" #include "chrome/common/content_settings.h" #include "content/browser/cancelable_request.h" -#include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/trace_controller.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_observer.h" diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc index 055fcf0..5a90048 100644 --- a/chrome/browser/automation/testing_automation_provider.cc +++ b/chrome/browser/automation/testing_automation_provider.cc @@ -1302,7 +1302,7 @@ void TestingAutomationProvider::GetTabURL(int handle, if (tab_tracker_->ContainsHandle(handle)) { NavigationController* tab = tab_tracker_->GetResource(handle); // Return what the user would see in the location bar. - *url = tab->GetActiveEntry()->virtual_url(); + *url = tab->GetActiveEntry()->GetVirtualURL(); *success = true; } } diff --git a/chrome/browser/browser_commands_unittest.cc b/chrome/browser/browser_commands_unittest.cc index 4554170..b5c4175 100644 --- a/chrome/browser/browser_commands_unittest.cc +++ b/chrome/browser/browser_commands_unittest.cc @@ -73,9 +73,9 @@ TEST_F(BrowserCommandsTest, DuplicateTab) { browser()->GetTabContentsAt(1)->GetController(); ASSERT_EQ(3, controller.entry_count()); ASSERT_EQ(2, controller.GetCurrentEntryIndex()); - ASSERT_TRUE(url1 == controller.GetEntryAtIndex(0)->url()); - ASSERT_TRUE(url2 == controller.GetEntryAtIndex(1)->url()); - ASSERT_TRUE(url3 == controller.GetEntryAtIndex(2)->url()); + ASSERT_TRUE(url1 == controller.GetEntryAtIndex(0)->GetURL()); + ASSERT_TRUE(url2 == controller.GetEntryAtIndex(1)->GetURL()); + ASSERT_TRUE(url3 == controller.GetEntryAtIndex(2)->GetURL()); } TEST_F(BrowserCommandsTest, BookmarkCurrentPage) { diff --git a/chrome/browser/chromeos/offline/offline_load_page.cc b/chrome/browser/chromeos/offline/offline_load_page.cc index 4e0eed2..dabacb3 100644 --- a/chrome/browser/chromeos/offline/offline_load_page.cc +++ b/chrome/browser/chromeos/offline/offline_load_page.cc @@ -22,8 +22,6 @@ #include "chrome/common/extensions/extension.h" #include "chrome/common/jstemplate_builder.h" #include "chrome/common/url_constants.h" -#include "content/browser/tab_contents/navigation_controller.h" -#include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_types.h" diff --git a/chrome/browser/content_settings/tab_specific_content_settings.cc b/chrome/browser/content_settings/tab_specific_content_settings.cc index 8e0039a..122e185 100644 --- a/chrome/browser/content_settings/tab_specific_content_settings.cc +++ b/chrome/browser/content_settings/tab_specific_content_settings.cc @@ -468,7 +468,7 @@ void TabSpecificContentSettings::Observe( NavigationEntry* entry = controller.GetActiveEntry(); GURL entry_url; if (entry) - entry_url = entry->url(); + entry_url = entry->GetURL(); if (settings_details.ptr()->update_all() || // The active NavigationEntry is the URL in the URL field of a tab. // Currently this should be matched by the |primary_pattern|. diff --git a/chrome/browser/custom_handlers/protocol_handler_registry_browsertest.cc b/chrome/browser/custom_handlers/protocol_handler_registry_browsertest.cc index a831887..5e9c5b3 100644 --- a/chrome/browser/custom_handlers/protocol_handler_registry_browsertest.cc +++ b/chrome/browser/custom_handlers/protocol_handler_registry_browsertest.cc @@ -44,7 +44,7 @@ class RegisterProtocolHandlerBrowserTest : public InProcessBrowserTest { params.link_url = url; params.unfiltered_link_url = url; TabContents* tab_contents = browser()->GetSelectedTabContents(); - params.page_url = tab_contents->GetController().GetActiveEntry()->url(); + params.page_url = tab_contents->GetController().GetActiveEntry()->GetURL(); #if defined(OS_MACOSX) params.writing_direction_default = 0; params.writing_direction_left_to_right = 0; diff --git a/chrome/browser/download/download_request_limiter.cc b/chrome/browser/download/download_request_limiter.cc index f1dffea..9de3a1e 100644 --- a/chrome/browser/download/download_request_limiter.cc +++ b/chrome/browser/download/download_request_limiter.cc @@ -41,7 +41,7 @@ DownloadRequestLimiter::TabDownloadState::TabDownloadState( NavigationEntry* active_entry = originating_controller ? originating_controller->GetActiveEntry() : controller->GetActiveEntry(); if (active_entry) - initial_page_host_ = active_entry->url().host(); + initial_page_host_ = active_entry->GetURL().host(); } DownloadRequestLimiter::TabDownloadState::~TabDownloadState() { @@ -117,7 +117,7 @@ void DownloadRequestLimiter::TabDownloadState::Observe( if (!entry) return; - if (content::PageTransitionIsRedirect(entry->transition_type())) { + if (content::PageTransitionIsRedirect(entry->GetTransitionType())) { // Redirects don't count. return; } @@ -127,8 +127,8 @@ void DownloadRequestLimiter::TabDownloadState::Observe( // User has either allowed all downloads or canceled all downloads. Only // reset the download state if the user is navigating to a different // host (or host is empty). - if (!initial_page_host_.empty() && !entry->url().host().empty() && - entry->url().host() == initial_page_host_) { + if (!initial_page_host_.empty() && !entry->GetURL().host().empty() && + entry->GetURL().host() == initial_page_host_) { return; } } diff --git a/chrome/browser/extensions/app_process_apitest.cc b/chrome/browser/extensions/app_process_apitest.cc index 47c42ec..c6f5c00 100644 --- a/chrome/browser/extensions/app_process_apitest.cc +++ b/chrome/browser/extensions/app_process_apitest.cc @@ -57,7 +57,7 @@ static void WindowOpenHelper(Browser* browser, TabContents* newtab = last_active_browser->GetSelectedTabContents(); EXPECT_TRUE(newtab); observer.Wait(); - EXPECT_EQ(url, newtab->GetController().GetLastCommittedEntry()->url()); + EXPECT_EQ(url, newtab->GetController().GetLastCommittedEntry()->GetURL()); if (newtab_process_should_equal_opener) EXPECT_EQ(opener_host->process(), newtab->GetRenderProcessHost()); else @@ -79,7 +79,7 @@ static void NavigateTabHelper(TabContents* contents, const GURL& url) { &result)); ASSERT_TRUE(result); observer.Wait(); - EXPECT_EQ(url, contents->GetController().GetLastCommittedEntry()->url()); + EXPECT_EQ(url, contents->GetController().GetLastCommittedEntry()->GetURL()); } IN_PROC_BROWSER_TEST_F(AppApiTest, AppProcess) { @@ -375,7 +375,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, MAYBE_AppProcessRedirectBack) { ASSERT_EQ(3, browser()->tab_count()); EXPECT_EQ("/files/extensions/api_test/app_process/path1/empty.html", browser()->GetTabContentsAt(2)->GetController(). - GetLastCommittedEntry()->url().path()); + GetLastCommittedEntry()->GetURL().path()); EXPECT_EQ(browser()->GetTabContentsAt(1)->GetRenderProcessHost(), browser()->GetTabContentsAt(2)->GetRenderProcessHost()); } @@ -506,7 +506,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, OpenAppFromIframe) { TabContents* newtab = last_active_browser->GetSelectedTabContents(); EXPECT_TRUE(newtab); if (!newtab->GetController().GetLastCommittedEntry() || - newtab->GetController().GetLastCommittedEntry()->url() != app_url) { + newtab->GetController().GetLastCommittedEntry()->GetURL() != app_url) { // TODO(gbillock): This still looks racy. Need to make a custom // observer to intercept new window creation and then look for // NAV_ENTRY_COMMITTED on the new tab there. diff --git a/chrome/browser/extensions/extension_browser_event_router.cc b/chrome/browser/extensions/extension_browser_event_router.cc index 48c26f5..1932b93 100644 --- a/chrome/browser/extensions/extension_browser_event_router.cc +++ b/chrome/browser/extensions/extension_browser_event_router.cc @@ -18,7 +18,6 @@ #include "chrome/common/chrome_notification_types.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_constants.h" -#include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/notification_service.h" diff --git a/chrome/browser/extensions/extension_browsertests_misc.cc b/chrome/browser/extensions/extension_browsertests_misc.cc index 4eb7a12..bb56b39 100644 --- a/chrome/browser/extensions/extension_browsertests_misc.cc +++ b/chrome/browser/extensions/extension_browsertests_misc.cc @@ -702,7 +702,7 @@ static void WindowOpenHelper(Browser* browser, const GURL& start_url, GURL expected_url = start_url.Resolve(newtab_url); observer.Wait(); EXPECT_EQ(expected_url, - newtab->GetController().GetLastCommittedEntry()->url()); + newtab->GetController().GetLastCommittedEntry()->GetURL()); if (newtab_result) *newtab_result = newtab; } diff --git a/chrome/browser/extensions/extension_navigation_observer.cc b/chrome/browser/extensions/extension_navigation_observer.cc index 931adbb..ef7640e 100644 --- a/chrome/browser/extensions/extension_navigation_observer.cc +++ b/chrome/browser/extensions/extension_navigation_observer.cc @@ -53,7 +53,7 @@ void ExtensionNavigationObserver::PromptToEnableExtensionIfNecessary( ExtensionService* extension_service = profile_->GetExtensionService(); const Extension* extension = extension_service->disabled_extensions()-> - GetExtensionOrAppByURL(ExtensionURLInfo(nav_entry->url())); + GetExtensionOrAppByURL(ExtensionURLInfo(nav_entry->GetURL())); if (!extension) return; diff --git a/chrome/browser/extensions/extension_override_apitest.cc b/chrome/browser/extensions/extension_override_apitest.cc index f11795e..e30323b 100644 --- a/chrome/browser/extensions/extension_override_apitest.cc +++ b/chrome/browser/extensions/extension_override_apitest.cc @@ -63,7 +63,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionOverrideTest, OverrideNewtab) { ui_test_utils::NavigateToURL(browser(), GURL("chrome://newtab/")); TabContents* tab = browser()->GetSelectedTabContents(); ASSERT_TRUE(tab->GetController().GetActiveEntry()); - EXPECT_TRUE(tab->GetController().GetActiveEntry()->url(). + EXPECT_TRUE(tab->GetController().GetActiveEntry()->GetURL(). SchemeIs(chrome::kExtensionScheme)); ASSERT_TRUE(catcher.GetNextResult()); @@ -90,7 +90,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionOverrideTest, MAYBE_OverrideNewtabIncognito) { browser()->profile()->GetOffTheRecordProfile(), false); TabContents* tab = otr_browser->GetSelectedTabContents(); ASSERT_TRUE(tab->GetController().GetActiveEntry()); - EXPECT_FALSE(tab->GetController().GetActiveEntry()->url(). + EXPECT_FALSE(tab->GetController().GetActiveEntry()->GetURL(). SchemeIs(chrome::kExtensionScheme)); } diff --git a/chrome/browser/extensions/extension_page_actions_module.cc b/chrome/browser/extensions/extension_page_actions_module.cc index f83168a..c42af81 100644 --- a/chrome/browser/extensions/extension_page_actions_module.cc +++ b/chrome/browser/extensions/extension_page_actions_module.cc @@ -82,7 +82,7 @@ bool PageActionFunction::SetPageActionEnabled(bool enable) { // Make sure the URL hasn't changed. NavigationEntry* entry = contents->tab_contents()->GetController().GetActiveEntry(); - if (!entry || url != entry->url().spec()) { + if (!entry || url != entry->GetURL().spec()) { error_ = ExtensionErrorUtils::FormatErrorMessage(kUrlNotActiveError, url); return false; } diff --git a/chrome/browser/extensions/extension_tabs_module.cc b/chrome/browser/extensions/extension_tabs_module.cc index e717924..d0ae2b0 100644 --- a/chrome/browser/extensions/extension_tabs_module.cc +++ b/chrome/browser/extensions/extension_tabs_module.cc @@ -1374,7 +1374,7 @@ bool ReloadTabFunction::RunImpl() { if (tab_contents->ShowingInterstitialPage()) { // This does as same as Browser::ReloadInternal. NavigationEntry* entry = tab_contents->GetController().GetActiveEntry(); - GetCurrentBrowser()->OpenURL(entry->url(), GURL(), CURRENT_TAB, + GetCurrentBrowser()->OpenURL(entry->GetURL(), GURL(), CURRENT_TAB, content::PAGE_TRANSITION_RELOAD); } else if (bypass_cache) { tab_contents->GetController().ReloadIgnoringCache(true); diff --git a/chrome/browser/extensions/extension_url_rewrite_browsertest.cc b/chrome/browser/extensions/extension_url_rewrite_browsertest.cc index 0589036..8bb5593 100644 --- a/chrome/browser/extensions/extension_url_rewrite_browsertest.cc +++ b/chrome/browser/extensions/extension_url_rewrite_browsertest.cc @@ -48,8 +48,9 @@ class ExtensionURLRewriteBrowserTest : public ExtensionBrowserTest { void TestExtensionURLOverride(const GURL& url) { ui_test_utils::NavigateToURL(browser(), url); EXPECT_EQ(url, GetLocationBarTextAsURL()); - EXPECT_EQ(url, GetNavigationEntry()->virtual_url()); - EXPECT_TRUE(GetNavigationEntry()->url().SchemeIs(chrome::kExtensionScheme)); + EXPECT_EQ(url, GetNavigationEntry()->GetVirtualURL()); + EXPECT_TRUE( + GetNavigationEntry()->GetURL().SchemeIs(chrome::kExtensionScheme)); } // Navigates to |url| and tests that the location bar is empty while the @@ -57,7 +58,7 @@ class ExtensionURLRewriteBrowserTest : public ExtensionBrowserTest { void TestURLNotShown(const GURL& url) { ui_test_utils::NavigateToURL(browser(), url); EXPECT_EQ("", GetLocationBarText()); - EXPECT_EQ(url, GetNavigationEntry()->virtual_url()); + EXPECT_EQ(url, GetNavigationEntry()->GetVirtualURL()); } }; @@ -66,7 +67,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionURLRewriteBrowserTest, NewTabPageURL) { GURL url(chrome::kChromeUINewTabURL); TestURLNotShown(url); // Check that the actual URL corresponds to chrome://newtab. - EXPECT_EQ(url, GetNavigationEntry()->url()); + EXPECT_EQ(url, GetNavigationEntry()->GetURL()); } IN_PROC_BROWSER_TEST_F(ExtensionURLRewriteBrowserTest, NewTabPageURLOverride) { @@ -75,7 +76,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionURLRewriteBrowserTest, NewTabPageURLOverride) { LoadExtension(GetTestExtensionPath("newtab")); TestURLNotShown(GURL(chrome::kChromeUINewTabURL)); // Check that the internal URL uses the chrome-extension:// scheme. - EXPECT_TRUE(GetNavigationEntry()->url().SchemeIs(chrome::kExtensionScheme)); + EXPECT_TRUE(GetNavigationEntry()->GetURL().SchemeIs(chrome::kExtensionScheme)); } IN_PROC_BROWSER_TEST_F(ExtensionURLRewriteBrowserTest, BookmarksURL) { diff --git a/chrome/browser/extensions/webstore_installer.cc b/chrome/browser/extensions/webstore_installer.cc index be47602..a88157f 100644 --- a/chrome/browser/extensions/webstore_installer.cc +++ b/chrome/browser/extensions/webstore_installer.cc @@ -163,7 +163,7 @@ void WebstoreInstaller::StartDownload(FilePath file) { // checks in ExtensionService::IsDownloadFromGallery. We should instead pass // the real referrer, track if this is an inline install in the whitelist // entry and look that up when checking that this is a valid download. - GURL referrer = controller_->GetActiveEntry()->url(); + GURL referrer = controller_->GetActiveEntry()->GetURL(); if (flags_ & FLAG_INLINE_INSTALL) referrer = GURL(extension_urls::GetWebstoreItemDetailURLPrefix() + id_); diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc index 5939275..aee37e5 100644 --- a/chrome/browser/external_tab_container_win.cc +++ b/chrome/browser/external_tab_container_win.cc @@ -815,7 +815,7 @@ void ExternalTabContainer::Observe(int type, if (commit->http_status_code >= kHttpClientErrorStart && commit->http_status_code <= kHttpServerErrorEnd) { automation_->Send(new AutomationMsg_NavigationFailed( - tab_handle_, commit->http_status_code, commit->entry->url())); + tab_handle_, commit->http_status_code, commit->entry->GetURL())); ignore_next_load_notification_ = true; } else { @@ -957,9 +957,9 @@ bool ExternalTabContainer::InitNavigationInfo(NavigationInfo* nav_info, nav_info->relative_offset = relative_offset; nav_info->navigation_index = tab_contents_->tab_contents()->GetController().GetCurrentEntryIndex(); - nav_info->url = entry->url(); - nav_info->referrer = entry->referrer().url; - nav_info->title = UTF16ToWideHack(entry->title()); + nav_info->url = entry->GetURL(); + nav_info->referrer = entry->GetReferrer().url; + nav_info->title = UTF16ToWideHack(entry->GetTitle()); if (nav_info->title.empty()) nav_info->title = UTF8ToWide(nav_info->url.spec()); diff --git a/chrome/browser/favicon/favicon_handler.cc b/chrome/browser/favicon/favicon_handler.cc index f365683..d317252 100644 --- a/chrome/browser/favicon/favicon_handler.cc +++ b/chrome/browser/favicon/favicon_handler.cc @@ -210,7 +210,7 @@ void FaviconHandler::OnUpdateFaviconURL( } if (got_favicon_from_history_) - DownloadFaviconOrAskHistory(entry->url(), current_candidate()->icon_url, + DownloadFaviconOrAskHistory(entry->GetURL(), current_candidate()->icon_url, ToHistoryIconType(current_candidate()->icon_type)); } @@ -246,7 +246,7 @@ void FaviconHandler::OnDidDownloadFavicon(int id, NavigationEntry* FaviconHandler::GetEntry() { NavigationEntry* entry = delegate_->GetActiveEntry(); - if (entry && entry->url() == url_) + if (entry && entry->GetURL() == url_) return entry; // If the URL has changed out from under us (as will happen with redirects) @@ -343,14 +343,15 @@ void FaviconHandler::OnFaviconDataForInitialURL( // Mapping in the database is wrong. DownloadFavIconOrAskHistory will // update the mapping for this url and download the favicon if we don't // already have it. - DownloadFaviconOrAskHistory(entry->url(), current_candidate()->icon_url, + DownloadFaviconOrAskHistory(entry->GetURL(), + current_candidate()->icon_url, static_cast<history::IconType>(current_candidate()->icon_type)); } } else if (current_candidate()) { // We know the official url for the favicon, by either don't have the // favicon or its expired. Continue on to DownloadFaviconOrAskHistory to // either download or check history again. - DownloadFaviconOrAskHistory(entry->url(), current_candidate()->icon_url, + DownloadFaviconOrAskHistory(entry->GetURL(), current_candidate()->icon_url, ToHistoryIconType(current_candidate()->icon_type)); } // else we haven't got the icon url. When we get it we'll ask the @@ -404,7 +405,7 @@ void FaviconHandler::OnFaviconData(FaviconService::Handle handle, if (!favicon.known_icon || favicon.expired) { // We don't know the favicon, or it is out of date. Request the current // one. - ScheduleDownload(entry->url(), entry->favicon().url(), + ScheduleDownload(entry->GetURL(), entry->favicon().url(), preferred_icon_size(), history::FAVICON, FaviconTabHelper::ImageDownloadCallback()); @@ -414,7 +415,7 @@ void FaviconHandler::OnFaviconData(FaviconService::Handle handle, *current_candidate(), favicon.icon_url, favicon.icon_type)))) { // We don't know the favicon, it is out of date or its type is not same as // one got from page. Request the current one. - ScheduleDownload(entry->url(), current_candidate()->icon_url, + ScheduleDownload(entry->GetURL(), current_candidate()->icon_url, preferred_icon_size(), ToHistoryIconType(current_candidate()->icon_type), FaviconTabHelper::ImageDownloadCallback()); diff --git a/chrome/browser/favicon/favicon_tab_helper.cc b/chrome/browser/favicon/favicon_tab_helper.cc index 4f80151..3e59fbb 100644 --- a/chrome/browser/favicon/favicon_tab_helper.cc +++ b/chrome/browser/favicon/favicon_tab_helper.cc @@ -80,7 +80,7 @@ bool FaviconTabHelper::ShouldDisplayFavicon() { void FaviconTabHelper::SaveFavicon() { NavigationEntry* entry = tab_contents()->GetController().GetActiveEntry(); - if (!entry || entry->url().is_empty()) + if (!entry || entry->GetURL().is_empty()) return; // Make sure the page is in history, otherwise adding the favicon does @@ -89,7 +89,7 @@ void FaviconTabHelper::SaveFavicon() { GetOriginalProfile()->GetHistoryService(Profile::IMPLICIT_ACCESS); if (!history) return; - history->AddPageNoVisitForBookmark(entry->url()); + history->AddPageNoVisitForBookmark(entry->GetURL()); FaviconService* service = profile_-> GetOriginalProfile()->GetFaviconService(Profile::IMPLICIT_ACCESS); @@ -103,7 +103,7 @@ void FaviconTabHelper::SaveFavicon() { std::vector<unsigned char> image_data; gfx::PNGCodec::EncodeBGRASkBitmap(favicon.bitmap(), false, &image_data); service->SetFavicon( - entry->url(), favicon.url(), image_data, history::FAVICON); + entry->GetURL(), favicon.url(), image_data, history::FAVICON); } int FaviconTabHelper::DownloadImage(const GURL& image_url, @@ -161,7 +161,7 @@ void FaviconTabHelper::DidNavigateMainFrame( const content::LoadCommittedDetails& details, const content::FrameNavigateParams& params) { // Get the favicon, either from history or request it from the net. - FetchFavicon(details.entry->url()); + FetchFavicon(details.entry->GetURL()); } bool FaviconTabHelper::OnMessageReceived(const IPC::Message& message) { diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context.cc b/chrome/browser/geolocation/chrome_geolocation_permission_context.cc index bac8016..3879c47 100644 --- a/chrome/browser/geolocation/chrome_geolocation_permission_context.cc +++ b/chrome/browser/geolocation/chrome_geolocation_permission_context.cc @@ -177,7 +177,7 @@ GeolocationConfirmInfoBarDelegate::GeolocationConfirmInfoBarDelegate( const NavigationEntry* committed_entry = infobar_helper->tab_contents()->GetController().GetLastCommittedEntry(); committed_contents_unique_id_ = committed_entry ? - committed_entry->unique_id() : 0; + committed_entry->GetUniqueID() : 0; } GeolocationConfirmInfoBarDelegate::~GeolocationConfirmInfoBarDelegate() { @@ -189,9 +189,10 @@ bool GeolocationConfirmInfoBarDelegate::ShouldExpire( const content::LoadCommittedDetails& details) const { if (details.did_replace_entry || !details.is_navigation_to_different_page()) return false; - return committed_contents_unique_id_ != details.entry->unique_id() || - content::PageTransitionStripQualifier(details.entry->transition_type()) == - content::PAGE_TRANSITION_RELOAD; + return committed_contents_unique_id_ != details.entry->GetUniqueID() || + content::PageTransitionStripQualifier( + details.entry->GetTransitionType()) == + content::PAGE_TRANSITION_RELOAD; } gfx::Image* GeolocationConfirmInfoBarDelegate::GetIcon() const { diff --git a/chrome/browser/geolocation/geolocation_settings_state.cc b/chrome/browser/geolocation/geolocation_settings_state.cc index 4678833b..8f3da18 100644 --- a/chrome/browser/geolocation/geolocation_settings_state.cc +++ b/chrome/browser/geolocation/geolocation_settings_state.cc @@ -32,11 +32,11 @@ void GeolocationSettingsState::OnGeolocationPermissionSet( void GeolocationSettingsState::DidNavigate( const content::LoadCommittedDetails& details) { if (details.entry) - embedder_url_ = details.entry->url(); + embedder_url_ = details.entry->GetURL(); if (state_map_.empty()) return; if (!details.entry || - details.previous_url.GetOrigin() != details.entry->url().GetOrigin()) { + details.previous_url.GetOrigin() != details.entry->GetURL().GetOrigin()) { state_map_.clear(); return; } diff --git a/chrome/browser/google/google_url_tracker.cc b/chrome/browser/google/google_url_tracker.cc index 6d5eb2a..7ad2f62 100644 --- a/chrome/browser/google/google_url_tracker.cc +++ b/chrome/browser/google/google_url_tracker.cc @@ -315,7 +315,7 @@ void GoogleURLTracker::Observe(int type, case content::NOTIFICATION_NAV_ENTRY_PENDING: { NavigationController* controller = content::Source<NavigationController>(source).ptr(); - OnNavigationPending(source, controller->pending_entry()->url()); + OnNavigationPending(source, controller->pending_entry()->GetURL()); break; } diff --git a/chrome/browser/history/history_tab_helper.cc b/chrome/browser/history/history_tab_helper.cc index 08cc2d9..e797cc3 100644 --- a/chrome/browser/history/history_tab_helper.cc +++ b/chrome/browser/history/history_tab_helper.cc @@ -38,7 +38,7 @@ void HistoryTabHelper::UpdateHistoryForNavigation( void HistoryTabHelper::UpdateHistoryPageTitle(const NavigationEntry& entry) { HistoryService* hs = GetHistoryService(); if (hs) - hs->SetPageTitle(entry.virtual_url(), entry.GetTitleForDisplay("")); + hs->SetPageTitle(entry.GetVirtualURL(), entry.GetTitleForDisplay("")); } scoped_refptr<history::HistoryAddPageArgs> diff --git a/chrome/browser/history/top_sites.cc b/chrome/browser/history/top_sites.cc index e46432c..156bbac 100644 --- a/chrome/browser/history/top_sites.cc +++ b/chrome/browser/history/top_sites.cc @@ -854,7 +854,7 @@ void TopSites::Observe(int type, content::Details<content::LoadCommittedDetails>(details).ptr(); if (!load_details) return; - const GURL& url = load_details->entry->url(); + const GURL& url = load_details->entry->GetURL(); if (!cache_->IsKnownURL(url) && HistoryService::CanAddURL(url)) { // To avoid slamming history we throttle requests when the url updates. // To do otherwise negatively impacts perf tests. diff --git a/chrome/browser/infobars/infobar_delegate.cc b/chrome/browser/infobars/infobar_delegate.cc index 448128a..754577d 100644 --- a/chrome/browser/infobars/infobar_delegate.cc +++ b/chrome/browser/infobars/infobar_delegate.cc @@ -85,14 +85,15 @@ void InfoBarDelegate::StoreActiveEntryUniqueID( InfoBarTabHelper* infobar_helper) { NavigationEntry* active_entry = infobar_helper->tab_contents()->GetController().GetActiveEntry(); - contents_unique_id_ = active_entry ? active_entry->unique_id() : 0; + contents_unique_id_ = active_entry ? active_entry->GetUniqueID() : 0; } bool InfoBarDelegate::ShouldExpireInternal( const content::LoadCommittedDetails& details) const { - return (contents_unique_id_ != details.entry->unique_id()) || + return (contents_unique_id_ != details.entry->GetUniqueID()) || (content::PageTransitionStripQualifier( - details.entry->transition_type()) == content::PAGE_TRANSITION_RELOAD); + details.entry->GetTransitionType()) == + content::PAGE_TRANSITION_RELOAD); } void InfoBarDelegate::RemoveSelf() { diff --git a/chrome/browser/instant/instant_loader.cc b/chrome/browser/instant/instant_loader.cc index e6b676b..99c115d 100644 --- a/chrome/browser/instant/instant_loader.cc +++ b/chrome/browser/instant/instant_loader.cc @@ -97,7 +97,7 @@ class InstantLoader::FrameLoadObserver : public content::NotificationObserver { text_(text), verbatim_(verbatim), unique_id_( - tab_contents_->GetController().pending_entry()->unique_id()) { + tab_contents_->GetController().pending_entry()->GetUniqueID()) { registrar_.Add(this, content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, content::Source<TabContents>(tab_contents_)); } @@ -143,8 +143,8 @@ void InstantLoader::FrameLoadObserver::Observe( int page_id = *(content::Details<int>(details).ptr()); NavigationEntry* active_entry = tab_contents_->GetController().GetActiveEntry(); - if (!active_entry || active_entry->page_id() != page_id || - active_entry->unique_id() != unique_id_) { + if (!active_entry || active_entry->GetPageID() != page_id || + active_entry->GetUniqueID() != unique_id_) { return; } loader_->SendBoundsToPage(true); @@ -351,7 +351,7 @@ void InstantLoader::TabContentsDelegateImpl::CommitHistory( std::vector<unsigned char> image_data; gfx::PNGCodec::EncodeBGRASkBitmap(active_entry->favicon().bitmap(), false, &image_data); - favicon_service->SetFavicon(active_entry->url(), + favicon_service->SetFavicon(active_entry->GetURL(), active_entry->favicon().url(), image_data, history::FAVICON); @@ -548,11 +548,10 @@ void InstantLoader::TabContentsDelegateImpl::OnSetSuggestions( const std::vector<std::string>& suggestions, InstantCompleteBehavior behavior) { TabContentsWrapper* source = loader_->preview_contents(); - if (!source->tab_contents()->GetController().GetActiveEntry() || - page_id != - source->tab_contents()->GetController().GetActiveEntry()->page_id()) { + NavigationEntry* entry = + source->tab_contents()->GetController().GetActiveEntry(); + if (! entry || page_id != entry->GetPageID()) return; - } if (suggestions.empty()) loader_->SetCompleteSuggestedText(string16(), behavior); @@ -565,7 +564,7 @@ void InstantLoader::TabContentsDelegateImpl::OnInstantSupportDetermined( bool result) { TabContents* source = loader_->preview_contents()->tab_contents(); if (!source->GetController().GetActiveEntry() || - page_id != source->GetController().GetActiveEntry()->page_id()) + page_id != source->GetController().GetActiveEntry()->GetPageID()) return; content::Details<const bool> details(&result); @@ -832,7 +831,7 @@ void InstantLoader::Observe(int type, content::Details<content::LoadCommittedDetails>(details).ptr(); if (load_details->is_main_frame) { if (load_details->http_status_code == kHostBlacklistStatusCode) { - delegate_->AddToBlacklist(this, load_details->entry->url()); + delegate_->AddToBlacklist(this, load_details->entry->GetURL()); } else { SetHTTPStatusOK(load_details->http_status_code == 200); } diff --git a/chrome/browser/memory_details.cc b/chrome/browser/memory_details.cc index f651837..a7e75f8 100644 --- a/chrome/browser/memory_details.cc +++ b/chrome/browser/memory_details.cc @@ -289,10 +289,10 @@ void MemoryDetails::CollectChildInfoOnUIThread() { const NavigationEntry* last_committed_entry = contents->GetController().GetLastCommittedEntry(); if ((last_committed_entry && - LowerCaseEqualsASCII(last_committed_entry->virtual_url().spec(), + LowerCaseEqualsASCII(last_committed_entry->GetVirtualURL().spec(), chrome::kChromeUIMemoryURL)) || (pending_entry && - LowerCaseEqualsASCII(pending_entry->virtual_url().spec(), + LowerCaseEqualsASCII(pending_entry->GetVirtualURL().spec(), chrome::kChromeUIMemoryURL))) process.is_diagnostics = true; } diff --git a/chrome/browser/memory_details_mac.cc b/chrome/browser/memory_details_mac.cc index 04919bd..8ae9baf 100644 --- a/chrome/browser/memory_details_mac.cc +++ b/chrome/browser/memory_details_mac.cc @@ -22,7 +22,6 @@ #include "chrome/common/url_constants.h" #include "content/browser/browser_child_process_host.h" #include "content/browser/renderer_host/backing_store_manager.h" -#include "content/browser/tab_contents/navigation_entry.h" #include "content/public/browser/browser_thread.h" #include "content/public/common/process_type.h" #include "grit/chromium_strings.h" diff --git a/chrome/browser/memory_details_win.cc b/chrome/browser/memory_details_win.cc index a3aa02b..09cd799 100644 --- a/chrome/browser/memory_details_win.cc +++ b/chrome/browser/memory_details_win.cc @@ -17,7 +17,6 @@ #include "chrome/common/url_constants.h" #include "content/browser/browser_child_process_host.h" #include "content/browser/renderer_host/backing_store_manager.h" -#include "content/browser/tab_contents/navigation_entry.h" #include "content/public/browser/browser_thread.h" #include "content/public/common/process_type.h" #include "grit/chromium_strings.h" diff --git a/chrome/browser/omnibox_search_hint.cc b/chrome/browser/omnibox_search_hint.cc index dd3e5c7..f0007ef 100644 --- a/chrome/browser/omnibox_search_hint.cc +++ b/chrome/browser/omnibox_search_hint.cc @@ -176,7 +176,7 @@ void OmniboxSearchHint::Observe(int type, if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) { NavigationEntry* entry = tab_->tab_contents()->GetController().GetActiveEntry(); - if (search_engine_urls_.find(entry->url().spec()) == + if (search_engine_urls_.find(entry->GetURL().spec()) == search_engine_urls_.end()) { // The search engine is not in our white-list, bail. return; @@ -188,7 +188,7 @@ void OmniboxSearchHint::Observe(int type, return; const TemplateURLRef* const search_url = default_provider->url(); - if (search_url->GetHost() == entry->url().host()) + if (search_url->GetHost() == entry->GetURL().host()) ShowInfoBar(); } else if (type == chrome::NOTIFICATION_OMNIBOX_OPENED_URL) { AutocompleteLog* log = content::Details<AutocompleteLog>(details).ptr(); diff --git a/chrome/browser/printing/print_preview_tab_controller.cc b/chrome/browser/printing/print_preview_tab_controller.cc index 081ed7f..3dcc4b1 100644 --- a/chrome/browser/printing/print_preview_tab_controller.cc +++ b/chrome/browser/printing/print_preview_tab_controller.cc @@ -291,7 +291,7 @@ void PrintPreviewTabController::OnNavEntryCommitted( // Preview tab navigated. if (details) { content::PageTransition transition_type = - details->entry->transition_type(); + details->entry->GetTransitionType(); content::NavigationType nav_type = details->type; // New |preview_tab| is created. Don't update/erase map entry. diff --git a/chrome/browser/rlz/rlz.cc b/chrome/browser/rlz/rlz.cc index d430a80..0872512 100644 --- a/chrome/browser/rlz/rlz.cc +++ b/chrome/browser/rlz/rlz.cc @@ -308,7 +308,7 @@ void RLZTracker::Observe(int type, const NavigationEntry* entry = content::Details<NavigationEntry>(details).ptr(); if (entry != NULL && - ((entry->transition_type() & + ((entry->GetTransitionType() & content::PAGE_TRANSITION_HOME_PAGE) != 0)) { point = rlz_lib::CHROME_HOME_PAGE; record_used = &homepage_used_; diff --git a/chrome/browser/safe_browsing/browser_feature_extractor.cc b/chrome/browser/safe_browsing/browser_feature_extractor.cc index c0e122c..85ce0e2b 100644 --- a/chrome/browser/safe_browsing/browser_feature_extractor.cc +++ b/chrome/browser/safe_browsing/browser_feature_extractor.cc @@ -51,12 +51,12 @@ static void AddNavigationFeatures(const std::string& feature_prefix, const std::vector<GURL>& redirect_chain, ClientPhishingRequest* request) { NavigationEntry* entry = controller.GetEntryAtIndex(index); - bool is_secure_referrer = entry->referrer().url.SchemeIsSecure(); + bool is_secure_referrer = entry->GetReferrer().url.SchemeIsSecure(); if (!is_secure_referrer) { AddFeature(StringPrintf("%s%s=%s", feature_prefix.c_str(), features::kReferrer, - entry->referrer().url.spec().c_str()), + entry->GetReferrer().url.spec().c_str()), 1.0, request); } @@ -66,7 +66,7 @@ static void AddNavigationFeatures(const std::string& feature_prefix, AddFeature(feature_prefix + features::kPageTransitionType, static_cast<double>( content::PageTransitionStripQualifier( - entry->transition_type())), + entry->GetTransitionType())), request); AddFeature(feature_prefix + features::kIsFirstNavigation, index == 0 ? 1.0 : 0.0, @@ -77,13 +77,13 @@ static void AddNavigationFeatures(const std::string& feature_prefix, NOTREACHED(); return; } - if (redirect_chain.back() != entry->url()) { + if (redirect_chain.back() != entry->GetURL()) { // I originally had this as a DCHECK but I saw a failure once that I // can't reproduce. It looks like it might be related to the // navigation controller only keeping a limited number of navigation // events. For now we'll just attach a feature specifying that this is // a mismatch and try and figure out what to do with it on the server. - DLOG(WARNING) << "Expected:" << entry->url() + DLOG(WARNING) << "Expected:" << entry->GetURL() << " Actual:" << redirect_chain.back(); AddFeature(feature_prefix + features::kRedirectUrlMismatch, 1.0, @@ -161,7 +161,7 @@ void BrowserFeatureExtractor::ExtractFeatures(const BrowseInfo* info, DCHECK_NE(index, -1); for (; index >= 0; index--) { NavigationEntry* entry = controller.GetEntryAtIndex(index); - if (url_index == -1 && entry->url() == request_url) { + if (url_index == -1 && entry->GetURL() == request_url) { // It's possible that we've been on the on the possibly phishy url before // in this tab, so make sure that we use the latest navigation for // features. @@ -171,7 +171,7 @@ void BrowserFeatureExtractor::ExtractFeatures(const BrowseInfo* info, // be cautious. url_index = index; } else if (index < url_index) { - if (entry->url().host() == request_url.host()) { + if (entry->GetURL().host() == request_url.host()) { first_host_index = index; } else { // We have found the possibly phishing url, but we are no longer on the diff --git a/chrome/browser/safe_browsing/client_side_detection_host.cc b/chrome/browser/safe_browsing/client_side_detection_host.cc index c8e8289..765e0fe 100644 --- a/chrome/browser/safe_browsing/client_side_detection_host.cc +++ b/chrome/browser/safe_browsing/client_side_detection_host.cc @@ -350,7 +350,7 @@ void ClientSideDetectionHost::OnSafeBrowsingHit( resource.threat_type == SafeBrowsingService::URL_MALWARE) && tab_contents()->GetController().GetActiveEntry()) { unsafe_unique_page_id_ = - tab_contents()->GetController().GetActiveEntry()->unique_id(); + tab_contents()->GetController().GetActiveEntry()->GetUniqueID(); // We also keep the resource around in order to be able to send the // malicious URL to the server. unsafe_resource_.reset(new SafeBrowsingService::UnsafeResource(resource)); @@ -476,7 +476,7 @@ bool ClientSideDetectionHost::DidShowSBInterstitial() { } const NavigationEntry* nav_entry = tab_contents()->GetController().GetActiveEntry(); - return (nav_entry && nav_entry->unique_id() == unsafe_unique_page_id_); + return (nav_entry && nav_entry->GetUniqueID() == unsafe_unique_page_id_); } void ClientSideDetectionHost::set_client_side_detection_service( diff --git a/chrome/browser/safe_browsing/malware_details.cc b/chrome/browser/safe_browsing/malware_details.cc index d1dc772..983c1d9 100644 --- a/chrome/browser/safe_browsing/malware_details.cc +++ b/chrome/browser/safe_browsing/malware_details.cc @@ -169,7 +169,7 @@ void MalwareDetails::StartCollection() { GURL referrer_url; NavigationEntry* nav_entry = tab_contents()->GetController().GetActiveEntry(); if (nav_entry) { - referrer_url = nav_entry->referrer().url; + referrer_url = nav_entry->GetReferrer().url; if (IsPublicUrl(referrer_url)) { report_->set_referrer_url(referrer_url.spec()); } diff --git a/chrome/browser/safe_browsing/malware_details_history.cc b/chrome/browser/safe_browsing/malware_details_history.cc index 987c0f6..8dc8608 100644 --- a/chrome/browser/safe_browsing/malware_details_history.cc +++ b/chrome/browser/safe_browsing/malware_details_history.cc @@ -12,7 +12,6 @@ #include "chrome/browser/safe_browsing/malware_details.h" #include "chrome/common/chrome_notification_types.h" #include "content/browser/renderer_host/render_view_host.h" -#include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_details.h" diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc index 0faa97d..d66a700 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc @@ -29,7 +29,6 @@ #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "content/browser/tab_contents/navigation_controller.h" -#include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/user_metrics.h" diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc index 37d7e02..ac15628 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc @@ -123,7 +123,7 @@ class SafeBrowsingBlockingPageTest : public ChromeRenderViewHostTestHarness, RenderViewHost* rvh = is_cross_site ? contents()->pending_rvh() : contents()->GetRenderViewHost(); - contents()->TestDidNavigate(rvh, entry->page_id(), GURL(entry->url()), + contents()->TestDidNavigate(rvh, entry->GetPageID(), GURL(entry->GetURL()), content::PAGE_TRANSITION_TYPED); } @@ -283,7 +283,7 @@ TEST_F(SafeBrowsingBlockingPageTest, PageWithMalwareResourceDontProceed) { // We did not proceed, we should be back to the first page, the 2nd one should // have been removed from the navigation controller. ASSERT_EQ(1, controller().entry_count()); - EXPECT_EQ(kGoogleURL, controller().GetActiveEntry()->url().spec()); + EXPECT_EQ(kGoogleURL, controller().GetActiveEntry()->GetURL().spec()); // A report should have been sent. EXPECT_EQ(1u, service_->GetDetails()->size()); @@ -314,7 +314,7 @@ TEST_F(SafeBrowsingBlockingPageTest, PageWithMalwareResourceProceed) { // We did proceed, we should be back to showing the page. ASSERT_EQ(1, controller().entry_count()); - EXPECT_EQ(kGoodURL, controller().GetActiveEntry()->url().spec()); + EXPECT_EQ(kGoodURL, controller().GetActiveEntry()->GetURL().spec()); // A report should have been sent. EXPECT_EQ(1u, service_->GetDetails()->size()); @@ -356,7 +356,7 @@ TEST_F(SafeBrowsingBlockingPageTest, // We did not proceed, we should be back to the first page, the 2nd one should // have been removed from the navigation controller. ASSERT_EQ(1, controller().entry_count()); - EXPECT_EQ(kGoogleURL, controller().GetActiveEntry()->url().spec()); + EXPECT_EQ(kGoogleURL, controller().GetActiveEntry()->GetURL().spec()); // A report should have been sent. EXPECT_EQ(1u, service_->GetDetails()->size()); @@ -412,7 +412,7 @@ TEST_F(SafeBrowsingBlockingPageTest, // We did not proceed, we should be back to the first page, the 2nd one should // have been removed from the navigation controller. ASSERT_EQ(1, controller().entry_count()); - EXPECT_EQ(kGoogleURL, controller().GetActiveEntry()->url().spec()); + EXPECT_EQ(kGoogleURL, controller().GetActiveEntry()->GetURL().spec()); // No report should have been sent -- we don't create a report the // second time. @@ -463,7 +463,7 @@ TEST_F(SafeBrowsingBlockingPageTest, PageWithMultipleMalwareResourceProceed) { // We did proceed, we should be back to the initial page. ASSERT_EQ(1, controller().entry_count()); - EXPECT_EQ(kGoodURL, controller().GetActiveEntry()->url().spec()); + EXPECT_EQ(kGoodURL, controller().GetActiveEntry()->GetURL().spec()); // No report should have been sent -- we don't create a report the // second time. @@ -498,7 +498,7 @@ TEST_F(SafeBrowsingBlockingPageTest, NavigatingBackAndForth) { sb_interstitial = GetSafeBrowsingBlockingPage(); ASSERT_FALSE(sb_interstitial); ASSERT_EQ(2, controller().entry_count()); - EXPECT_EQ(kGoodURL, controller().GetActiveEntry()->url().spec()); + EXPECT_EQ(kGoodURL, controller().GetActiveEntry()->GetURL().spec()); // Navigate forward to the malware URL. contents()->GetController().GoForward(); @@ -512,7 +512,7 @@ TEST_F(SafeBrowsingBlockingPageTest, NavigatingBackAndForth) { sb_interstitial = GetSafeBrowsingBlockingPage(); ASSERT_FALSE(sb_interstitial); ASSERT_EQ(2, controller().entry_count()); - EXPECT_EQ(kBadURL, controller().GetActiveEntry()->url().spec()); + EXPECT_EQ(kBadURL, controller().GetActiveEntry()->GetURL().spec()); // Two reports should have been sent. EXPECT_EQ(2u, service_->GetDetails()->size()); diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc index db5ea42..f1c4e66 100644 --- a/chrome/browser/safe_browsing/safe_browsing_service.cc +++ b/chrome/browser/safe_browsing/safe_browsing_service.cc @@ -1056,7 +1056,7 @@ void SafeBrowsingService::DoDisplayBlockingPage( GURL referrer_url; NavigationEntry* entry = tab_contents->GetController().GetActiveEntry(); if (entry) - referrer_url = entry->referrer().url; + referrer_url = entry->GetReferrer().url; // When the malicious url is on the main frame, and resource.original_url // is not the same as the resource.url, that means we have a redirect from diff --git a/chrome/browser/sessions/base_session_service.cc b/chrome/browser/sessions/base_session_service.cc index 49ecde1..1c0df32 100644 --- a/chrome/browser/sessions/base_session_service.cc +++ b/chrome/browser/sessions/base_session_service.cc @@ -156,27 +156,28 @@ SessionCommand* BaseSessionService::CreateUpdateTabNavigationCommand( int bytes_written = 0; WriteStringToPickle(pickle, &bytes_written, max_state_size, - entry.virtual_url().spec()); + entry.GetVirtualURL().spec()); - WriteString16ToPickle(pickle, &bytes_written, max_state_size, entry.title()); + WriteString16ToPickle(pickle, &bytes_written, max_state_size, + entry.GetTitle()); - if (entry.has_post_data()) { + if (entry.GetHasPostData()) { // Remove the form data, it may contain sensitive information. WriteStringToPickle(pickle, &bytes_written, max_state_size, - webkit_glue::RemoveFormDataFromHistoryState(entry.content_state())); + webkit_glue::RemoveFormDataFromHistoryState(entry.GetContentState())); } else { WriteStringToPickle(pickle, &bytes_written, max_state_size, - entry.content_state()); + entry.GetContentState()); } - pickle.WriteInt(entry.transition_type()); - int type_mask = entry.has_post_data() ? TabNavigation::HAS_POST_DATA : 0; + pickle.WriteInt(entry.GetTransitionType()); + int type_mask = entry.GetHasPostData() ? TabNavigation::HAS_POST_DATA : 0; pickle.WriteInt(type_mask); WriteStringToPickle(pickle, &bytes_written, max_state_size, - entry.referrer().url.is_valid() ? - entry.referrer().url.spec() : std::string()); - pickle.WriteInt(entry.referrer().policy); + entry.GetReferrer().url.is_valid() ? + entry.GetReferrer().url.spec() : std::string()); + pickle.WriteInt(entry.GetReferrer().policy); // Adding more data? Be sure and update TabRestoreService too. return new SessionCommand(command_id, pickle); diff --git a/chrome/browser/sessions/session_service.cc b/chrome/browser/sessions/session_service.cc index 2f799ba..112c60d 100644 --- a/chrome/browser/sessions/session_service.cc +++ b/chrome/browser/sessions/session_service.cc @@ -362,7 +362,7 @@ void SessionService::UpdateTabNavigation(const SessionID& window_id, const SessionID& tab_id, int index, const NavigationEntry& entry) { - if (!ShouldTrackEntry(entry.virtual_url()) || + if (!ShouldTrackEntry(entry.GetVirtualURL()) || !ShouldTrackChangesToWindow(window_id)) { return; } @@ -1142,7 +1142,7 @@ void SessionService::BuildCommandsForTab( tab->tab_contents()->GetController().pending_entry() : tab->tab_contents()->GetController().GetEntryAtIndex(i); DCHECK(entry); - if (ShouldTrackEntry(entry->virtual_url())) { + if (ShouldTrackEntry(entry->GetVirtualURL())) { commands->push_back( CreateUpdateTabNavigationCommand( kCommandUpdateTabNavigation, session_id.id(), i, *entry)); diff --git a/chrome/browser/sessions/session_service_unittest.cc b/chrome/browser/sessions/session_service_unittest.cc index 2544337..5a85946 100644 --- a/chrome/browser/sessions/session_service_unittest.cc +++ b/chrome/browser/sessions/session_service_unittest.cc @@ -72,10 +72,10 @@ class SessionServiceTest : public BrowserWithTestWindowTest, NavigationEntry entry; entry.set_url(navigation.virtual_url()); entry.set_referrer(navigation.referrer()); - entry.set_title(navigation.title()); - entry.set_content_state(navigation.state()); + entry.SetTitle(navigation.title()); + entry.SetContentState(navigation.state()); entry.set_transition_type(navigation.transition()); - entry.set_has_post_data( + entry.SetHasPostData( navigation.type_mask() & TabNavigation::HAS_POST_DATA); service()->UpdateTabNavigation(window_id, tab_id, index, entry); if (select) diff --git a/chrome/browser/sessions/session_types.cc b/chrome/browser/sessions/session_types.cc index 39b92b8..bf97500 100644 --- a/chrome/browser/sessions/session_types.cc +++ b/chrome/browser/sessions/session_types.cc @@ -71,21 +71,21 @@ NavigationEntry* TabNavigation::ToNavigationEntry(int page_id, std::string(), profile); - entry->set_page_id(page_id); - entry->set_title(title_); - entry->set_content_state(state_); - entry->set_has_post_data(type_mask_ & TabNavigation::HAS_POST_DATA); + entry->SetPageID(page_id); + entry->SetTitle(title_); + entry->SetContentState(state_); + entry->SetHasPostData(type_mask_ & TabNavigation::HAS_POST_DATA); return entry; } void TabNavigation::SetFromNavigationEntry(const NavigationEntry& entry) { - virtual_url_ = entry.virtual_url(); - referrer_ = entry.referrer(); - title_ = entry.title(); - state_ = entry.content_state(); - transition_ = entry.transition_type(); - type_mask_ = entry.has_post_data() ? TabNavigation::HAS_POST_DATA : 0; + virtual_url_ = entry.GetVirtualURL(); + referrer_ = entry.GetReferrer(); + title_ = entry.GetTitle(); + state_ = entry.GetContentState(); + transition_ = entry.GetTransitionType(); + type_mask_ = entry.GetHasPostData() ? TabNavigation::HAS_POST_DATA : 0; } // static diff --git a/chrome/browser/sessions/session_types.h b/chrome/browser/sessions/session_types.h index c56a508..2ed527b 100644 --- a/chrome/browser/sessions/session_types.h +++ b/chrome/browser/sessions/session_types.h @@ -52,7 +52,7 @@ class TabNavigation { // Resets this TabNavigation from |entry|. void SetFromNavigationEntry(const NavigationEntry& entry); - // Virtual URL of the page. See NavigationEntry::virtual_url() for details. + // Virtual URL of the page. See NavigationEntry::GetVirtualURL() for details. void set_virtual_url(const GURL& url) { virtual_url_ = url; } const GURL& virtual_url() const { return virtual_url_; } diff --git a/chrome/browser/sessions/tab_restore_service.cc b/chrome/browser/sessions/tab_restore_service.cc index 1582c88..8ada016 100644 --- a/chrome/browser/sessions/tab_restore_service.cc +++ b/chrome/browser/sessions/tab_restore_service.cc @@ -28,7 +28,6 @@ #include "chrome/common/extensions/extension_constants.h" #include "chrome/common/url_constants.h" #include "content/browser/tab_contents/navigation_controller.h" -#include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/tab_contents.h" using base::Time; diff --git a/chrome/browser/sessions/tab_restore_service_browsertest.cc b/chrome/browser/sessions/tab_restore_service_browsertest.cc index bc60bb3..7e6f6dd 100644 --- a/chrome/browser/sessions/tab_restore_service_browsertest.cc +++ b/chrome/browser/sessions/tab_restore_service_browsertest.cc @@ -282,9 +282,9 @@ TEST_F(TabRestoreServiceTest, RestorePinnedAndApp) { // Make sure we persist entries to disk that have post data. TEST_F(TabRestoreServiceTest, DontPersistPostData) { AddThreeNavigations(); - controller().GetEntryAtIndex(0)->set_has_post_data(true); - controller().GetEntryAtIndex(1)->set_has_post_data(true); - controller().GetEntryAtIndex(2)->set_has_post_data(true); + controller().GetEntryAtIndex(0)->SetHasPostData(true); + controller().GetEntryAtIndex(1)->SetHasPostData(true); + controller().GetEntryAtIndex(2)->SetHasPostData(true); // Have the service record the tab. service_->CreateHistoricalTab(&controller(), -1); diff --git a/chrome/browser/sidebar/sidebar_container.cc b/chrome/browser/sidebar/sidebar_container.cc index ec8ba22..5bde3f2 100644 --- a/chrome/browser/sidebar/sidebar_container.cc +++ b/chrome/browser/sidebar/sidebar_container.cc @@ -13,7 +13,6 @@ #include "chrome/common/extensions/extension_sidebar_utils.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/tab_contents/navigation_controller.h" -#include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_view.h" #include "content/public/browser/render_process_host.h" diff --git a/chrome/browser/sync/glue/session_model_associator.cc b/chrome/browser/sync/glue/session_model_associator.cc index 71335e4..8eabce4 100644 --- a/chrome/browser/sync/glue/session_model_associator.cc +++ b/chrome/browser/sync/glue/session_model_associator.cc @@ -339,11 +339,11 @@ bool SessionModelAssociator::WriteTabContentsToSyncModel( const NavigationEntry* entry = (i == pending_index) ? tab.GetPendingEntry() : tab.GetEntryAtIndex(i); DCHECK(entry); - if (entry->virtual_url().is_valid()) { + if (entry->GetVirtualURL().is_valid()) { if (i == max_index - 1) { DVLOG(1) << "Associating tab " << tab_id << " with sync id " << sync_id - << ", url " << entry->virtual_url().possibly_invalid_spec() - << " and title " << entry->title(); + << ", url " << entry->GetVirtualURL().possibly_invalid_spec() + << " and title " << entry->GetTitle(); } TabNavigation tab_nav; tab_nav.SetFromNavigationEntry(*entry); @@ -1067,8 +1067,9 @@ bool SessionModelAssociator::IsValidTab(const SyncedTabDelegate& tab) const { const NavigationEntry* entry = tab.GetActiveEntry(); if (!entry) return false; - if (entry->virtual_url().is_valid() && - (entry->virtual_url().GetOrigin() != GURL(chrome::kChromeUINewTabURL) || + if (entry->GetVirtualURL().is_valid() && + (entry->GetVirtualURL().GetOrigin() != + GURL(chrome::kChromeUINewTabURL) || tab.GetEntryCount() > 1)) { return true; } diff --git a/chrome/browser/sync/profile_sync_service_session_unittest.cc b/chrome/browser/sync/profile_sync_service_session_unittest.cc index 6bede13..44224e8 100644 --- a/chrome/browser/sync/profile_sync_service_session_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_session_unittest.cc @@ -359,15 +359,15 @@ TEST_F(ProfileSyncServiceSessionTest, WriteFilledSessionToNode) { SessionModelAssociator::TabLinksMap::iterator iter = tab_map.begin(); ASSERT_EQ(2, iter->second.tab()->GetEntryCount()); ASSERT_EQ(GURL("http://foo/1"), iter->second.tab()-> - GetEntryAtIndex(0)->virtual_url()); + GetEntryAtIndex(0)->GetVirtualURL()); ASSERT_EQ(GURL("http://foo/2"), iter->second.tab()-> - GetEntryAtIndex(1)->virtual_url()); + GetEntryAtIndex(1)->GetVirtualURL()); iter++; ASSERT_EQ(2, iter->second.tab()->GetEntryCount()); ASSERT_EQ(GURL("http://bar/1"), iter->second.tab()-> - GetEntryAtIndex(0)->virtual_url()); + GetEntryAtIndex(0)->GetVirtualURL()); ASSERT_EQ(GURL("http://bar/2"), iter->second.tab()-> - GetEntryAtIndex(1)->virtual_url()); + GetEntryAtIndex(1)->GetVirtualURL()); } // Test that we fail on a failed model association. diff --git a/chrome/browser/tab_contents/language_state.cc b/chrome/browser/tab_contents/language_state.cc index 50b61fc..0b9841e 100644 --- a/chrome/browser/tab_contents/language_state.cc +++ b/chrome/browser/tab_contents/language_state.cc @@ -25,7 +25,7 @@ void LanguageState::DidNavigate( return; // Don't reset our states, the page has not changed. bool reload = - details.entry->transition_type() == content::PAGE_TRANSITION_RELOAD || + details.entry->GetTransitionType() == content::PAGE_TRANSITION_RELOAD || details.type == content::NAVIGATION_TYPE_SAME_PAGE; if (reload) { // We might not get a LanguageDetermined notifications on reloads. Make sure @@ -68,7 +68,7 @@ std::string LanguageState::AutoTranslateTo() const { prev_original_lang_ != prev_current_lang_ && original_lang_ == current_lang_ && navigation_controller_->GetActiveEntry() && - navigation_controller_->GetActiveEntry()->transition_type() == + navigation_controller_->GetActiveEntry()->GetTransitionType() == content::PAGE_TRANSITION_LINK) { return prev_current_lang_; } diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc index f8ce218..b9fd587 100644 --- a/chrome/browser/tab_contents/render_view_context_menu.cc +++ b/chrome/browser/tab_contents/render_view_context_menu.cc @@ -1195,7 +1195,7 @@ bool RenderViewContextMenu::IsCommandIdEnabled(int id) const { NavigationEntry* active_entry = source_tab_contents_->GetController().GetActiveEntry(); return SavePackage::IsSavableURL( - (active_entry) ? active_entry->url() : GURL()); + (active_entry) ? active_entry->GetURL() : GURL()); } case IDC_CONTENT_CONTEXT_RELOADFRAME: @@ -1565,7 +1565,7 @@ void RenderViewContextMenu::ExecuteCommand(int id, int event_flags) { case IDC_CONTENT_CONTEXT_VIEWPAGEINFO: { NavigationEntry* nav_entry = source_tab_contents_->GetController().GetActiveEntry(); - source_tab_contents_->ShowPageInfo(nav_entry->url(), nav_entry->ssl(), + source_tab_contents_->ShowPageInfo(nav_entry->GetURL(), nav_entry->ssl(), true); break; } diff --git a/chrome/browser/tab_contents/render_view_context_menu_browsertest.cc b/chrome/browser/tab_contents/render_view_context_menu_browsertest.cc index d0e3d27..e8abb91 100644 --- a/chrome/browser/tab_contents/render_view_context_menu_browsertest.cc +++ b/chrome/browser/tab_contents/render_view_context_menu_browsertest.cc @@ -44,7 +44,7 @@ class ContextMenuBrowserTest : public InProcessBrowserTest { params.unfiltered_link_url = unfiltered_url; params.link_url = url; TabContents* tab_contents = browser()->GetSelectedTabContents(); - params.page_url = tab_contents->GetController().GetActiveEntry()->url(); + params.page_url = tab_contents->GetController().GetActiveEntry()->GetURL(); #if defined(OS_MACOSX) params.writing_direction_default = 0; params.writing_direction_left_to_right = 0; diff --git a/chrome/browser/tabs/pinned_tab_codec.cc b/chrome/browser/tabs/pinned_tab_codec.cc index 7733708..e54ea2b 100644 --- a/chrome/browser/tabs/pinned_tab_codec.cc +++ b/chrome/browser/tabs/pinned_tab_codec.cc @@ -58,7 +58,7 @@ static void EncodePinnedTab(TabStripModel* model, if (!entry && tab_contents->tab_contents()->GetController().entry_count()) entry = tab_contents->tab_contents()->GetController().GetEntryAtIndex(0); if (entry) { - value->SetString(kURL, entry->url().spec()); + value->SetString(kURL, entry->GetURL().spec()); values->Append(value.release()); } } diff --git a/chrome/browser/tabs/tab_finder.cc b/chrome/browser/tabs/tab_finder.cc index bf09a8d..c4f0959 100644 --- a/chrome/browser/tabs/tab_finder.cc +++ b/chrome/browser/tabs/tab_finder.cc @@ -144,7 +144,7 @@ void TabFinder::DidNavigateAnyFrame( // If this is a redirect, we need to go to the db to get the start. FetchRedirectStart(source); } else if (params.redirects.size() > 1 || - params.redirects[0] != details.entry->url()) { + params.redirects[0] != details.entry->GetURL()) { tab_contents_to_url_[source] = params.redirects[0]; } } @@ -213,7 +213,7 @@ void TabFinder::FetchRedirectStart(TabContents* tab) { NavigationEntry* committed_entry = tab->GetController().GetLastCommittedEntry(); - if (!committed_entry || committed_entry->url().is_empty()) + if (!committed_entry || committed_entry->GetURL().is_empty()) return; HistoryService* history = profile->GetHistoryService( @@ -221,7 +221,7 @@ void TabFinder::FetchRedirectStart(TabContents* tab) { if (history) { CancelableRequestProvider::Handle request_handle = history->QueryRedirectsTo( - committed_entry->url(), + committed_entry->GetURL(), &callback_consumer_, base::Bind(&TabFinder::QueryRedirectsToComplete, base::Unretained(this))); diff --git a/chrome/browser/translate/options_menu_model.cc b/chrome/browser/translate/options_menu_model.cc index c835e31..ed0b568 100644 --- a/chrome/browser/translate/options_menu_model.cc +++ b/chrome/browser/translate/options_menu_model.cc @@ -99,7 +99,7 @@ bool OptionsMenuModel::IsCommandIdEnabled(int command_id) const { tab_contents()->GetController().GetActiveEntry(); // Delegate and tab contents should never be NULL, but active entry // can be NULL when running tests. We want to return false if NULL. - return (entry != NULL) && !entry->url().SchemeIsSecure(); + return (entry != NULL) && !entry->GetURL().SchemeIsSecure(); } default: break; diff --git a/chrome/browser/translate/translate_infobar_delegate.cc b/chrome/browser/translate/translate_infobar_delegate.cc index e687173..0a00819 100644 --- a/chrome/browser/translate/translate_infobar_delegate.cc +++ b/chrome/browser/translate/translate_infobar_delegate.cc @@ -400,5 +400,5 @@ TranslateInfoBarDelegate* std::string TranslateInfoBarDelegate::GetPageHost() { NavigationEntry* entry = owner()->tab_contents()->GetController().GetActiveEntry(); - return entry ? entry->url().HostNoBrackets() : std::string(); + return entry ? entry->GetURL().HostNoBrackets() : std::string(); } diff --git a/chrome/browser/translate/translate_manager.cc b/chrome/browser/translate/translate_manager.cc index 8e59245..038cfba 100644 --- a/chrome/browser/translate/translate_manager.cc +++ b/chrome/browser/translate/translate_manager.cc @@ -280,7 +280,7 @@ void TranslateManager::Observe(int type, // infobar if the user already dismissed one in that case. return; } - if (entry->transition_type() != content::PAGE_TRANSITION_RELOAD && + if (entry->GetTransitionType() != content::PAGE_TRANSITION_RELOAD && load_details->type != content::NAVIGATION_TYPE_SAME_PAGE) { return; } @@ -401,7 +401,7 @@ void TranslateManager::OnURLFetchComplete(const content::URLFetcher* source) { continue; } NavigationEntry* entry = tab->GetController().GetActiveEntry(); - if (!entry || entry->page_id() != request.page_id) { + if (!entry || entry->GetPageID() != request.page_id) { // We navigated away from the page the translation was triggered on. continue; } @@ -489,8 +489,8 @@ void TranslateManager::InitiateTranslation(TabContents* tab, // - similar languages (ex: en-US to en). // - any user black-listed URLs or user selected language combination. // - any language the user configured as accepted languages. - if (!IsTranslatableURL(entry->url()) || language_code == target_lang || - !TranslatePrefs::CanTranslate(prefs, language_code, entry->url()) || + if (!IsTranslatableURL(entry->GetURL()) || language_code == target_lang || + !TranslatePrefs::CanTranslate(prefs, language_code, entry->GetURL()) || IsAcceptLanguage(tab, language_code)) { return; } @@ -575,7 +575,7 @@ void TranslateManager::TranslatePage(TabContents* tab_contents, PendingRequest request; request.render_process_id = rvh->process()->GetID(); request.render_view_id = rvh->routing_id(); - request.page_id = entry->page_id(); + request.page_id = entry->GetPageID(); request.source_lang = source_lang; request.target_lang = target_lang; pending_requests_.push_back(request); @@ -589,7 +589,7 @@ void TranslateManager::RevertTranslation(TabContents* tab_contents) { return; } tab_contents->GetRenderViewHost()->Send(new ChromeViewMsg_RevertTranslation( - tab_contents->GetRenderViewHost()->routing_id(), entry->page_id())); + tab_contents->GetRenderViewHost()->routing_id(), entry->GetPageID())); TranslateTabHelper* helper = TabContentsWrapper::GetCurrentWrapperForContents( tab_contents)->translate_tab_helper(); @@ -599,7 +599,7 @@ void TranslateManager::RevertTranslation(TabContents* tab_contents) { void TranslateManager::ReportLanguageDetectionError(TabContents* tab_contents) { UMA_HISTOGRAM_COUNTS("Translate.ReportLanguageDetectionError", 1); - GURL page_url = tab_contents->GetController().GetActiveEntry()->url(); + GURL page_url = tab_contents->GetController().GetActiveEntry()->GetURL(); // Report option should be disabled for secure URLs. DCHECK(!page_url.SchemeIsSecure()); std::string report_error_url(kReportLanguageDetectionErrorURL); @@ -643,7 +643,7 @@ void TranslateManager::DoTranslatePage(TabContents* tab, wrapper->translate_tab_helper()->language_state().set_translation_pending( true); tab->GetRenderViewHost()->Send(new ChromeViewMsg_TranslatePage( - tab->GetRenderViewHost()->routing_id(), entry->page_id(), + tab->GetRenderViewHost()->routing_id(), entry->GetPageID(), translate_script, source_lang, target_lang)); } diff --git a/chrome/browser/translate/translate_manager_browsertest.cc b/chrome/browser/translate/translate_manager_browsertest.cc index 0a3200f..97415c2 100644 --- a/chrome/browser/translate/translate_manager_browsertest.cc +++ b/chrome/browser/translate/translate_manager_browsertest.cc @@ -305,7 +305,7 @@ class TestRenderViewContextMenu : public RenderViewContextMenu { params.media_flags = 0; params.spellcheck_enabled = false; params.is_editable = false; - params.page_url = tab_contents->GetController().GetActiveEntry()->url(); + params.page_url = tab_contents->GetController().GetActiveEntry()->GetURL(); #if defined(OS_MACOSX) params.writing_direction_default = 0; params.writing_direction_left_to_right = 0; diff --git a/chrome/browser/ui/blocked_content/blocked_content_tab_helper.cc b/chrome/browser/ui/blocked_content/blocked_content_tab_helper.cc index 208f8f9..cd04fbe 100644 --- a/chrome/browser/ui/blocked_content/blocked_content_tab_helper.cc +++ b/chrome/browser/ui/blocked_content/blocked_content_tab_helper.cc @@ -82,7 +82,7 @@ void BlockedContentTabHelper::AddPopup(TabContentsWrapper* new_contents, // because it returns the active entry. NavigationEntry* entry = tab_contents()->GetController().GetLastCommittedEntry(); - GURL creator = entry ? entry->virtual_url() : GURL::EmptyGURL(); + GURL creator = entry ? entry->GetVirtualURL() : GURL::EmptyGURL(); Profile* profile = Profile::FromBrowserContext(tab_contents()->GetBrowserContext()); diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index 804f3d0..1109ccf 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -254,13 +254,13 @@ bool HasInternalURL(const NavigationEntry* entry) { // Check the |virtual_url()| first. This catches regular chrome:// URLs // including URLs that were rewritten (such as chrome://bookmarks). - if (entry->virtual_url().SchemeIs(chrome::kChromeUIScheme)) + if (entry->GetVirtualURL().SchemeIs(chrome::kChromeUIScheme)) return true; // If the |virtual_url()| isn't a chrome:// URL, check if it's actually // view-source: of a chrome:// URL. - if (entry->virtual_url().SchemeIs(chrome::kViewSourceScheme)) - return entry->url().SchemeIs(chrome::kChromeUIScheme); + if (entry->GetVirtualURL().SchemeIs(chrome::kViewSourceScheme)) + return entry->GetURL().SchemeIs(chrome::kChromeUIScheme); return false; } @@ -1546,7 +1546,8 @@ void Browser::ReloadInternal(WindowOpenDisposition disposition, if (current_tab && current_tab->ShowingInterstitialPage()) { NavigationEntry* entry = current_tab->GetController().GetActiveEntry(); DCHECK(entry); // Should exist if interstitial is showing. - OpenURL(entry->url(), GURL(), disposition, content::PAGE_TRANSITION_RELOAD); + OpenURL( + entry->GetURL(), GURL(), disposition, content::PAGE_TRANSITION_RELOAD); return; } @@ -2071,7 +2072,7 @@ void Browser::OpenCreateShortcutsDialog() { // Start fetching web app info for CreateApplicationShortcut dialog and show // the dialog when the data is available in OnDidGetApplicationInfo. - current_tab->extension_tab_helper()->GetApplicationInfo(entry->page_id()); + current_tab->extension_tab_helper()->GetApplicationInfo(entry->GetPageID()); #else NOTIMPLEMENTED(); #endif @@ -2178,7 +2179,7 @@ void Browser::ShowBrokenPageTab(TabContents* contents) { NavigationEntry* entry = contents->GetController().GetActiveEntry(); if (!entry) return; - std::string page_url = entry->url().spec(); + std::string page_url = entry->GetURL().spec(); std::vector<std::string> subst; subst.push_back(UTF16ToASCII(page_title)); subst.push_back(page_url); @@ -3547,7 +3548,7 @@ void Browser::LoadingStateChanged(TabContents* source) { NavigationEntry* entry = source->GetController().GetLastCommittedEntry(); if (entry) { TabContentsWrapper::GetCurrentWrapperForContents(source)-> - extension_tab_helper()->GetApplicationInfo(entry->page_id()); + extension_tab_helper()->GetApplicationInfo(entry->GetPageID()); } else { pending_web_app_action_ = NONE; } @@ -3645,7 +3646,7 @@ bool Browser::IsApplication() const { } void Browser::ConvertContentsToApplication(TabContents* contents) { - const GURL& url = contents->GetController().GetActiveEntry()->url(); + const GURL& url = contents->GetController().GetActiveEntry()->GetURL(); std::string app_name = web_app::GenerateApplicationNameFromURL(url); DetachContents(contents); @@ -3991,7 +3992,7 @@ void Browser::OnDidGetApplicationInfo(TabContentsWrapper* source, NavigationEntry* entry = source->tab_contents()->GetController().GetLastCommittedEntry(); - if (!entry || (entry->page_id() != page_id)) + if (!entry || (entry->GetPageID() != page_id)) return; switch (pending_web_app_action_) { @@ -5211,7 +5212,7 @@ void Browser::ViewSource(TabContentsWrapper* contents) { if (!active_entry) return; - ViewSource(contents, active_entry->url(), active_entry->content_state()); + ViewSource(contents, active_entry->GetURL(), active_entry->GetContentState()); } void Browser::ViewSource(TabContentsWrapper* contents, @@ -5229,14 +5230,14 @@ void Browser::ViewSource(TabContentsWrapper* contents, GURL view_source_url = GURL(chrome::kViewSourceScheme + std::string(":") + url.spec()); - active_entry->set_virtual_url(view_source_url); + active_entry->SetVirtualURL(view_source_url); // Do not restore scroller position. - active_entry->set_content_state( + active_entry->SetContentState( webkit_glue::RemoveScrollOffsetFromHistoryState(content_state)); // Do not restore title, derive it from the url. - active_entry->set_title(string16()); + active_entry->SetTitle(string16()); // Now show view-source entry. if (CanSupportWindowFeature(FEATURE_TABSTRIP)) { @@ -5280,7 +5281,8 @@ int Browser::GetContentRestrictionsForSelectedTab() { NavigationEntry* active_entry = current_tab->GetController().GetActiveEntry(); // See comment in UpdateCommandsForTabState about why we call url(). - if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL()) + if (!SavePackage::IsSavableURL( + active_entry ? active_entry->GetURL() : GURL()) || current_tab->ShowingInterstitialPage()) content_restrictions |= content::CONTENT_RESTRICTION_SAVE; if (current_tab->ShowingInterstitialPage()) diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc index 419faf4..a66b330 100644 --- a/chrome/browser/ui/browser_browsertest.cc +++ b/chrome/browser/ui/browser_browsertest.cc @@ -400,7 +400,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, NullOpenerRedirectForksProcess) { nav_observer.Wait(); ASSERT_TRUE(newtab->GetController().GetLastCommittedEntry()); EXPECT_EQ(https_url.spec(), - newtab->GetController().GetLastCommittedEntry()->url().spec()); + newtab->GetController().GetLastCommittedEntry()->GetURL().spec()); // Popup window should not be in the opener's process. content::RenderProcessHost* popup_process = @@ -434,7 +434,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, NullOpenerRedirectForksProcess) { nav_observer2.Wait(); ASSERT_TRUE(newtab2->GetController().GetLastCommittedEntry()); EXPECT_EQ(https_url.spec(), - newtab2->GetController().GetLastCommittedEntry()->url().spec()); + newtab2->GetController().GetLastCommittedEntry()->GetURL().spec()); // This popup window should also not be in the opener's process. content::RenderProcessHost* popup_process2 = @@ -487,7 +487,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, OtherRedirectsDontForkProcess) { nav_observer.Wait(); ASSERT_TRUE(newtab->GetController().GetLastCommittedEntry()); EXPECT_EQ(https_url.spec(), - newtab->GetController().GetLastCommittedEntry()->url().spec()); + newtab->GetController().GetLastCommittedEntry()->GetURL().spec()); // Popup window should still be in the opener's process. content::RenderProcessHost* popup_process = @@ -507,7 +507,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, OtherRedirectsDontForkProcess) { nav_observer2.Wait(); ASSERT_TRUE(oldtab->GetController().GetLastCommittedEntry()); EXPECT_EQ(https_url.spec(), - oldtab->GetController().GetLastCommittedEntry()->url().spec()); + oldtab->GetController().GetLastCommittedEntry()->GetURL().spec()); // Original window should still be in the original process. content::RenderProcessHost* new_process = newtab->GetRenderProcessHost(); diff --git a/chrome/browser/ui/cocoa/applescript/tab_applescript.mm b/chrome/browser/ui/cocoa/applescript/tab_applescript.mm index b215f1a..748e15d 100644 --- a/chrome/browser/ui/cocoa/applescript/tab_applescript.mm +++ b/chrome/browser/ui/cocoa/applescript/tab_applescript.mm @@ -191,7 +191,7 @@ static NSAppleEventDescriptor* valueToDescriptor(Value* value) { if (!entry) { return nil; } - const GURL& url = entry->virtual_url(); + const GURL& url = entry->GetVirtualURL(); return base::SysUTF8ToNSString(url.spec()); } @@ -215,7 +215,7 @@ static NSAppleEventDescriptor* valueToDescriptor(Value* value) { if (!entry) return; - const GURL& previousURL = entry->virtual_url(); + const GURL& previousURL = entry->GetVirtualURL(); tabContents_->tab_contents()->OpenURL(OpenURLParams( url, content::Referrer(previousURL, WebKit::WebReferrerPolicyDefault), @@ -232,7 +232,7 @@ static NSAppleEventDescriptor* valueToDescriptor(Value* value) { std::wstring title; if (entry != NULL) { - title = UTF16ToWideHack(entry->title()); + title = UTF16ToWideHack(entry->GetTitle()); } return base::SysWideToNSString(title); @@ -392,7 +392,7 @@ static NSAppleEventDescriptor* valueToDescriptor(Value* value) { if (entry) { tabContents_->tab_contents()->OpenURL( GURL(chrome::kViewSourceScheme + std::string(":") + - entry->url().spec()), + entry->GetURL().spec()), GURL(), NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK); diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm index b251cd3..4917da4 100644 --- a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm +++ b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm @@ -47,7 +47,6 @@ #include "chrome/common/extensions/extension_action.h" #include "chrome/common/extensions/extension_resource.h" #include "chrome/common/pref_names.h" -#include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/notification_service.h" #include "grit/generated_resources.h" diff --git a/chrome/browser/ui/cocoa/location_bar/location_icon_decoration.mm b/chrome/browser/ui/cocoa/location_bar/location_icon_decoration.mm index bcf4086..72992f0 100644 --- a/chrome/browser/ui/cocoa/location_bar/location_icon_decoration.mm +++ b/chrome/browser/ui/cocoa/location_bar/location_icon_decoration.mm @@ -98,7 +98,7 @@ bool LocationIconDecoration::OnMousePressed(NSRect frame) { NOTREACHED(); return true; } - tab->ShowPageInfo(nav_entry->url(), nav_entry->ssl(), true); + tab->ShowPageInfo(nav_entry->GetURL(), nav_entry->ssl(), true); return true; } diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm index c0a7fda..447197f 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm @@ -52,7 +52,6 @@ #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" #include "content/browser/tab_contents/navigation_controller.h" -#include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_view.h" #include "content/public/browser/user_metrics.h" diff --git a/chrome/browser/ui/constrained_window_tab_helper.cc b/chrome/browser/ui/constrained_window_tab_helper.cc index e384b67..b718fb3 100644 --- a/chrome/browser/ui/constrained_window_tab_helper.cc +++ b/chrome/browser/ui/constrained_window_tab_helper.cc @@ -92,7 +92,7 @@ void ConstrainedWindowTabHelper::DidNavigateMainFrame( const content::FrameNavigateParams& params) { // Close constrained windows if necessary. if (!net::RegistryControlledDomainService::SameDomainOrHost( - details.previous_url, details.entry->url())) + details.previous_url, details.entry->GetURL())) CloseConstrainedWindows(); } diff --git a/chrome/browser/ui/find_bar/find_bar_controller.cc b/chrome/browser/ui/find_bar/find_bar_controller.cc index dd41ffb..c518060 100644 --- a/chrome/browser/ui/find_bar/find_bar_controller.cc +++ b/chrome/browser/ui/find_bar/find_bar_controller.cc @@ -137,7 +137,7 @@ void FindBarController::Observe(int type, content::LoadCommittedDetails* commit_details = content::Details<content::LoadCommittedDetails>(details).ptr(); content::PageTransition transition_type = - commit_details->entry->transition_type(); + commit_details->entry->GetTransitionType(); // We hide the FindInPage window when the user navigates away, except on // reload. if (find_bar_->IsFindBarVisible()) { diff --git a/chrome/browser/ui/gtk/location_bar_view_gtk.cc b/chrome/browser/ui/gtk/location_bar_view_gtk.cc index 2eb0342..de7633a 100644 --- a/chrome/browser/ui/gtk/location_bar_view_gtk.cc +++ b/chrome/browser/ui/gtk/location_bar_view_gtk.cc @@ -1049,7 +1049,7 @@ gboolean LocationBarViewGtk::OnIconReleased(GtkWidget* sender, NOTREACHED(); return FALSE; } - tab->ShowPageInfo(nav_entry->url(), nav_entry->ssl(), true); + tab->ShowPageInfo(nav_entry->GetURL(), nav_entry->ssl(), true); return TRUE; } else if (event->button == 2) { // When the user middle clicks on the location icon, try to open the 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 68911ae..a58e08e 100644 --- a/chrome/browser/ui/search_engines/search_engine_tab_helper.cc +++ b/chrome/browser/ui/search_engines/search_engine_tab_helper.cc @@ -18,7 +18,7 @@ namespace { // Returns true if the entry's transition type is FORM_SUBMIT. bool IsFormSubmit(const NavigationEntry* entry) { - return (content::PageTransitionStripQualifier(entry->transition_type()) == + return (content::PageTransitionStripQualifier(entry->GetTransitionType()) == content::PAGE_TRANSITION_FORM_SUBMIT); } @@ -108,7 +108,7 @@ void SearchEngineTabHelper::OnPageHasOSDD( if (!base_entry) return; GURL keyword_url = base_entry->user_typed_url().is_valid() ? - base_entry->user_typed_url() : base_entry->url(); + base_entry->user_typed_url() : base_entry->GetURL(); if (!keyword_url.is_valid()) return; @@ -153,7 +153,7 @@ void SearchEngineTabHelper::GenerateKeywordIfNecessary( } GURL keyword_url = previous_entry->user_typed_url().is_valid() ? - previous_entry->user_typed_url() : previous_entry->url(); + previous_entry->user_typed_url() : previous_entry->GetURL(); string16 keyword = TemplateURLService::GenerateKeyword(keyword_url, true); // autodetected if (keyword.empty()) diff --git a/chrome/browser/ui/toolbar/back_forward_menu_model.cc b/chrome/browser/ui/toolbar/back_forward_menu_model.cc index c3b30d2..410fd47 100644 --- a/chrome/browser/ui/toolbar/back_forward_menu_model.cc +++ b/chrome/browser/ui/toolbar/back_forward_menu_model.cc @@ -225,20 +225,20 @@ void BackForwardMenuModel::SetMenuModelDelegate( void BackForwardMenuModel::FetchFavicon(NavigationEntry* entry) { // If the favicon has already been requested for this menu, don't do // anything. - if (requested_favicons_.find(entry->unique_id()) != + if (requested_favicons_.find(entry->GetUniqueID()) != requested_favicons_.end()) { return; } - requested_favicons_.insert(entry->unique_id()); + requested_favicons_.insert(entry->GetUniqueID()); FaviconService* favicon_service = browser_->profile()->GetFaviconService(Profile::EXPLICIT_ACCESS); if (!favicon_service) return; FaviconService::Handle handle = favicon_service->GetFaviconForURL( - entry->url(), history::FAVICON, &load_consumer_, + entry->GetURL(), history::FAVICON, &load_consumer_, base::Bind(&BackForwardMenuModel::OnFavIconDataAvailable, base::Unretained(this))); - load_consumer_.SetClientData(favicon_service, handle, entry->unique_id()); + load_consumer_.SetClientData(favicon_service, handle, entry->GetUniqueID()); } void BackForwardMenuModel::OnFavIconDataAvailable( @@ -252,7 +252,7 @@ void BackForwardMenuModel::OnFavIconDataAvailable( for (int i = 0; i < GetItemCount() - 1; i++) { if (IsSeparator(i)) continue; - if (GetNavigationEntry(i)->unique_id() == unique_id) { + if (GetNavigationEntry(i)->GetUniqueID() == unique_id) { model_index = i; entry = GetNavigationEntry(i); break; @@ -348,14 +348,14 @@ int BackForwardMenuModel::GetIndexOfNextChapterStop(int start_from, } NavigationEntry* start_entry = controller.GetEntryAtIndex(start_from); - const GURL& url = start_entry->url(); + const GURL& url = start_entry->GetURL(); if (!forward) { // When going backwards we return the first entry we find that has a // different domain. for (int i = start_from - 1; i >= 0; --i) { if (!net::RegistryControlledDomainService::SameDomainOrHost(url, - controller.GetEntryAtIndex(i)->url())) + controller.GetEntryAtIndex(i)->GetURL())) return i; } // We have reached the beginning without finding a chapter stop. @@ -365,7 +365,7 @@ int BackForwardMenuModel::GetIndexOfNextChapterStop(int start_from, // different domain. for (int i = start_from + 1; i < max_count; ++i) { if (!net::RegistryControlledDomainService::SameDomainOrHost(url, - controller.GetEntryAtIndex(i)->url())) + controller.GetEntryAtIndex(i)->GetURL())) return i - 1; } // Last entry is always considered a chapter stop. diff --git a/chrome/browser/ui/toolbar/back_forward_menu_model.h b/chrome/browser/ui/toolbar/back_forward_menu_model.h index ef8d9fb..69a7c54 100644 --- a/chrome/browser/ui/toolbar/back_forward_menu_model.h +++ b/chrome/browser/ui/toolbar/back_forward_menu_model.h @@ -186,7 +186,8 @@ class BackForwardMenuModel : public ui::MenuModel { ModelType model_type_; // Keeps track of which favicons have already been requested from the history - // to prevent duplicate requests, identified by NavigationEntry->unique_id(). + // to prevent duplicate requests, identified by + // NavigationEntry->GetUniqueID(). std::set<int> requested_favicons_; // Used for loading favicons from history. diff --git a/chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc b/chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc index 009c7a8..a8fdbd4 100644 --- a/chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc +++ b/chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc @@ -76,7 +76,7 @@ class BackFwdMenuModelTest : public ChromeRenderViewHostTestHarness { void LoadURLAndUpdateState(const char* url, const char* title) { NavigateAndCommit(GURL(url)); - controller().GetLastCommittedEntry()->set_title(UTF8ToUTF16(title)); + controller().GetLastCommittedEntry()->SetTitle(UTF8ToUTF16(title)); } // Navigate back or forward the given amount and commits the entry (which diff --git a/chrome/browser/ui/toolbar/toolbar_model.cc b/chrome/browser/ui/toolbar/toolbar_model.cc index 3810495..1a0a108 100644 --- a/chrome/browser/ui/toolbar/toolbar_model.cc +++ b/chrome/browser/ui/toolbar/toolbar_model.cc @@ -48,7 +48,7 @@ string16 ToolbarModel::GetText() const { if (!ShouldDisplayURL()) { url = GURL(); } else if (entry) { - url = entry->virtual_url(); + url = entry->GetVirtualURL(); } } if (url.spec().length() > content::kMaxURLDisplayChars) @@ -82,7 +82,7 @@ bool ToolbarModel::ShouldDisplayURL() const { if (tab_contents && tab_contents->GetWebUIForCurrentState()) return !tab_contents->GetWebUIForCurrentState()->should_hide_url(); - if (entry && entry->url().SchemeIs(chrome::kExtensionScheme)) + if (entry && entry->GetURL().SchemeIs(chrome::kExtensionScheme)) return false; return true; diff --git a/chrome/browser/ui/views/download/download_shelf_view.cc b/chrome/browser/ui/views/download/download_shelf_view.cc index 0eda9538..13de26a 100644 --- a/chrome/browser/ui/views/download/download_shelf_view.cc +++ b/chrome/browser/ui/views/download/download_shelf_view.cc @@ -16,7 +16,6 @@ #include "chrome/browser/ui/views/download/download_item_view.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "content/browser/download/download_stats.h" -#include "content/browser/tab_contents/navigation_entry.h" #include "content/public/browser/download_item.h" #include "content/public/browser/download_manager.h" #include "grit/generated_resources.h" diff --git a/chrome/browser/ui/views/location_bar/click_handler.cc b/chrome/browser/ui/views/location_bar/click_handler.cc index d94c83f..c1d4ab9 100644 --- a/chrome/browser/ui/views/location_bar/click_handler.cc +++ b/chrome/browser/ui/views/location_bar/click_handler.cc @@ -31,5 +31,5 @@ void ClickHandler::OnMouseReleased(const views::MouseEvent& event) { NOTREACHED(); return; } - tab->ShowPageInfo(nav_entry->url(), nav_entry->ssl(), true); + tab->ShowPageInfo(nav_entry->GetURL(), nav_entry->ssl(), true); } diff --git a/chrome/browser/ui/webui/bug_report_ui.cc b/chrome/browser/ui/webui/bug_report_ui.cc index bbb603a..b494749 100644 --- a/chrome/browser/ui/webui/bug_report_ui.cc +++ b/chrome/browser/ui/webui/bug_report_ui.cc @@ -357,7 +357,7 @@ WebUIMessageHandler* BugReportHandler::Attach(WebUI* web_ui) { bool BugReportHandler::Init() { std::string page_url; if (tab_->GetController().GetActiveEntry()) { - page_url = tab_->GetController().GetActiveEntry()->url().spec(); + page_url = tab_->GetController().GetActiveEntry()->GetURL().spec(); } std::string params = page_url.substr(strlen(chrome::kChromeUIBugReportURL)); diff --git a/chrome/browser/ui/webui/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview_handler.cc index 4ef3d17..b0d433a 100644 --- a/chrome/browser/ui/webui/print_preview_handler.cc +++ b/chrome/browser/ui/webui/print_preview_handler.cc @@ -314,7 +314,7 @@ void PrintPreviewHandler::HandleGetPreview(const ListValue* args) { NavigationEntry* entry = initiator_tab->tab_contents()->GetController().GetActiveEntry(); if (entry) - url = entry->virtual_url().spec(); + url = entry->GetVirtualURL().spec(); settings->SetString(printing::kSettingHeaderFooterURL, url); } diff --git a/chrome/test/base/browser_with_test_window_test.cc b/chrome/test/base/browser_with_test_window_test.cc index 80bb90c..e760a4d 100644 --- a/chrome/test/base/browser_with_test_window_test.cc +++ b/chrome/test/base/browser_with_test_window_test.cc @@ -95,15 +95,15 @@ void BrowserWithTestWindowTest::CommitPendingLoad( // just have a standalong pending_entry that isn't in the list already). if (controller->pending_entry_index() >= 0) { test_rvh->SendNavigateWithTransition( - controller->pending_entry()->page_id(), - controller->pending_entry()->url(), - controller->pending_entry()->transition_type()); + controller->pending_entry()->GetPageID(), + controller->pending_entry()->GetURL(), + controller->pending_entry()->GetTransitionType()); } else { test_rvh->SendNavigateWithTransition( controller->tab_contents()-> GetMaxPageIDForSiteInstance(test_rvh->site_instance()) + 1, - controller->pending_entry()->url(), - controller->pending_entry()->transition_type()); + controller->pending_entry()->GetURL(), + controller->pending_entry()->GetTransitionType()); } // Simulate the SwapOut_ACK that fires if you commit a cross-site navigation |