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