summaryrefslogtreecommitdiffstats
path: root/ui/message_center
diff options
context:
space:
mode:
authormsw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-12 07:41:47 +0000
committermsw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-12 07:41:47 +0000
commit5f751daa2ab57bee299526a9a25b2d692513bdd1 (patch)
tree13bbc9a853a7835d2c8fea1f74837b564ba98f8b /ui/message_center
parent19c602f19f20eab4ad2a5ac015eb70b254ccedb0 (diff)
downloadchromium_src-5f751daa2ab57bee299526a9a25b2d692513bdd1.zip
chromium_src-5f751daa2ab57bee299526a9a25b2d692513bdd1.tar.gz
chromium_src-5f751daa2ab57bee299526a9a25b2d692513bdd1.tar.bz2
Reland: Use labels to display views tab titles.
The original r276450 was reverted in r276476 for leaks: http://build.chromium.org/p/chromium.memory/builders/Linux%20ASan%20LSan%20Tests%20%283%29/builds/3954 Fixed here by calling AddChildView(title_) on Tab (duh). Add a Label view to Tab for displaying the title. Remove Tab::PaintTitle, bounds and font members. Remove unnecessary Tab::Get[Title|Icon]Bounds helpers. Update the text on Tab::SetData, not during paint. Use gfx::DirectionalityMode, remove the Label enum. Add gfx::ALIGN_TO_HEAD to gfx::HorizontalAlignment. Add Label::GetHorizontalAlignment for ALIGN_TO_HEAD. Always flip left/right in Label::SetHorizontalAlignment. Have Tab and MessageBoxView use ALIGN_TO_HEAD. Update comments and tests, related minor cleanup. TODO: Make Label cache RenderText objects. TODO: Make RenderText support ALIGN_TO_HEAD. BUG=240037 TEST=No visible Views tab title changes. R=sky@chromium.org Review URL: https://codereview.chromium.org/329813003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276566 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/message_center')
-rw-r--r--ui/message_center/views/bounded_label.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/ui/message_center/views/bounded_label.cc b/ui/message_center/views/bounded_label.cc
index 0acad8e..99c66f80 100644
--- a/ui/message_center/views/bounded_label.cc
+++ b/ui/message_center/views/bounded_label.cc
@@ -198,8 +198,11 @@ int InnerBoundedLabel::GetTextFlags() {
if (SkColorGetA(background_color()) != 0xFF)
flags |= gfx::Canvas::NO_SUBPIXEL_RENDERING;
- if (directionality_mode() ==
- views::Label::AUTO_DETECT_DIRECTIONALITY) {
+ if (directionality_mode() == gfx::DIRECTIONALITY_FORCE_LTR) {
+ flags |= gfx::Canvas::FORCE_LTR_DIRECTIONALITY;
+ } else if (directionality_mode() == gfx::DIRECTIONALITY_FORCE_RTL) {
+ flags |= gfx::Canvas::FORCE_RTL_DIRECTIONALITY;
+ } else if (directionality_mode() == gfx::DIRECTIONALITY_FROM_TEXT) {
base::i18n::TextDirection direction =
base::i18n::GetFirstStrongCharacterDirection(text());
if (direction == base::i18n::RIGHT_TO_LEFT)