diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-13 23:16:54 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-13 23:16:54 +0000 |
commit | ebe89e0676c12a6ebccb35fef1611323d1b35afb (patch) | |
tree | ec1d1715d14c3fb182f0d39fc9178b40c4951897 | |
parent | 5e344a39782b73070a679f0d12a996a012c7e3de (diff) | |
download | chromium_src-ebe89e0676c12a6ebccb35fef1611323d1b35afb.zip chromium_src-ebe89e0676c12a6ebccb35fef1611323d1b35afb.tar.gz chromium_src-ebe89e0676c12a6ebccb35fef1611323d1b35afb.tar.bz2 |
Reland r23357 since it doesn't seem to be the cause of unit test
failure:
Renames the NavigationEntry::display_url() to virtual_url().
BUG=6970 (http://crbug.com/6970)
TEST=None
Patch by Thiago Farina <thiago.farina@gmail.com> at
http://codereview.chromium.org/164383
Review URL: http://codereview.chromium.org/165501
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23374 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/automation/automation_provider.cc | 2 | ||||
-rw-r--r-- | chrome/browser/memory_details.cc | 6 | ||||
-rw-r--r-- | chrome/browser/printing/print_view_manager.cc | 2 | ||||
-rw-r--r-- | chrome/browser/sessions/base_session_service.cc | 4 | ||||
-rw-r--r-- | chrome/browser/sessions/session_types.cc | 4 | ||||
-rw-r--r-- | chrome/browser/tab_contents/interstitial_page.cc | 2 | ||||
-rw-r--r-- | chrome/browser/tab_contents/navigation_controller.cc | 2 | ||||
-rw-r--r-- | chrome/browser/tab_contents/navigation_entry.cc | 8 | ||||
-rw-r--r-- | chrome/browser/tab_contents/navigation_entry.h | 22 | ||||
-rw-r--r-- | chrome/browser/tab_contents/navigation_entry_unittest.cc | 22 | ||||
-rw-r--r-- | chrome/browser/tab_contents/render_view_context_menu.cc | 6 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.cc | 20 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.h | 2 | ||||
-rw-r--r-- | chrome/browser/toolbar_model.cc | 2 |
14 files changed, 52 insertions, 52 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index 5016311..677b96e 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -1930,7 +1930,7 @@ void AutomationProvider::GetTabURL(int handle, bool* success, GURL* url) { if (tab_tracker_->ContainsHandle(handle)) { NavigationController* tab = tab_tracker_->GetResource(handle); // Return what the user would see in the location bar. - *url = tab->GetActiveEntry()->display_url(); + *url = tab->GetActiveEntry()->virtual_url(); *success = true; } } diff --git a/chrome/browser/memory_details.cc b/chrome/browser/memory_details.cc index fdf6231..ccf279e 100644 --- a/chrome/browser/memory_details.cc +++ b/chrome/browser/memory_details.cc @@ -232,7 +232,7 @@ void MemoryDetails::CollectChildInfoOnUIThread() { title = L"Untitled"; process.titles.push_back(title); - // We need to check the pending entry as well as the display_url to + // We need to check the pending entry as well as the virtual_url to // see if it's an about:memory URL (we don't want to count these in the // total memory usage of the browser). // @@ -248,10 +248,10 @@ void MemoryDetails::CollectChildInfoOnUIThread() { const NavigationEntry* last_committed_entry = contents->controller().GetLastCommittedEntry(); if ((last_committed_entry && - LowerCaseEqualsASCII(last_committed_entry->display_url().spec(), + LowerCaseEqualsASCII(last_committed_entry->virtual_url().spec(), chrome::kAboutMemoryURL)) || (pending_entry && - LowerCaseEqualsASCII(pending_entry->display_url().spec(), + LowerCaseEqualsASCII(pending_entry->virtual_url().spec(), chrome::kAboutMemoryURL))) process.is_diagnostics = true; } diff --git a/chrome/browser/printing/print_view_manager.cc b/chrome/browser/printing/print_view_manager.cc index 6121cb2..22f3abe 100644 --- a/chrome/browser/printing/print_view_manager.cc +++ b/chrome/browser/printing/print_view_manager.cc @@ -66,7 +66,7 @@ std::wstring PrintViewManager::RenderSourceName() { GURL PrintViewManager::RenderSourceUrl() { NavigationEntry* entry = owner_.controller().GetActiveEntry(); if (entry) - return entry->display_url(); + return entry->virtual_url(); else return GURL(); } diff --git a/chrome/browser/sessions/base_session_service.cc b/chrome/browser/sessions/base_session_service.cc index 832a26e..fcafbe0 100644 --- a/chrome/browser/sessions/base_session_service.cc +++ b/chrome/browser/sessions/base_session_service.cc @@ -156,7 +156,7 @@ SessionCommand* BaseSessionService::CreateUpdateTabNavigationCommand( int bytes_written = 0; WriteStringToPickle(pickle, &bytes_written, max_state_size, - entry.display_url().spec()); + entry.virtual_url().spec()); WriteString16ToPickle(pickle, &bytes_written, max_state_size, entry.title()); @@ -215,7 +215,7 @@ bool BaseSessionService::RestoreUpdateTabNavigationCommand( } bool BaseSessionService::ShouldTrackEntry(const NavigationEntry& entry) { - return entry.display_url().is_valid(); + return entry.virtual_url().is_valid(); } bool BaseSessionService::ShouldTrackEntry(const TabNavigation& navigation) { diff --git a/chrome/browser/sessions/session_types.cc b/chrome/browser/sessions/session_types.cc index 14caf79..852fe8b 100644 --- a/chrome/browser/sessions/session_types.cc +++ b/chrome/browser/sessions/session_types.cc @@ -21,14 +21,14 @@ NavigationEntry* TabNavigation::ToNavigationEntry(int page_id) const { // Use a transition type of reload so that we don't incorrectly // increase the typed count. PageTransition::RELOAD); - entry->set_display_url(url_); + entry->set_virtual_url(url_); entry->set_content_state(state_); entry->set_has_post_data(type_mask_ & TabNavigation::HAS_POST_DATA); return entry; } void TabNavigation::SetFromNavigationEntry(const NavigationEntry& entry) { - url_ = entry.display_url(); + url_ = entry.virtual_url(); referrer_ = entry.referrer(); title_ = entry.title(); state_ = entry.content_state(); diff --git a/chrome/browser/tab_contents/interstitial_page.cc b/chrome/browser/tab_contents/interstitial_page.cc index 4a6439f..5cc0288 100644 --- a/chrome/browser/tab_contents/interstitial_page.cc +++ b/chrome/browser/tab_contents/interstitial_page.cc @@ -187,7 +187,7 @@ void InterstitialPage::Show() { if (new_navigation_) { NavigationEntry* entry = new NavigationEntry; entry->set_url(url_); - entry->set_display_url(url_); + entry->set_virtual_url(url_); entry->set_page_type(NavigationEntry::INTERSTITIAL_PAGE); // Give sub-classes a chance to set some states on the navigation entry. diff --git a/chrome/browser/tab_contents/navigation_controller.cc b/chrome/browser/tab_contents/navigation_controller.cc index 139ddb5..244f251 100644 --- a/chrome/browser/tab_contents/navigation_controller.cc +++ b/chrome/browser/tab_contents/navigation_controller.cc @@ -362,7 +362,7 @@ NavigationEntry* NavigationController::CreateNavigationEntry( NavigationEntry* entry = new NavigationEntry(NULL, -1, loaded_url, referrer, string16(), transition); - entry->set_display_url(url); + entry->set_virtual_url(url); entry->set_user_typed_url(url); if (url.SchemeIsFile()) { std::wstring languages = profile()->GetPrefs()->GetString( diff --git a/chrome/browser/tab_contents/navigation_entry.cc b/chrome/browser/tab_contents/navigation_entry.cc index 5a3ea92..5030c5d 100644 --- a/chrome/browser/tab_contents/navigation_entry.cc +++ b/chrome/browser/tab_contents/navigation_entry.cc @@ -74,15 +74,15 @@ const string16& NavigationEntry::GetTitleForDisplay( if (!cached_display_title_.empty()) return cached_display_title_; - // Use the display URL first if any, and fall back on using the real URL. + // Use the virtual URL first if any, and fall back on using the real URL. std::wstring languages; if (navigation_controller) { languages = navigation_controller->profile()->GetPrefs()->GetString( prefs::kAcceptLanguages); } - if (!display_url_.is_empty()) { + if (!virtual_url_.is_empty()) { cached_display_title_ = WideToUTF16Hack(net::FormatUrl( - display_url_, languages)); + virtual_url_, languages)); } else if (!url_.is_empty()) { cached_display_title_ = WideToUTF16Hack(net::FormatUrl(url_, languages)); } @@ -90,5 +90,5 @@ const string16& NavigationEntry::GetTitleForDisplay( } bool NavigationEntry::IsViewSourceMode() const { - return display_url_.SchemeIs(chrome::kViewSourceScheme); + return virtual_url_.SchemeIs(chrome::kViewSourceScheme); } diff --git a/chrome/browser/tab_contents/navigation_entry.h b/chrome/browser/tab_contents/navigation_entry.h index 366b460..df060d4 100644 --- a/chrome/browser/tab_contents/navigation_entry.h +++ b/chrome/browser/tab_contents/navigation_entry.h @@ -219,7 +219,7 @@ class NavigationEntry { } // The actual URL of the page. For some about pages, this may be a scary - // data: URL or something like that. Use display_url() below for showing to + // data: URL or something like that. Use virtual_url() below for showing to // the user. void set_url(const GURL& url) { url_ = url; @@ -237,22 +237,22 @@ class NavigationEntry { return referrer_; } - // The display URL, when nonempty, will override the actual URL of the page + // The virtual URL, when nonempty, will override the actual URL of the page // when we display it to the user. This allows us to have nice and friendly // URLs that the user sees for things like about: URLs, but actually feed // the renderer a data URL that results in the content loading. // - // display_url() will return the URL to display to the user in all cases, so + // virtual_url() will return the URL to display to the user in all cases, so // if there is no overridden display URL, it will return the actual one. - void set_display_url(const GURL& url) { - display_url_ = (url == url_) ? GURL() : url; + void set_virtual_url(const GURL& url) { + virtual_url_ = (url == url_) ? GURL() : url; cached_display_title_.clear(); } - bool has_display_url() const { - return !display_url_.is_empty(); + bool has_virtual_url() const { + return !virtual_url_.is_empty(); } - const GURL& display_url() const { - return display_url_.is_empty() ? url_ : display_url_; + const GURL& virtual_url() const { + return virtual_url_.is_empty() ? url_ : virtual_url_; } // The title as set by the page. This will be empty if there is no title set. @@ -385,7 +385,7 @@ class NavigationEntry { PageType page_type_; GURL url_; GURL referrer_; - GURL display_url_; + GURL virtual_url_; string16 title_; FaviconStatus favicon_; std::string content_state_; @@ -398,7 +398,7 @@ class NavigationEntry { // This is a cached version of the result of GetTitleForDisplay. It prevents // us from having to do URL formatting on the URL evey time the title is - // displayed. When the URL, display URL, or title is set, this should be + // displayed. When the URL, virtual URL, or title is set, this should be // cleared to force a refresh. string16 cached_display_title_; diff --git a/chrome/browser/tab_contents/navigation_entry_unittest.cc b/chrome/browser/tab_contents/navigation_entry_unittest.cc index 0a9f814..6f8957d 100644 --- a/chrome/browser/tab_contents/navigation_entry_unittest.cc +++ b/chrome/browser/tab_contents/navigation_entry_unittest.cc @@ -44,18 +44,18 @@ TEST_F(NavigationEntryTest, NavigationEntryUniqueIDs) { // Test URL accessors TEST_F(NavigationEntryTest, NavigationEntryURLs) { - // Start with no display_url (even if a url is set) - EXPECT_FALSE(entry1_.get()->has_display_url()); - EXPECT_FALSE(entry2_.get()->has_display_url()); + // Start with no virtual_url (even if a url is set) + EXPECT_FALSE(entry1_.get()->has_virtual_url()); + EXPECT_FALSE(entry2_.get()->has_virtual_url()); EXPECT_EQ(GURL(), entry1_.get()->url()); - EXPECT_EQ(GURL(), entry1_.get()->display_url()); + EXPECT_EQ(GURL(), entry1_.get()->virtual_url()); EXPECT_TRUE(entry1_.get()->GetTitleForDisplay(NULL).empty()); - // Setting URL affects display_url and GetTitleForDisplay + // Setting URL affects virtual_url and GetTitleForDisplay entry1_.get()->set_url(GURL("http://www.google.com")); EXPECT_EQ(GURL("http://www.google.com"), entry1_.get()->url()); - EXPECT_EQ(GURL("http://www.google.com/"), entry1_.get()->display_url()); + EXPECT_EQ(GURL("http://www.google.com/"), entry1_.get()->virtual_url()); EXPECT_EQ(ASCIIToUTF16("http://www.google.com/"), entry1_.get()->GetTitleForDisplay(NULL)); @@ -63,13 +63,13 @@ TEST_F(NavigationEntryTest, NavigationEntryURLs) { entry1_.get()->set_title(ASCIIToUTF16("Google")); EXPECT_EQ(ASCIIToUTF16("Google"), entry1_.get()->GetTitleForDisplay(NULL)); - // Setting display_url doesn't affect URL - entry2_.get()->set_display_url(GURL("display:url")); - EXPECT_TRUE(entry2_.get()->has_display_url()); + // Setting virtual_url doesn't affect URL + entry2_.get()->set_virtual_url(GURL("display:url")); + EXPECT_TRUE(entry2_.get()->has_virtual_url()); EXPECT_EQ(GURL("test:url"), entry2_.get()->url()); - EXPECT_EQ(GURL("display:url"), entry2_.get()->display_url()); + EXPECT_EQ(GURL("display:url"), entry2_.get()->virtual_url()); - // Having a title set in constructor overrides display URL + // Having a title set in constructor overrides virtual URL EXPECT_EQ(ASCIIToUTF16("title"), entry2_.get()->GetTitleForDisplay(NULL)); // User typed URL is independent of the others diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc index 40cc054..ac1fb8d 100644 --- a/chrome/browser/tab_contents/render_view_context_menu.cc +++ b/chrome/browser/tab_contents/render_view_context_menu.cc @@ -309,7 +309,7 @@ bool RenderViewContextMenu::IsItemCommandEnabled(int id) const { return true; case IDS_CONTENT_CONTEXT_FULLSCREEN: - // TODO(ajwong): Enable fullsceren after we actually implement this. + // TODO(ajwong): Enable fullscreen after we actually implement this. return false; // Media control commands should all be disabled if the player is in an @@ -718,8 +718,8 @@ bool RenderViewContextMenu::IsDevCommandEnabled(int id) const { // Don't inspect about:network, about:memory, etc. // However, we do want to inspect about:blank, which is often // used by ordinary web pages. - if (active_entry->display_url().SchemeIs(chrome::kAboutScheme) && - !LowerCaseEqualsASCII(active_entry->display_url().path(), "blank")) + if (active_entry->virtual_url().SchemeIs(chrome::kAboutScheme) && + !LowerCaseEqualsASCII(active_entry->virtual_url().path(), "blank")) return false; // Don't enable the web inspector if JavaScript is disabled diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index 36a5d7e..72cca16 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -434,7 +434,7 @@ PluginInstaller* TabContents::GetPluginInstaller() { const GURL& TabContents::GetURL() const { // We may not have a navigation entry yet NavigationEntry* entry = controller_.GetActiveEntry(); - return entry ? entry->display_url() : GURL::EmptyGURL(); + return entry ? entry->virtual_url() : GURL::EmptyGURL(); } const string16& TabContents::GetTitle() const { @@ -1353,7 +1353,7 @@ void TabContents::UpdateMaxPageIDIfNecessary(SiteInstance* site_instance, } void TabContents::UpdateHistoryForNavigation( - const GURL& display_url, + const GURL& virtual_url, const NavigationController::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params) { if (profile()->IsOffTheRecord()) @@ -1363,17 +1363,17 @@ void TabContents::UpdateHistoryForNavigation( HistoryService* hs = profile()->GetHistoryService(Profile::IMPLICIT_ACCESS); if (hs) { if (PageTransition::IsMainFrame(params.transition) && - display_url != params.url) { - // Hack on the "display" URL so that it will appear in history. For some + virtual_url != params.url) { + // Hack on the "virtual" URL so that it will appear in history. For some // types of URLs, we will display a magic URL that is different from where // the page is actually navigated. We want the user to see in history - // what they saw in the URL bar, so we add the display URL as a redirect. - // This only applies to the main frame, as the display URL doesn't apply + // what they saw in the URL bar, so we add the virtual URL as a redirect. + // This only applies to the main frame, as the virtual URL doesn't apply // to sub-frames. std::vector<GURL> redirects = params.redirects; if (!redirects.empty()) - redirects.back() = display_url; - hs->AddPage(display_url, this, params.page_id, params.referrer, + redirects.back() = virtual_url; + hs->AddPage(virtual_url, this, params.page_id, params.referrer, params.transition, redirects, details.did_replace_entry); } else { hs->AddPage(params.url, this, params.page_id, params.referrer, @@ -1408,7 +1408,7 @@ bool TabContents::UpdateTitleForEntry(NavigationEntry* entry, HistoryService* hs = profile()->GetHistoryService(Profile::IMPLICIT_ACCESS); if (hs) - hs->SetPageTitle(entry->display_url(), final_title); + hs->SetPageTitle(entry->virtual_url(), final_title); // Don't allow the title to be saved again for explicitly set ones. received_page_title_ = explicit_set; @@ -2000,7 +2000,7 @@ void TabContents::DidStopLoading(RenderViewHost* rvh) { base::TimeDelta elapsed = base::TimeTicks::Now() - current_load_start_; details.reset(new LoadNotificationDetails( - entry->display_url(), + entry->virtual_url(), entry->transition_type(), elapsed, &controller_, diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h index 575eb21..3feaaf3 100644 --- a/chrome/browser/tab_contents/tab_contents.h +++ b/chrome/browser/tab_contents/tab_contents.h @@ -727,7 +727,7 @@ class TabContents : public PageNavigator, // Called by OnMsgNavigate to update history state. Overridden by subclasses // that don't want to be added to history. - virtual void UpdateHistoryForNavigation(const GURL& display_url, + virtual void UpdateHistoryForNavigation(const GURL& virtual_url, const NavigationController::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params); diff --git a/chrome/browser/toolbar_model.cc b/chrome/browser/toolbar_model.cc index 9107ec2..1a80db2 100644 --- a/chrome/browser/toolbar_model.cc +++ b/chrome/browser/toolbar_model.cc @@ -38,7 +38,7 @@ std::wstring ToolbarModel::GetText() { // Explicitly hide the URL for this tab. url = GURL(); } else if (entry) { - url = entry->display_url(); + url = entry->virtual_url(); } } return net::FormatUrl(url, languages, true, UnescapeRule::NORMAL, NULL, NULL); |