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 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 int GetLineLimit() const; | 46 int GetLineLimit() const; |
47 | 47 |
48 // Pass in a -1 width to use the preferred width, a -1 limit to skip limits. | 48 // Pass in a -1 width to use the preferred width, a -1 limit to skip limits. |
49 int GetLinesForWidthAndLimit(int width, int limit); | 49 int GetLinesForWidthAndLimit(int width, int limit); |
50 gfx::Size GetSizeForWidthAndLines(int width, int lines); | 50 gfx::Size GetSizeForWidthAndLines(int width, int lines); |
51 | 51 |
52 // Overridden from views::View. | 52 // Overridden from views::View. |
53 virtual int GetBaseline() const OVERRIDE; | 53 virtual int GetBaseline() const OVERRIDE; |
54 virtual gfx::Size GetPreferredSize() OVERRIDE; | 54 virtual gfx::Size GetPreferredSize() OVERRIDE; |
55 virtual int GetHeightForWidth(int width) OVERRIDE; | 55 virtual int GetHeightForWidth(int width) OVERRIDE; |
56 virtual void Paint(gfx::Canvas* canvas) OVERRIDE; | 56 virtual void Paint(gfx::Canvas* canvas, |
| 57 const views::CullSet& cull_set) OVERRIDE; |
57 virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE; | 58 virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE; |
58 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 59 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; |
59 | 60 |
60 protected: | 61 protected: |
61 // Overridden from views::View. | 62 // Overridden from views::View. |
62 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; | 63 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; |
63 virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) OVERRIDE; | 64 virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) OVERRIDE; |
64 | 65 |
65 private: | 66 private: |
66 friend class test::BoundedLabelTest; | 67 friend class test::BoundedLabelTest; |
67 | 68 |
68 base::string16 GetWrappedTextForTest(int width, int lines); | 69 base::string16 GetWrappedTextForTest(int width, int lines); |
69 | 70 |
70 scoped_ptr<InnerBoundedLabel> label_; | 71 scoped_ptr<InnerBoundedLabel> label_; |
71 int line_limit_; | 72 int line_limit_; |
72 | 73 |
73 DISALLOW_COPY_AND_ASSIGN(BoundedLabel); | 74 DISALLOW_COPY_AND_ASSIGN(BoundedLabel); |
74 }; | 75 }; |
75 | 76 |
76 } // namespace message_center | 77 } // namespace message_center |
77 | 78 |
78 #endif // UI_MESSAGE_CENTER_BOUNDED_LABEL_H_ | 79 #endif // UI_MESSAGE_CENTER_BOUNDED_LABEL_H_ |
OLD | NEW |