OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/message_center/views/bounded_label.h" | 5 #include "ui/message_center/views/bounded_label.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 DISALLOW_COPY_AND_ASSIGN(InnerBoundedLabel); | 69 DISALLOW_COPY_AND_ASSIGN(InnerBoundedLabel); |
70 }; | 70 }; |
71 | 71 |
72 InnerBoundedLabel::InnerBoundedLabel(const BoundedLabel& owner) | 72 InnerBoundedLabel::InnerBoundedLabel(const BoundedLabel& owner) |
73 : owner_(&owner), | 73 : owner_(&owner), |
74 wrapped_text_width_(0), | 74 wrapped_text_width_(0), |
75 wrapped_text_lines_(0) { | 75 wrapped_text_lines_(0) { |
76 SetMultiLine(true); | 76 SetMultiLine(true); |
77 SetAllowCharacterBreak(true); | 77 SetAllowCharacterBreak(true); |
78 SetElideBehavior(views::Label::ELIDE_AT_END); | |
79 SetHorizontalAlignment(gfx::ALIGN_LEFT); | 78 SetHorizontalAlignment(gfx::ALIGN_LEFT); |
80 set_collapse_when_hidden(true); | 79 set_collapse_when_hidden(true); |
81 } | 80 } |
82 | 81 |
83 InnerBoundedLabel::~InnerBoundedLabel() { | 82 InnerBoundedLabel::~InnerBoundedLabel() { |
84 } | 83 } |
85 | 84 |
86 void InnerBoundedLabel::SetNativeTheme(const ui::NativeTheme* theme) { | 85 void InnerBoundedLabel::SetNativeTheme(const ui::NativeTheme* theme) { |
87 ClearCaches(); | 86 ClearCaches(); |
88 OnNativeThemeChanged(theme); | 87 OnNativeThemeChanged(theme); |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 | 338 |
340 void BoundedLabel::OnNativeThemeChanged(const ui::NativeTheme* theme) { | 339 void BoundedLabel::OnNativeThemeChanged(const ui::NativeTheme* theme) { |
341 label_->SetNativeTheme(theme); | 340 label_->SetNativeTheme(theme); |
342 } | 341 } |
343 | 342 |
344 string16 BoundedLabel::GetWrappedTextForTest(int width, int lines) { | 343 string16 BoundedLabel::GetWrappedTextForTest(int width, int lines) { |
345 return JoinString(label_->GetWrappedText(width, lines), '\n'); | 344 return JoinString(label_->GetWrappedText(width, lines), '\n'); |
346 } | 345 } |
347 | 346 |
348 } // namespace message_center | 347 } // namespace message_center |
OLD | NEW |