diff options
author | johnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-15 21:02:01 +0000 |
---|---|---|
committer | johnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-15 21:02:01 +0000 |
commit | 099c6c2f4118361105354eec5b36c720a3c20a00 (patch) | |
tree | 9fc8bc284354598e2e4364c0ead4cc05114040e7 /chrome/browser/notifications/balloon.h | |
parent | ed7b2980a035eea169e02ab4c7729b0c8056cf4a (diff) | |
download | chromium_src-099c6c2f4118361105354eec5b36c720a3c20a00.zip chromium_src-099c6c2f4118361105354eec5b36c720a3c20a00.tar.gz chromium_src-099c6c2f4118361105354eec5b36c720a3c20a00.tar.bz2 |
position the balloons after closing in a way that will keep the next one's close button under your mouse; don't reposition them to the normal place until the mouse has left the balloon collection
BUG=47333
TEST=make notifications of different sizes, try to close them all; the X should remain under your mouse
Review URL: http://codereview.chromium.org/2915003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52526 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/notifications/balloon.h')
-rw-r--r-- | chrome/browser/notifications/balloon.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/chrome/browser/notifications/balloon.h b/chrome/browser/notifications/balloon.h index 87440c9..7f3b604 100644 --- a/chrome/browser/notifications/balloon.h +++ b/chrome/browser/notifications/balloon.h @@ -57,9 +57,15 @@ class Balloon { const Notification& notification() const { return *notification_.get(); } Profile* profile() const { return profile_; } - const gfx::Point& position() const { return position_; } + gfx::Point GetPosition() const { + return position_.Add(offset_); + } void SetPosition(const gfx::Point& upper_left, bool reposition); + const gfx::Point& offset() { return offset_;} + void set_offset(const gfx::Point& offset) { offset_ = offset; } + void add_offset(const gfx::Point& offset) { offset_ = offset_.Add(offset); } + const gfx::Size& content_size() const { return content_size_; } void set_content_size(const gfx::Size& size) { content_size_ = size; } @@ -115,6 +121,10 @@ class Balloon { gfx::Point position_; gfx::Size content_size_; + // Temporary offset for balloons that need to be positioned in a non-standard + // position for keeping the close buttons under the mouse cursor. + gfx::Point offset_; + // Smallest size for this balloon where scrollbars will be shown. gfx::Size min_scrollbar_size_; |