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

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

Issue 8021009: Consolidate message observer API for win and aura (and touch). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed msw's comments Created 9 years, 3 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
diff --git a/chrome/browser/notifications/balloon_collection_linux.cc b/chrome/browser/notifications/balloon_collection_linux.cc
deleted file mode 100644
index 0255ae839faea607ff0d5ac29365da1b84ccb308..0000000000000000000000000000000000000000
--- a/chrome/browser/notifications/balloon_collection_linux.cc
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/notifications/balloon_collection_impl.h"
-
-#include "chrome/browser/notifications/balloon.h"
-#include "ui/gfx/size.h"
-
-#if defined(TOOLKIT_VIEWS)
-#include "chrome/browser/ui/views/notifications/balloon_view.h"
-#else
-#include "chrome/browser/ui/gtk/notifications/balloon_view_gtk.h"
-#endif
-
-Balloon* BalloonCollectionImpl::MakeBalloon(const Notification& notification,
- Profile* profile) {
- Balloon* balloon = new Balloon(notification, profile, this);
-
- balloon->set_view(new BalloonViewImpl(this));
- gfx::Size size(layout_.min_balloon_width(), layout_.min_balloon_height());
- balloon->set_content_size(size);
- return balloon;
-}
-
-int BalloonCollectionImpl::Layout::InterBalloonMargin() const {
- return 5;
-}
-
-int BalloonCollectionImpl::Layout::HorizontalEdgeMargin() const {
- return 5;
-}
-
-int BalloonCollectionImpl::Layout::VerticalEdgeMargin() const {
- return 5;
-}
-
-void BalloonCollectionImpl::PositionBalloons(bool reposition) {
- PositionBalloonsInternal(reposition);
-}
-
-void BalloonCollectionImpl::DidProcessEvent(GdkEvent* event) {
- switch (event->type) {
- case GDK_MOTION_NOTIFY:
- case GDK_LEAVE_NOTIFY:
- HandleMouseMoveEvent();
- break;
- default:
- break;
- }
-}
-
-bool BalloonCollectionImpl::IsCursorInBalloonCollection() const {
- 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 GetBalloonsBoundingBox().Contains(cursor);
-}
-
-void BalloonCollectionImpl::SetPositionPreference(
- PositionPreference position) {
- if (position == DEFAULT_POSITION)
- position = LOWER_RIGHT;
-
- // All positioning schemes are vertical, and linux
- // 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();
-}

Powered by Google App Engine
This is Rietveld 408576698