diff options
author | mukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-14 00:52:15 +0000 |
---|---|---|
committer | mukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-14 00:52:15 +0000 |
commit | fa48d1efa77618f56cc2c83c2b3fb42e8e942fae (patch) | |
tree | 24669861aea5853e9f3f53d76de968b1cc94d1ea | |
parent | 8f6727ec1eeae964e55902c9841b2cb6a329a979 (diff) | |
download | chromium_src-fa48d1efa77618f56cc2c83c2b3fb42e8e942fae.zip chromium_src-fa48d1efa77618f56cc2c83c2b3fb42e8e942fae.tar.gz chromium_src-fa48d1efa77618f56cc2c83c2b3fb42e8e942fae.tar.bz2 |
Notifies the resize of system tray to the web notification tray.
The system tray may be resized when it's visible, and the new height
should be notified to the web notification tray so that the notification
popups can avoid the tray of the new height.
BUG=291194
R=stevenjb@chromium.org
Review URL: https://chromiumcodereview.appspot.com/23444064
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223188 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | ash/system/tray/system_tray.cc | 4 | ||||
-rw-r--r-- | ash/system/tray/system_tray.h | 1 | ||||
-rw-r--r-- | ash/system/tray/tray_background_view.h | 3 | ||||
-rw-r--r-- | ash/system/tray/tray_bubble_wrapper.cc | 6 | ||||
-rw-r--r-- | ash/system/tray/tray_bubble_wrapper.h | 2 |
5 files changed, 16 insertions, 0 deletions
diff --git a/ash/system/tray/system_tray.cc b/ash/system/tray/system_tray.cc index e07a2d6..fa78257 100644 --- a/ash/system/tray/system_tray.cc +++ b/ash/system/tray/system_tray.cc @@ -587,6 +587,10 @@ base::string16 SystemTray::GetAccessibleNameForTray() { return l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_ACCESSIBLE_NAME); } +void SystemTray::BubbleResized(const TrayBubbleView* bubble_view) { + UpdateWebNotifications(); +} + void SystemTray::HideBubbleWithView(const TrayBubbleView* bubble_view) { if (system_bubble_.get() && bubble_view == system_bubble_->bubble_view()) { DestroySystemBubble(); diff --git a/ash/system/tray/system_tray.h b/ash/system/tray/system_tray.h index f6b47fe..8656f8b 100644 --- a/ash/system/tray/system_tray.h +++ b/ash/system/tray/system_tray.h @@ -138,6 +138,7 @@ class ASH_EXPORT SystemTray : public internal::TrayBackgroundView, virtual void SetShelfAlignment(ShelfAlignment alignment) OVERRIDE; virtual void AnchorUpdated() OVERRIDE; virtual base::string16 GetAccessibleNameForTray() OVERRIDE; + virtual void BubbleResized(const views::TrayBubbleView* bubble_view) OVERRIDE; virtual void HideBubbleWithView( const views::TrayBubbleView* bubble_view) OVERRIDE; virtual bool ClickedOutsideBubble() OVERRIDE; diff --git a/ash/system/tray/tray_background_view.h b/ash/system/tray/tray_background_view.h index 7b29495..b459684 100644 --- a/ash/system/tray/tray_background_view.h +++ b/ash/system/tray/tray_background_view.h @@ -89,6 +89,9 @@ class ASH_EXPORT TrayBackgroundView : public ActionableView, // Called from GetAccessibleState, must return a valid accessible name. virtual base::string16 GetAccessibleNameForTray() = 0; + // Called when the bubble is resized. + virtual void BubbleResized(const views::TrayBubbleView* bubble_view) {} + // Hides the bubble associated with |bubble_view|. Called when the widget // is closed. virtual void HideBubbleWithView(const views::TrayBubbleView* bubble_view) = 0; diff --git a/ash/system/tray/tray_bubble_wrapper.cc b/ash/system/tray/tray_bubble_wrapper.cc index 5d641ee..c5738e5 100644 --- a/ash/system/tray/tray_bubble_wrapper.cc +++ b/ash/system/tray/tray_bubble_wrapper.cc @@ -53,5 +53,11 @@ void TrayBubbleWrapper::OnWidgetDestroying(views::Widget* widget) { tray_->HideBubbleWithView(bubble_view_); // May destroy |bubble_view_| } +void TrayBubbleWrapper::OnWidgetBoundsChanged(views::Widget* widget, + const gfx::Rect& new_bounds) { + DCHECK_EQ(bubble_widget_, widget); + tray_->BubbleResized(bubble_view_); +} + } // namespace internal } // namespace ash diff --git a/ash/system/tray/tray_bubble_wrapper.h b/ash/system/tray/tray_bubble_wrapper.h index baa5416..9ce443a 100644 --- a/ash/system/tray/tray_bubble_wrapper.h +++ b/ash/system/tray/tray_bubble_wrapper.h @@ -29,6 +29,8 @@ class TrayBubbleWrapper : public views::WidgetObserver { // views::WidgetObserver overrides: virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE; + virtual void OnWidgetBoundsChanged(views::Widget* widget, + const gfx::Rect& new_bounds) OVERRIDE; const TrayBackgroundView* tray() const { return tray_; } TrayBackgroundView* tray() { return tray_; } |