| Index: chrome/browser/notifications/balloon_collection_impl.h
|
| diff --git a/chrome/browser/notifications/balloon_collection_impl.h b/chrome/browser/notifications/balloon_collection_impl.h
|
| index 887d1f27ddd615d645b2cecad7817039fea837b5..c242a69327dadf3f627456594eb127982a0102df 100644
|
| --- a/chrome/browser/notifications/balloon_collection_impl.h
|
| +++ b/chrome/browser/notifications/balloon_collection_impl.h
|
| @@ -16,6 +16,8 @@
|
| #include "base/message_loop.h"
|
| #include "chrome/browser/notifications/balloon_collection.h"
|
| #include "chrome/browser/notifications/balloon_collection_base.h"
|
| +#include "content/public/browser/notification_observer.h"
|
| +#include "content/public/browser/notification_registrar.h"
|
| #include "ui/gfx/point.h"
|
| #include "ui/gfx/rect.h"
|
|
|
| @@ -32,7 +34,8 @@
|
| // shown on the screen. It positions new notifications according to
|
| // a layout, and monitors for balloons being closed, which it reports
|
| // up to its parent, the notification UI manager.
|
| -class BalloonCollectionImpl : public BalloonCollection
|
| +class BalloonCollectionImpl : public BalloonCollection,
|
| + public content::NotificationObserver
|
| #if USE_OFFSETS
|
| , public MessageLoopForUI::Observer
|
| #endif
|
| @@ -54,6 +57,11 @@ class BalloonCollectionImpl : public BalloonCollection
|
| virtual void OnBalloonClosed(Balloon* source);
|
| virtual const Balloons& GetActiveBalloons();
|
|
|
| + // content::NotificationObserver interface.
|
| + virtual void Observe(int type,
|
| + const content::NotificationSource& source,
|
| + const content::NotificationDetails& details) OVERRIDE;
|
| +
|
| // MessageLoopForUI::Observer interface.
|
| #if defined(OS_WIN) || defined(TOUCH_UI) || defined(USE_AURA)
|
| virtual base::EventStatus WillProcessEvent(
|
| @@ -133,6 +141,8 @@ class BalloonCollectionImpl : public BalloonCollection
|
| int HorizontalEdgeMargin() const;
|
| int InterBalloonMargin() const;
|
|
|
| + void ComputeOffsetsToMoveAbovePanels();
|
| +
|
| // Minimum and maximum size of balloon content.
|
| static const int kBalloonMinWidth = 300;
|
| static const int kBalloonMaxWidth = 300;
|
| @@ -141,6 +151,13 @@ class BalloonCollectionImpl : public BalloonCollection
|
|
|
| Placement placement_;
|
| gfx::Rect work_area_;
|
| +
|
| + // The offsets that guarantees that the notificaitons shown in the
|
| + // bottom-right or bottom-left corner of the screen will go above currently
|
| + // shown panels and will not be obscured by them.
|
| + int bottom_left_offset_to_move_above_panels_;
|
| + int bottom_right_offset_to_move_above_panels_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(Layout);
|
| };
|
|
|
| @@ -171,6 +188,8 @@ class BalloonCollectionImpl : public BalloonCollection
|
| // The layout parameters for balloons in this collection.
|
| Layout layout_;
|
|
|
| + content::NotificationRegistrar registrar_;
|
| +
|
| #if USE_OFFSETS
|
| // Start and stop observing all UI events.
|
| void AddMessageLoopObserver();
|
|
|