diff options
author | mad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-11 21:12:18 +0000 |
---|---|---|
committer | mad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-11 21:12:18 +0000 |
commit | 976cc37fdc10fb413081484ab5c4785e64eba995 (patch) | |
tree | 6081df910ad41473a9768b99f929e88c68789544 /ui | |
parent | b10539a0f2ef8200f0f9506d3b532418718bf308 (diff) | |
download | chromium_src-976cc37fdc10fb413081484ab5c4785e64eba995.zip chromium_src-976cc37fdc10fb413081484ab5c4785e64eba995.tar.gz chromium_src-976cc37fdc10fb413081484ab5c4785e64eba995.tar.bz2 |
Elides the beginning of tab titles that have common prefixes.
BUG=69304
TEST=Make sure the tab titles are displayed as spec'd, and that there isn't any performance issues.
Review URL: http://codereview.chromium.org/6579050
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77860 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/base/text/text_elider.cc | 5 | ||||
-rw-r--r-- | ui/base/text/text_elider.h | 2 | ||||
-rw-r--r-- | ui/base/text/text_elider_unittest.cc | 3 |
3 files changed, 5 insertions, 5 deletions
diff --git a/ui/base/text/text_elider.cc b/ui/base/text/text_elider.cc index 9c42b2a..4b18619 100644 --- a/ui/base/text/text_elider.cc +++ b/ui/base/text/text_elider.cc @@ -22,9 +22,10 @@ namespace ui { -namespace { +// U+2026 in utf8 +const char kEllipsis[] = "\xE2\x80\xA6"; -const char* kEllipsis = "\xE2\x80\xA6"; +namespace { // Cuts |text| to be |length| characters long. If |cut_in_middle| is true, the // middle of the string is removed to leave equal-length pieces from the diff --git a/ui/base/text/text_elider.h b/ui/base/text/text_elider.h index 86424df..f010712 100644 --- a/ui/base/text/text_elider.h +++ b/ui/base/text/text_elider.h @@ -18,6 +18,8 @@ class GURL; namespace ui { +extern const char kEllipsis[]; + // This function takes a GURL object and elides it. It returns a string // which composed of parts from subdomain, domain, path, filename and query. // A "..." is added automatically at the end if the elided string is bigger diff --git a/ui/base/text/text_elider_unittest.cc b/ui/base/text/text_elider_unittest.cc index 933cc5f..3545656 100644 --- a/ui/base/text/text_elider_unittest.cc +++ b/ui/base/text/text_elider_unittest.cc @@ -16,9 +16,6 @@ namespace ui { namespace { -// U+2026 in utf8 -const char kEllipsis[] = "\xe2\x80\xa6"; - struct Testcase { const std::string input; const std::string output; |