summaryrefslogtreecommitdiffstats
path: root/app/text_elider.h
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-20 18:28:00 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-20 18:28:00 +0000
commit68da8f78cd06ba70144c9e3fb2e1bae724208e6a (patch)
tree695907a99af87ad2c9ff646893e11588a447e41d /app/text_elider.h
parent6658ca866d0e28950179a65179c1a4d6e8e3f8df (diff)
downloadchromium_src-68da8f78cd06ba70144c9e3fb2e1bae724208e6a.zip
chromium_src-68da8f78cd06ba70144c9e3fb2e1bae724208e6a.tar.gz
chromium_src-68da8f78cd06ba70144c9e3fb2e1bae724208e6a.tar.bz2
Elide the EV bubble when it's extremely long. This limits it to half the location bar width, unless eliding to that would result in a width of less than 150 px.
BUG=42856 TEST=Visit https://www.barbican.org.uk/eticketing/index.asp and make the window smaller. The EV bubble should shrink, eliding in middle, until it hits a minimum size. Review URL: http://codereview.chromium.org/2084012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47819 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/text_elider.h')
-rw-r--r--app/text_elider.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/app/text_elider.h b/app/text_elider.h
index f3d0246..1378f3b 100644
--- a/app/text_elider.h
+++ b/app/text_elider.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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.
-#ifndef APP_GFX_TEXT_ELIDER_H_
-#define APP_GFX_TEXT_ELIDER_H_
+#ifndef APP_TEXT_ELIDER_H_
+#define APP_TEXT_ELIDER_H_
#include <unicode/coll.h>
#include <unicode/uchar.h>
@@ -36,9 +36,13 @@ std::wstring ElideUrl(const GURL& url,
int available_pixel_width,
const std::wstring& languages);
+// Elides |text| to fit in |available_pixel_width|. If |elide_in_middle| is
+// set the ellipsis is placed in the middle of the string; otherwise it is
+// placed at the end.
std::wstring ElideText(const std::wstring& text,
const gfx::Font& font,
- int available_pixel_width);
+ int available_pixel_width,
+ bool elide_in_middle);
// Elide a filename to fit a given pixel width, with an emphasis on not hiding
// the extension unless we have to. If filename contains a path, the path will
@@ -84,4 +88,4 @@ class SortedDisplayURL {
} // namespace gfx.
-#endif // APP_GFX_TEXT_ELIDER_H_
+#endif // APP_TEXT_ELIDER_H_