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

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

Issue 265713007: views: Update event-related API to use PointF/RectF instead of Point/Rect. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
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 46
47 // Pass in a -1 width to use the preferred width, a -1 limit to skip limits. 47 // Pass in a -1 width to use the preferred width, a -1 limit to skip limits.
48 int GetLinesForWidthAndLimit(int width, int limit); 48 int GetLinesForWidthAndLimit(int width, int limit);
49 gfx::Size GetSizeForWidthAndLines(int width, int lines); 49 gfx::Size GetSizeForWidthAndLines(int width, int lines);
50 50
51 // Overridden from views::View. 51 // Overridden from views::View.
52 virtual int GetBaseline() const OVERRIDE; 52 virtual int GetBaseline() const OVERRIDE;
53 virtual gfx::Size GetPreferredSize() OVERRIDE; 53 virtual gfx::Size GetPreferredSize() OVERRIDE;
54 virtual int GetHeightForWidth(int width) OVERRIDE; 54 virtual int GetHeightForWidth(int width) OVERRIDE;
55 virtual void Paint(gfx::Canvas* canvas) OVERRIDE; 55 virtual void Paint(gfx::Canvas* canvas) OVERRIDE;
56 virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE; 56 virtual bool HitTestRect(const gfx::RectF& rect) const OVERRIDE;
57 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; 57 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
58 58
59 protected: 59 protected:
60 // Overridden from views::View. 60 // Overridden from views::View.
61 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; 61 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;
62 virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) OVERRIDE; 62 virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) OVERRIDE;
63 63
64 private: 64 private:
65 friend class test::BoundedLabelTest; 65 friend class test::BoundedLabelTest;
66 66
67 base::string16 GetWrappedTextForTest(int width, int lines); 67 base::string16 GetWrappedTextForTest(int width, int lines);
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698