summaryrefslogtreecommitdiffstats
path: root/content/browser/tab_contents/navigation_entry.cc
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-23 03:17:28 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-23 03:17:28 +0000
commit40ead7b6ab0a6de7f8c572e5ff4987433b17a066 (patch)
tree6b0565f4cab63a822342645061f4819730809488 /content/browser/tab_contents/navigation_entry.cc
parentfd8db6c4eaeb557c2b9e142a289d9a1b80fb5756 (diff)
downloadchromium_src-40ead7b6ab0a6de7f8c572e5ff4987433b17a066.zip
chromium_src-40ead7b6ab0a6de7f8c572e5ff4987433b17a066.tar.gz
chromium_src-40ead7b6ab0a6de7f8c572e5ff4987433b17a066.tar.bz2
Change NavigationEntry's title fields to carry the text direction.
Mark most of the users with a tag pointing at the bug, so they can be fixed incrementally. BUG=27094 Review URL: http://codereview.chromium.org/6894009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82778 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/tab_contents/navigation_entry.cc')
-rw-r--r--content/browser/tab_contents/navigation_entry.cc18
1 files changed, 12 insertions, 6 deletions
diff --git a/content/browser/tab_contents/navigation_entry.cc b/content/browser/tab_contents/navigation_entry.cc
index 01a8c77..099d2e4 100644
--- a/content/browser/tab_contents/navigation_entry.cc
+++ b/content/browser/tab_contents/navigation_entry.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -54,7 +54,7 @@ NavigationEntry::NavigationEntry(SiteInstance* instance,
int page_id,
const GURL& url,
const GURL& referrer,
- const string16& title,
+ const base::i18n::String16WithDirection& title,
PageTransition::Type transition_type)
: unique_id_(GetUniqueID()),
site_instance_(instance),
@@ -76,16 +76,16 @@ void NavigationEntry::set_site_instance(SiteInstance* site_instance) {
site_instance_ = site_instance;
}
-const string16& NavigationEntry::GetTitleForDisplay(
+const base::i18n::String16WithDirection& NavigationEntry::GetTitleForDisplay(
const std::string& languages) {
// Most pages have real titles. Don't even bother caching anything if this is
// the case.
- if (!title_.empty())
+ if (!title_.is_empty())
return title_;
// More complicated cases will use the URLs as the title. This result we will
// cache since it's more complicated to compute.
- if (!cached_display_title_.empty())
+ if (!cached_display_title_.is_empty())
return cached_display_title_;
// Use the virtual URL first if any, and fall back on using the real URL.
@@ -103,7 +103,13 @@ const string16& NavigationEntry::GetTitleForDisplay(
title = title.substr(slashpos + 1);
}
- ui::ElideString(title, content::kMaxTitleChars, &cached_display_title_);
+ string16 elided_title;
+ ui::ElideString(title, content::kMaxTitleChars, &elided_title);
+
+ // The computed title is a URL or a filename; assume it's LTR.
+ cached_display_title_ =
+ base::i18n::String16WithDirection(elided_title,
+ base::i18n::LEFT_TO_RIGHT);
return cached_display_title_;
}