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

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

Issue 661333: Change some desktop notifications layout parameters to be per-platform rather... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 10 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.cc
===================================================================
--- chrome/browser/notifications/balloon_collection.cc (revision 38533)
+++ chrome/browser/notifications/balloon_collection.cc (working copy)
@@ -19,25 +19,15 @@
// Allow at least this number of balloons on the screen.
const int kMinAllowedBalloonCount = 2;
-// Margin from the edge of the work area
-const int kVerticalEdgeMargin = 5;
-const int kHorizontalEdgeMargin = 5;
-
-// Space between balloons.
-const int kInterBalloonMargin = 5;
-
} // namespace
// static
-#if defined(OS_MACOSX)
+// Note that on MacOS, since the coordinate system is inverted vertically from
+// the others, this actually produces notifications coming from the TOP right,
+// which is what is desired.
BalloonCollectionImpl::Layout::Placement
BalloonCollectionImpl::Layout::placement_ =
- Layout::VERTICALLY_FROM_TOP_RIGHT;
-#else
-BalloonCollectionImpl::Layout::Placement
- BalloonCollectionImpl::Layout::placement_ =
Layout::VERTICALLY_FROM_BOTTOM_RIGHT;
-#endif
BalloonCollectionImpl::BalloonCollectionImpl()
: space_change_listener_(NULL) {
@@ -153,20 +143,20 @@
int y = 0;
switch (placement_) {
case HORIZONTALLY_FROM_BOTTOM_LEFT:
- x = work_area_.x() + kHorizontalEdgeMargin;
- y = work_area_.bottom() - kVerticalEdgeMargin;
+ x = work_area_.x() + HorizontalEdgeMargin();
+ y = work_area_.bottom() - VerticalEdgeMargin();
break;
case HORIZONTALLY_FROM_BOTTOM_RIGHT:
- x = work_area_.right() - kHorizontalEdgeMargin;
- y = work_area_.bottom() - kVerticalEdgeMargin;
+ x = work_area_.right() - HorizontalEdgeMargin();
+ y = work_area_.bottom() - VerticalEdgeMargin();
break;
case VERTICALLY_FROM_TOP_RIGHT:
- x = work_area_.right() - kHorizontalEdgeMargin;
- y = work_area_.y() + kVerticalEdgeMargin;
+ x = work_area_.right() - HorizontalEdgeMargin();
+ y = work_area_.y() + VerticalEdgeMargin();
break;
case VERTICALLY_FROM_BOTTOM_RIGHT:
- x = work_area_.right() - kHorizontalEdgeMargin;
- y = work_area_.bottom() - kVerticalEdgeMargin;
+ x = work_area_.right() - HorizontalEdgeMargin();
+ y = work_area_.bottom() - VerticalEdgeMargin();
break;
default:
NOTREACHED();
@@ -187,11 +177,11 @@
x = position_iterator->x();
y = position_iterator->y() - balloon_size.height();
position_iterator->set_x(position_iterator->x() + balloon_size.width() +
- kInterBalloonMargin);
+ InterBalloonMargin());
break;
case HORIZONTALLY_FROM_BOTTOM_RIGHT:
position_iterator->set_x(position_iterator->x() - balloon_size.width() -
- kInterBalloonMargin);
+ InterBalloonMargin());
x = position_iterator->x();
y = position_iterator->y() - balloon_size.height();
break;
@@ -199,11 +189,11 @@
x = position_iterator->x() - balloon_size.width();
y = position_iterator->y();
position_iterator->set_y(position_iterator->y() + balloon_size.height() +
- kInterBalloonMargin);
+ InterBalloonMargin());
break;
case VERTICALLY_FROM_BOTTOM_RIGHT:
position_iterator->set_y(position_iterator->y() - balloon_size.height() -
- kInterBalloonMargin);
+ InterBalloonMargin());
x = position_iterator->x() - balloon_size.width();
y = position_iterator->y();
break;
« no previous file with comments | « chrome/browser/notifications/balloon_collection.h ('k') | chrome/browser/notifications/balloon_collection_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698