summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-16 04:06:24 +0000
committerabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-16 04:06:24 +0000
commit97f756b5dcf7d1a6ffb4ea4e961ccb5fb12aeae2 (patch)
tree80d70b9947cd737c0bad547d7568a052f9f31e56 /chrome/browser
parent600fb345dbd28c70e09dbf3b39bf8977ed18aeb2 (diff)
downloadchromium_src-97f756b5dcf7d1a6ffb4ea4e961ccb5fb12aeae2.zip
chromium_src-97f756b5dcf7d1a6ffb4ea4e961ccb5fb12aeae2.tar.gz
chromium_src-97f756b5dcf7d1a6ffb4ea4e961ccb5fb12aeae2.tar.bz2
Don't show chrome://about/foo as the title for about:foo. Instead, show about:foo.
R=evanm Review URL: http://codereview.chromium.org/14203 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7044 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/navigation_entry.cc4
-rw-r--r--chrome/browser/navigation_entry.h12
2 files changed, 12 insertions, 4 deletions
diff --git a/chrome/browser/navigation_entry.cc b/chrome/browser/navigation_entry.cc
index f7ed6c6..ca64e28 100644
--- a/chrome/browser/navigation_entry.cc
+++ b/chrome/browser/navigation_entry.cc
@@ -59,6 +59,6 @@ NavigationEntry::NavigationEntry(TabContentsType type,
const std::wstring& NavigationEntry::GetTitleForDisplay() {
if (title_.empty())
- return url_as_string_;
+ return display_url_as_string_;
return title_;
-} \ No newline at end of file
+}
diff --git a/chrome/browser/navigation_entry.h b/chrome/browser/navigation_entry.h
index f5ab7f6..8fc2738 100644
--- a/chrome/browser/navigation_entry.h
+++ b/chrome/browser/navigation_entry.h
@@ -220,7 +220,10 @@ class NavigationEntry {
// the user.
void set_url(const GURL& url) {
url_ = url;
- url_as_string_ = UTF8ToWide(url_.spec());
+ if (display_url_.is_empty()) {
+ // If there is no explicit display URL, then we'll display this URL.
+ display_url_as_string_ = UTF8ToWide(url_.spec());
+ }
}
const GURL& url() const {
return url_;
@@ -243,6 +246,7 @@ class NavigationEntry {
// 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;
+ display_url_as_string_ = UTF8ToWide(url.spec());
}
bool has_display_url() const {
return !display_url_.is_empty();
@@ -373,8 +377,12 @@ class NavigationEntry {
GURL url_;
GURL referrer_;
- std::wstring url_as_string_;
GURL display_url_;
+
+ // We cache a copy of the display URL as a string so we don't have to
+ // convert the display URL to a wide string every time we paint.
+ std::wstring display_url_as_string_;
+
std::wstring title_;
FaviconStatus favicon_;
std::string content_state_;