diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-06 19:31:27 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-06 19:31:27 +0000 |
commit | cd8d90dbf639924259ad342fef2f10fd5a89dea9 (patch) | |
tree | 670a1f010da774d6893fea918389f4649940c2a3 /content | |
parent | c5e61c7494bebd27df0e968d8d2644e5546154e8 (diff) | |
download | chromium_src-cd8d90dbf639924259ad342fef2f10fd5a89dea9.zip chromium_src-cd8d90dbf639924259ad342fef2f10fd5a89dea9.tar.gz chromium_src-cd8d90dbf639924259ad342fef2f10fd5a89dea9.tar.bz2 |
Move TabContents::ShouldDisplayURL() to ToolbarModel. This doesn't really belong in content and had some bugs because content didn't know about extensions. Moving it up to chrome's browser level allows us to easily handle extensions.
BUG=98746
Review URL: http://codereview.chromium.org/8073029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104349 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/tab_contents/navigation_controller_unittest.cc | 26 | ||||
-rw-r--r-- | content/browser/tab_contents/tab_contents.cc | 18 | ||||
-rw-r--r-- | content/browser/tab_contents/tab_contents.h | 6 |
3 files changed, 0 insertions, 50 deletions
diff --git a/content/browser/tab_contents/navigation_controller_unittest.cc b/content/browser/tab_contents/navigation_controller_unittest.cc index 47c61e6..92685d1 100644 --- a/content/browser/tab_contents/navigation_controller_unittest.cc +++ b/content/browser/tab_contents/navigation_controller_unittest.cc @@ -1825,32 +1825,6 @@ TEST_F(NavigationControllerTest, SameSubframe) { EXPECT_EQ(controller().last_committed_entry_index(), 0); } -// Test view source redirection is reflected in title bar. -TEST_F(NavigationControllerTest, ViewSourceRedirect) { - const char kUrl[] = "view-source:http://redirect.to/google.com"; - const char kResult[] = "http://google.com"; - const char kExpected[] = "view-source:google.com"; - const GURL url(kUrl); - const GURL result_url(kResult); - - controller().LoadURL(url, GURL(), PageTransition::TYPED, std::string()); - - ViewHostMsg_FrameNavigate_Params params; - params.page_id = 0; - params.url = result_url; - params.transition = PageTransition::SERVER_REDIRECT; - params.should_update_history = false; - params.gesture = NavigationGestureAuto; - params.is_post = false; - params.content_state = - webkit_glue::CreateHistoryStateForURL(GURL(result_url)); - content::LoadCommittedDetails details; - controller().RendererDidNavigate(params, &details); - - EXPECT_EQ(ASCIIToUTF16(kExpected), contents()->GetTitle()); - EXPECT_TRUE(contents()->ShouldDisplayURL()); -} - // Make sure that on cloning a tabcontents and going back needs_reload is false. TEST_F(NavigationControllerTest, CloneAndGoBack) { const GURL url1("http://foo1"); diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc index 5d809cc..c5f7725 100644 --- a/content/browser/tab_contents/tab_contents.cc +++ b/content/browser/tab_contents/tab_contents.cc @@ -399,24 +399,6 @@ SiteInstance* TabContents::GetPendingSiteInstance() const { return dest_rvh->site_instance(); } -bool TabContents::ShouldDisplayURL() { - // Don't hide the url in view source mode and with interstitials. - NavigationEntry* entry = controller_.GetActiveEntry(); - if (entry && (entry->IsViewSourceMode() || - entry->page_type() == INTERSTITIAL_PAGE)) { - return true; - } - - // We always display the URL for non-WebUI URLs to prevent spoofing. - if (entry && !content::WebUIFactory::Get()->HasWebUIScheme(entry->url())) - return true; - - WebUI* web_ui = GetWebUIForCurrentState(); - if (web_ui) - return !web_ui->should_hide_url(); - return true; -} - bool TabContents::IsLoading() const { return is_loading_ || (web_ui() && web_ui()->IsLoading()); } diff --git a/content/browser/tab_contents/tab_contents.h b/content/browser/tab_contents/tab_contents.h index 8262c95..d6465be 100644 --- a/content/browser/tab_contents/tab_contents.h +++ b/content/browser/tab_contents/tab_contents.h @@ -168,12 +168,6 @@ class CONTENT_EXPORT TabContents : public PageNavigator, // returns the current SiteInstance. SiteInstance* GetPendingSiteInstance() const; - // Defines whether this tab's URL should be displayed in the browser's URL - // bar. Normally this is true so you can see the URL. This is set to false - // for the new tab page and related pages so that the URL bar is empty and - // the user is invited to type into it. - virtual bool ShouldDisplayURL(); - // Return whether this tab contents is loading a resource, or whether its // web_ui is. bool IsLoading() const; |