| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <vector> | 10 #include <vector> |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 class Balloon { | 50 class Balloon { |
| 51 public: | 51 public: |
| 52 Balloon(const Notification& notification, | 52 Balloon(const Notification& notification, |
| 53 Profile* profile, | 53 Profile* profile, |
| 54 BalloonCollection* collection); | 54 BalloonCollection* collection); |
| 55 virtual ~Balloon(); | 55 virtual ~Balloon(); |
| 56 | 56 |
| 57 const Notification& notification() const { return *notification_.get(); } | 57 const Notification& notification() const { return *notification_.get(); } |
| 58 Profile* profile() const { return profile_; } | 58 Profile* profile() const { return profile_; } |
| 59 | 59 |
| 60 const gfx::Point& position() const { return position_; } | 60 gfx::Point GetPosition() const { |
| 61 return position_.Add(offset_); |
| 62 } |
| 61 void SetPosition(const gfx::Point& upper_left, bool reposition); | 63 void SetPosition(const gfx::Point& upper_left, bool reposition); |
| 62 | 64 |
| 65 const gfx::Point& offset() { return offset_;} |
| 66 void set_offset(const gfx::Point& offset) { offset_ = offset; } |
| 67 void add_offset(const gfx::Point& offset) { offset_ = offset_.Add(offset); } |
| 68 |
| 63 const gfx::Size& content_size() const { return content_size_; } | 69 const gfx::Size& content_size() const { return content_size_; } |
| 64 void set_content_size(const gfx::Size& size) { content_size_ = size; } | 70 void set_content_size(const gfx::Size& size) { content_size_ = size; } |
| 65 | 71 |
| 66 const gfx::Size& min_scrollbar_size() const { return min_scrollbar_size_; } | 72 const gfx::Size& min_scrollbar_size() const { return min_scrollbar_size_; } |
| 67 void set_min_scrollbar_size(const gfx::Size& size) { | 73 void set_min_scrollbar_size(const gfx::Size& size) { |
| 68 min_scrollbar_size_ = size; | 74 min_scrollbar_size_ = size; |
| 69 } | 75 } |
| 70 | 76 |
| 71 // Request a new content size for this balloon. This will get passed | 77 // Request a new content size for this balloon. This will get passed |
| 72 // to the balloon collection for checking against available space and | 78 // to the balloon collection for checking against available space and |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 // The collection that this balloon belongs to. Non-owned pointer. | 114 // The collection that this balloon belongs to. Non-owned pointer. |
| 109 BalloonCollection* collection_; | 115 BalloonCollection* collection_; |
| 110 | 116 |
| 111 // The actual UI element for the balloon. | 117 // The actual UI element for the balloon. |
| 112 scoped_ptr<BalloonView> balloon_view_; | 118 scoped_ptr<BalloonView> balloon_view_; |
| 113 | 119 |
| 114 // Position and size of the balloon on the screen. | 120 // Position and size of the balloon on the screen. |
| 115 gfx::Point position_; | 121 gfx::Point position_; |
| 116 gfx::Size content_size_; | 122 gfx::Size content_size_; |
| 117 | 123 |
| 124 // Temporary offset for balloons that need to be positioned in a non-standard |
| 125 // position for keeping the close buttons under the mouse cursor. |
| 126 gfx::Point offset_; |
| 127 |
| 118 // Smallest size for this balloon where scrollbars will be shown. | 128 // Smallest size for this balloon where scrollbars will be shown. |
| 119 gfx::Size min_scrollbar_size_; | 129 gfx::Size min_scrollbar_size_; |
| 120 | 130 |
| 121 DISALLOW_COPY_AND_ASSIGN(Balloon); | 131 DISALLOW_COPY_AND_ASSIGN(Balloon); |
| 122 }; | 132 }; |
| 123 | 133 |
| 124 #endif // CHROME_BROWSER_NOTIFICATIONS_BALLOON_H_ | 134 #endif // CHROME_BROWSER_NOTIFICATIONS_BALLOON_H_ |
| OLD | NEW |