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

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

Issue 1035553002: message center: Make BoundedLabel override OnPaint instead of Paint. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: boundedlabel: earlyout Created 5 years, 9 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
« no previous file with comments | « no previous file | ui/message_center/views/bounded_label.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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
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 // views::View: 52 // views::View:
53 int GetBaseline() const override; 53 int GetBaseline() const override;
54 gfx::Size GetPreferredSize() const override; 54 gfx::Size GetPreferredSize() const override;
55 int GetHeightForWidth(int width) const override; 55 int GetHeightForWidth(int width) const override;
56 void Paint(gfx::Canvas* canvas, const views::CullSet& cull_set) override; 56 void OnPaint(gfx::Canvas* canvas) override;
57 bool CanProcessEventsWithinSubtree() const override; 57 bool CanProcessEventsWithinSubtree() const override;
58 void GetAccessibleState(ui::AXViewState* state) override; 58 void GetAccessibleState(ui::AXViewState* state) override;
59 59
60 protected: 60 protected:
61 // Overridden from views::View. 61 // Overridden from views::View.
62 void OnBoundsChanged(const gfx::Rect& previous_bounds) override; 62 void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
63 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; 63 void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
64 64
65 private: 65 private:
66 friend class test::BoundedLabelTest; 66 friend class test::BoundedLabelTest;
67 67
68 base::string16 GetWrappedTextForTest(int width, int lines); 68 base::string16 GetWrappedTextForTest(int width, int lines);
69 69
70 scoped_ptr<InnerBoundedLabel> label_; 70 scoped_ptr<InnerBoundedLabel> label_;
71 int line_limit_; 71 int line_limit_;
72 72
73 DISALLOW_COPY_AND_ASSIGN(BoundedLabel); 73 DISALLOW_COPY_AND_ASSIGN(BoundedLabel);
74 }; 74 };
75 75
76 } // namespace message_center 76 } // namespace message_center
77 77
78 #endif // UI_MESSAGE_CENTER_BOUNDED_LABEL_H_ 78 #endif // UI_MESSAGE_CENTER_BOUNDED_LABEL_H_
OLDNEW
« no previous file with comments | « no previous file | ui/message_center/views/bounded_label.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698