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

Unified Diff: chrome/browser/notifications/balloon_collection_linux.cc

Issue 2915003: position the balloons after closing in a way that will keep the next one's cl... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/notifications/balloon_collection_linux.cc
===================================================================
--- chrome/browser/notifications/balloon_collection_linux.cc (revision 52083)
+++ chrome/browser/notifications/balloon_collection_linux.cc (working copy)
@@ -30,6 +30,38 @@
return 5;
}
+void BalloonCollectionImpl::DidProcessEvent(GdkEvent* event) {
+ switch (event->type) {
+ case GDK_MOTION_NOTIFY:
+ case GDK_LEAVE_NOTIFY:
+ HandleMouseMoveEvent();
+ break;
+ default:
+ break;
+ }
+}
+
+bool BalloonCollectionImpl::IsCursorInBalloonCollection() const {
+ if (balloons_.empty())
+ return false;
+
+ gfx::Point upper_left = balloons_[balloons_.size() - 1]->GetPosition();
+ gfx::Point lower_right = layout_.GetLayoutOrigin();
+
+ gfx::Rect bounds = gfx::Rect(upper_left.x(),
+ upper_left.y(),
+ lower_right.x() - upper_left.x(),
+ lower_right.y() - upper_left.y());
+
+ GdkScreen* screen = gdk_screen_get_default();
+ GdkDisplay* display = gdk_screen_get_display(screen);
+ gint x, y;
+ gdk_display_get_pointer(display, NULL, &x, &y, NULL);
+ gfx::Point cursor(x, y);
+
+ return bounds.Contains(cursor);
+}
+
// static
BalloonCollection* BalloonCollection::Create() {
return new BalloonCollectionImpl();
« no previous file with comments | « chrome/browser/notifications/balloon_collection_impl.h ('k') | chrome/browser/notifications/balloon_collection_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698