summaryrefslogtreecommitdiffstats
path: root/chrome/browser/notifications/balloon_collection_win.cc
diff options
context:
space:
mode:
authorjohnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-06 00:30:05 +0000
committerjohnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-06 00:30:05 +0000
commitb0b2a3dd01962592fc8c1f981415ab2bdb8edefb (patch)
tree6cbda13db92837ae9aadd32a9c4aa6c87aaaf38a /chrome/browser/notifications/balloon_collection_win.cc
parente5ce23e294561b52d35b72eb30c8f5ae869e0fe2 (diff)
downloadchromium_src-b0b2a3dd01962592fc8c1f981415ab2bdb8edefb.zip
chromium_src-b0b2a3dd01962592fc8c1f981415ab2bdb8edefb.tar.gz
chromium_src-b0b2a3dd01962592fc8c1f981415ab2bdb8edefb.tar.bz2
Allow the user to choose which corner of the screen should get notifications.
BUG=none TEST=create notifications, use the options menu Review URL: http://codereview.chromium.org/6006007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70564 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/notifications/balloon_collection_win.cc')
-rw-r--r--chrome/browser/notifications/balloon_collection_win.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/chrome/browser/notifications/balloon_collection_win.cc b/chrome/browser/notifications/balloon_collection_win.cc
index 07bcd18..742872b 100644
--- a/chrome/browser/notifications/balloon_collection_win.cc
+++ b/chrome/browser/notifications/balloon_collection_win.cc
@@ -62,6 +62,27 @@ bool BalloonCollectionImpl::IsCursorInBalloonCollection() const {
return bounds.Contains(cursor);
}
+void BalloonCollectionImpl::SetPositionPreference(
+ PositionPreference position) {
+ if (position == DEFAULT_POSITION)
+ position = LOWER_RIGHT;
+
+ // All positioning schemes are vertical, and windows
+ // uses the normal screen orientation.
+ if (position == UPPER_RIGHT)
+ layout_.set_placement(Layout::VERTICALLY_FROM_TOP_RIGHT);
+ else if (position == UPPER_LEFT)
+ layout_.set_placement(Layout::VERTICALLY_FROM_TOP_LEFT);
+ else if (position == LOWER_LEFT)
+ layout_.set_placement(Layout::VERTICALLY_FROM_BOTTOM_LEFT);
+ else if (position == LOWER_RIGHT)
+ layout_.set_placement(Layout::VERTICALLY_FROM_BOTTOM_RIGHT);
+ else
+ NOTREACHED();
+
+ PositionBalloons(true);
+}
+
// static
BalloonCollection* BalloonCollection::Create() {
return new BalloonCollectionImpl();