Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: ui/message_center/views/bounded_label.cc

Issue 14654018: Make Label's NO_ELIDE setting actually not elide, and change the default (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698