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/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
11 #include "ui/gfx/canvas.h" | 11 #include "ui/gfx/canvas.h" |
12 #include "ui/gfx/text_elider.h" | 12 #include "ui/gfx/text_elider.h" |
13 #include "ui/views/controls/label.h" | 13 #include "ui/views/controls/label.h" |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 const size_t kPreferredLinesCacheSize = 10; | 17 const size_t kPreferredLinesCacheSize = 10; |
18 const size_t kPreferredSizeCacheSize = 10; | |
19 | 18 |
20 } // namespace | 19 } // namespace |
21 | 20 |
22 namespace message_center { | 21 namespace message_center { |
23 | 22 |
24 // InnerBoundedLabel /////////////////////////////////////////////////////////// | 23 // InnerBoundedLabel /////////////////////////////////////////////////////////// |
25 | 24 |
26 // InnerBoundedLabel is a views::Label subclass that does all of the work for | 25 // InnerBoundedLabel is a views::Label subclass that does all of the work for |
27 // BoundedLabel. It is kept private to prevent outside code from calling a | 26 // BoundedLabel. It is kept private to prevent outside code from calling a |
28 // number of views::Label methods like setFont() that break BoundedLabel's | 27 // number of views::Label methods like setFont() that break BoundedLabel's |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 | 337 |
339 void BoundedLabel::OnNativeThemeChanged(const ui::NativeTheme* theme) { | 338 void BoundedLabel::OnNativeThemeChanged(const ui::NativeTheme* theme) { |
340 label_->SetNativeTheme(theme); | 339 label_->SetNativeTheme(theme); |
341 } | 340 } |
342 | 341 |
343 string16 BoundedLabel::GetWrappedTextForTest(int width, int lines) { | 342 string16 BoundedLabel::GetWrappedTextForTest(int width, int lines) { |
344 return JoinString(label_->GetWrappedText(width, lines), '\n'); | 343 return JoinString(label_->GetWrappedText(width, lines), '\n'); |
345 } | 344 } |
346 | 345 |
347 } // namespace message_center | 346 } // namespace message_center |
OLD | NEW |