summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-01 23:58:16 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-01 23:58:16 +0000
commitc0855d30c4755023716cb6e69dc809acdf95cb39 (patch)
treec8192563a4556809a4e63c5e0a610e5b0cedb590 /content
parenta49e10b3dde8dfef19fb10408689b0f13e3b18ad (diff)
downloadchromium_src-c0855d30c4755023716cb6e69dc809acdf95cb39.zip
chromium_src-c0855d30c4755023716cb6e69dc809acdf95cb39.tar.gz
chromium_src-c0855d30c4755023716cb6e69dc809acdf95cb39.tar.bz2
history: use display title, not page title
entry.title() is the underlying page title, but we want to record in history the actual title we show to the user. These differ in corner cases like when the page lacks a title, and also importantly in that the display title can include RTL metadata. BUG=27094 Review URL: http://codereview.chromium.org/7453053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95008 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/tab_contents/navigation_entry.cc2
-rw-r--r--content/browser/tab_contents/navigation_entry.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/content/browser/tab_contents/navigation_entry.cc b/content/browser/tab_contents/navigation_entry.cc
index a93a1fe..5d71d00 100644
--- a/content/browser/tab_contents/navigation_entry.cc
+++ b/content/browser/tab_contents/navigation_entry.cc
@@ -72,7 +72,7 @@ void NavigationEntry::set_site_instance(SiteInstance* site_instance) {
}
const string16& NavigationEntry::GetTitleForDisplay(
- const std::string& languages) {
+ const std::string& languages) const {
// Most pages have real titles. Don't even bother caching anything if this is
// the case.
if (!title_.empty())
diff --git a/content/browser/tab_contents/navigation_entry.h b/content/browser/tab_contents/navigation_entry.h
index 6cdce32..a43eba9 100644
--- a/content/browser/tab_contents/navigation_entry.h
+++ b/content/browser/tab_contents/navigation_entry.h
@@ -324,7 +324,7 @@ class NavigationEntry {
// the page if it is available or the URL. |languages| is the list of
// accpeted languages (e.g., prefs::kAcceptLanguages) or empty if proper
// URL formatting isn't needed (e.g., unit tests).
- const string16& GetTitleForDisplay(const std::string& languages);
+ const string16& GetTitleForDisplay(const std::string& languages) const;
// Returns true if the current tab is in view source mode. This will be false
// if there is no navigation.
@@ -421,7 +421,7 @@ class NavigationEntry {
// us from having to do URL formatting on the URL evey time the title is
// displayed. When the URL, virtual URL, or title is set, this should be
// cleared to force a refresh.
- string16 cached_display_title_;
+ mutable string16 cached_display_title_;
// Copy and assignment is explicitly allowed for this class.
};