Chromium Code Reviews| 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..2dcc9aad661f7f3a134f7900b59876e4afbf6250 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; |
| + int GetPanelHeightBase() const; |
|
Dmitry Titov
2011/11/09 03:09:57
Not clear why "Base". Maybe GetPositionAbovePanels
jianli
2011/11/09 19:04:40
Renamed to ComputeOffsetsToMoveAbovePanels. Also c
|
| + |
| // Minimum and maximum size of balloon content. |
| static const int kBalloonMinWidth = 300; |
| static const int kBalloonMaxWidth = 300; |
| @@ -141,6 +151,12 @@ class BalloonCollectionImpl : public BalloonCollection |
| Placement placement_; |
| gfx::Rect work_area_; |
| + |
| + // The height of right-most panels we're currently using as a base to allign |
|
Dmitry Titov
2011/11/09 03:09:57
allign->align
jianli
2011/11/09 19:04:40
Removed with the comment change as suggested below
|
| + // those virtically-from-bottom-right balloons to prevent them from being |
|
Dmitry Titov
2011/11/09 03:09:57
virtically->vertically
May be change wording of th
jianli
2011/11/09 19:04:40
Done.
|
| + // overlapped with the panels. |
| + int panel_height_base_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(Layout); |
| }; |
| @@ -171,6 +187,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(); |