diff options
author | mukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-14 16:08:58 +0000 |
---|---|---|
committer | mukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-14 16:08:58 +0000 |
commit | 8c64b8f42e04ba6db4d873995fa909dcdb580cf4 (patch) | |
tree | 69b625a610244b253575f0b8c780f1108e111443 /ash/system | |
parent | a26f18849df5873e0f46ab562ed91ee2b6cc2d25 (diff) | |
download | chromium_src-8c64b8f42e04ba6db4d873995fa909dcdb580cf4.zip chromium_src-8c64b8f42e04ba6db4d873995fa909dcdb580cf4.tar.gz chromium_src-8c64b8f42e04ba6db4d873995fa909dcdb580cf4.tar.bz2 |
Remove close_on_deactivate=false for tray bubbles (3rd)
Actually we want to close those bubbles on deactivation (like, opening
settings page or opening the chat window for a notification).
close_on_deactivate=true will close the bubble when mouse-pressed,
but the next mouse-released event on the tray_ will invoke
PerformAction method to reopen the bubble. To prevent this reopen,
the mouse capture of the tray has to be released.
BUG=177075,179992
Review URL: https://chromiumcodereview.appspot.com/12701021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188091 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/system')
-rw-r--r-- | ash/system/tray/system_tray.cc | 1 | ||||
-rw-r--r-- | ash/system/tray/tray_bubble_wrapper.cc | 11 | ||||
-rw-r--r-- | ash/system/web_notification/web_notification_tray.cc | 1 |
3 files changed, 11 insertions, 2 deletions
diff --git a/ash/system/tray/system_tray.cc b/ash/system/tray/system_tray.cc index 6962514..f82e808 100644 --- a/ash/system/tray/system_tray.cc +++ b/ash/system/tray/system_tray.cc @@ -364,7 +364,6 @@ void SystemTray::ShowItems(const std::vector<SystemTrayItem*>& items, kTrayPopupMinWidth, kTrayPopupMaxWidth); init_params.can_activate = can_activate; - init_params.close_on_deactivate = false; if (detailed) { // This is the case where a volume control or brightness control bubble // is created. diff --git a/ash/system/tray/tray_bubble_wrapper.cc b/ash/system/tray/tray_bubble_wrapper.cc index 9555b8a..17fdcbc 100644 --- a/ash/system/tray/tray_bubble_wrapper.cc +++ b/ash/system/tray/tray_bubble_wrapper.cc @@ -7,6 +7,8 @@ #include "ash/system/tray/tray_background_view.h" #include "ash/system/tray/tray_event_filter.h" #include "ash/wm/window_properties.h" +#include "ui/aura/client/capture_client.h" +#include "ui/aura/window.h" #include "ui/views/bubble/tray_bubble_view.h" #include "ui/views/widget/widget.h" @@ -41,6 +43,15 @@ void TrayBubbleWrapper::OnWidgetDestroying(views::Widget* widget) { CHECK_EQ(bubble_widget_, widget); bubble_widget_->RemoveObserver(this); bubble_widget_ = NULL; + + // Although the bubble is already closed, the next mouse release event + // will invoke PerformAction which reopens the bubble again. To prevent the + // reopen, the mouse capture of |tray_| has to be released. + // See crbug.com/177075 + aura::client::CaptureClient* capture_client = aura::client::GetCaptureClient( + tray_->GetWidget()->GetNativeView()->GetRootWindow()); + if (capture_client) + capture_client->ReleaseCapture(tray_->GetWidget()->GetNativeView()); tray_->HideBubbleWithView(bubble_view_); // May destroy |bubble_view_| } diff --git a/ash/system/web_notification/web_notification_tray.cc b/ash/system/web_notification/web_notification_tray.cc index 1b2763a..395d58c 100644 --- a/ash/system/web_notification/web_notification_tray.cc +++ b/ash/system/web_notification/web_notification_tray.cc @@ -61,7 +61,6 @@ class WebNotificationBubbleWrapper { tray->GetAnchorAlignment(); views::TrayBubbleView::InitParams init_params = bubble->GetInitParams(anchor_alignment); - init_params.close_on_deactivate = false; views::View* anchor = tray->tray_container(); if (anchor_alignment == views::TrayBubbleView::ANCHOR_ALIGNMENT_BOTTOM) { gfx::Point bounds(anchor->width() / 2, 0); |