Chromium Code Reviews| 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 #ifndef UI_MESSAGE_CENTER_BOUNDED_LABEL_H_ | 5 #ifndef UI_MESSAGE_CENTER_BOUNDED_LABEL_H_ |
| 6 #define UI_MESSAGE_CENTER_BOUNDED_LABEL_H_ | 6 #define UI_MESSAGE_CENTER_BOUNDED_LABEL_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "third_party/skia/include/core/SkColor.h" | 12 #include "third_party/skia/include/core/SkColor.h" |
| 13 #include "ui/message_center/message_center_export.h" | 13 #include "ui/message_center/message_center_export.h" |
| 14 #include "ui/views/view.h" | 14 #include "ui/views/view.h" |
| 15 | 15 |
| 16 namespace gfx { | 16 namespace gfx { |
| 17 class Font; | 17 class FontList; |
| 18 } | 18 } // namespace gfx |
|
Jun Mukai
2013/09/10 08:59:41
you can omit "// namespace ~" comment in this size
Yuki
2013/09/10 09:16:34
I know some of people omit it, but I was not able
Jun Mukai
2013/09/10 17:29:46
If the coding style doesn't say specifically, usua
Yuki
2013/09/11 12:53:18
Done.
| |
| 19 | 19 |
| 20 namespace message_center { | 20 namespace message_center { |
| 21 | 21 |
| 22 class InnerBoundedLabel; | 22 class InnerBoundedLabel; |
| 23 | 23 |
| 24 namespace test { | 24 namespace test { |
| 25 class BoundedLabelTest; | 25 class BoundedLabelTest; |
| 26 } | 26 } // namespace test |
|
Jun Mukai
2013/09/10 08:59:41
ditto
Yuki
2013/09/10 09:16:34
Done.
| |
| 27 | 27 |
| 28 // BoundedLabels display left aligned text up to a maximum number of lines, with | 28 // BoundedLabels display left aligned text up to a maximum number of lines, with |
| 29 // ellipsis at the end of the last line for any omitted text. BoundedLabel is a | 29 // ellipsis at the end of the last line for any omitted text. BoundedLabel is a |
| 30 // direct subclass of views::Views rather than a subclass of views::Label | 30 // direct subclass of views::Views rather than a subclass of views::Label |
| 31 // to avoid exposing some of views::Label's methods that can't be made to work | 31 // to avoid exposing some of views::Label's methods that can't be made to work |
| 32 // with BoundedLabel. See the description of InnerBoundedLabel in the | 32 // with BoundedLabel. See the description of InnerBoundedLabel in the |
| 33 // bounded_label.cc file for details. | 33 // bounded_label.cc file for details. |
| 34 class MESSAGE_CENTER_EXPORT BoundedLabel : public views::View { | 34 class MESSAGE_CENTER_EXPORT BoundedLabel : public views::View { |
| 35 public: | 35 public: |
| 36 BoundedLabel(const string16& text, gfx::Font font); | 36 BoundedLabel(const string16& text, const gfx::FontList& font_list); |
| 37 BoundedLabel(const string16& text); | 37 BoundedLabel(const string16& text); |
| 38 virtual ~BoundedLabel(); | 38 virtual ~BoundedLabel(); |
| 39 | 39 |
| 40 void SetColors(SkColor textColor, SkColor backgroundColor); | 40 void SetColors(SkColor textColor, SkColor backgroundColor); |
| 41 void SetLineHeight(int height); // Pass in 0 for default height. | 41 void SetLineHeight(int height); // Pass in 0 for default height. |
| 42 void SetLineLimit(int lines); // Pass in -1 for no limit. | 42 void SetLineLimit(int lines); // Pass in -1 for no limit. |
| 43 | 43 |
| 44 int GetLineHeight() const; | 44 int GetLineHeight() const; |
| 45 int GetLineLimit() const; | 45 int GetLineLimit() const; |
| 46 | 46 |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 68 | 68 |
| 69 scoped_ptr<InnerBoundedLabel> label_; | 69 scoped_ptr<InnerBoundedLabel> label_; |
| 70 int line_limit_; | 70 int line_limit_; |
| 71 | 71 |
| 72 DISALLOW_COPY_AND_ASSIGN(BoundedLabel); | 72 DISALLOW_COPY_AND_ASSIGN(BoundedLabel); |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 } // namespace message_center | 75 } // namespace message_center |
| 76 | 76 |
| 77 #endif // UI_MESSAGE_CENTER_BOUNDED_LABEL_H_ | 77 #endif // UI_MESSAGE_CENTER_BOUNDED_LABEL_H_ |
| OLD | NEW |