OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Handles the visible notification (or balloons). | 5 // Handles the visible notification (or balloons). |
6 | 6 |
7 #ifndef CHROME_BROWSER_NOTIFICATIONS_BALLOON_H_ | 7 #ifndef CHROME_BROWSER_NOTIFICATIONS_BALLOON_H_ |
8 #define CHROME_BROWSER_NOTIFICATIONS_BALLOON_H_ | 8 #define CHROME_BROWSER_NOTIFICATIONS_BALLOON_H_ |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 virtual ~Balloon(); | 56 virtual ~Balloon(); |
57 | 57 |
58 const Notification& notification() const { return *notification_.get(); } | 58 const Notification& notification() const { return *notification_.get(); } |
59 Profile* profile() const { return profile_; } | 59 Profile* profile() const { return profile_; } |
60 | 60 |
61 gfx::Point GetPosition() const { | 61 gfx::Point GetPosition() const { |
62 return position_.Add(offset_); | 62 return position_.Add(offset_); |
63 } | 63 } |
64 void SetPosition(const gfx::Point& upper_left, bool reposition); | 64 void SetPosition(const gfx::Point& upper_left, bool reposition); |
65 | 65 |
66 const gfx::Point& offset() { return offset_;} | 66 const gfx::Vector2d& offset() const { return offset_; } |
67 void set_offset(const gfx::Point& offset) { offset_ = offset; } | 67 void set_offset(const gfx::Vector2d& offset) { offset_ = offset; } |
68 void add_offset(const gfx::Point& offset) { offset_ = offset_.Add(offset); } | 68 void add_offset(const gfx::Vector2d& offset) { offset_.Add(offset); } |
69 | 69 |
70 const gfx::Size& content_size() const { return content_size_; } | 70 const gfx::Size& content_size() const { return content_size_; } |
71 void set_content_size(const gfx::Size& size) { content_size_ = size; } | 71 void set_content_size(const gfx::Size& size) { content_size_ = size; } |
72 | 72 |
73 const BalloonCollection* collection() const { return collection_; } | 73 const BalloonCollection* collection() const { return collection_; } |
74 | 74 |
75 const gfx::Size& min_scrollbar_size() const { return min_scrollbar_size_; } | 75 const gfx::Size& min_scrollbar_size() const { return min_scrollbar_size_; } |
76 void set_min_scrollbar_size(const gfx::Size& size) { | 76 void set_min_scrollbar_size(const gfx::Size& size) { |
77 min_scrollbar_size_ = size; | 77 min_scrollbar_size_ = size; |
78 } | 78 } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 119 |
120 // The actual UI element for the balloon. | 120 // The actual UI element for the balloon. |
121 scoped_ptr<BalloonView> balloon_view_; | 121 scoped_ptr<BalloonView> balloon_view_; |
122 | 122 |
123 // Position and size of the balloon on the screen. | 123 // Position and size of the balloon on the screen. |
124 gfx::Point position_; | 124 gfx::Point position_; |
125 gfx::Size content_size_; | 125 gfx::Size content_size_; |
126 | 126 |
127 // Temporary offset for balloons that need to be positioned in a non-standard | 127 // Temporary offset for balloons that need to be positioned in a non-standard |
128 // position for keeping the close buttons under the mouse cursor. | 128 // position for keeping the close buttons under the mouse cursor. |
129 gfx::Point offset_; | 129 gfx::Vector2d offset_; |
130 | 130 |
131 // Smallest size for this balloon where scrollbars will be shown. | 131 // Smallest size for this balloon where scrollbars will be shown. |
132 gfx::Size min_scrollbar_size_; | 132 gfx::Size min_scrollbar_size_; |
133 | 133 |
134 DISALLOW_COPY_AND_ASSIGN(Balloon); | 134 DISALLOW_COPY_AND_ASSIGN(Balloon); |
135 }; | 135 }; |
136 | 136 |
137 #endif // CHROME_BROWSER_NOTIFICATIONS_BALLOON_H_ | 137 #endif // CHROME_BROWSER_NOTIFICATIONS_BALLOON_H_ |
OLD | NEW |