Chromium Code Reviews| Index: ash/system/tray/system_tray_bubble.cc |
| diff --git a/ash/system/tray/system_tray_bubble.cc b/ash/system/tray/system_tray_bubble.cc |
| index a9036cd1f38f54ae8da0b00ec2e810c5197663a7..0c4b8e235880c519143bc406ee27356db8eef2e9 100644 |
| --- a/ash/system/tray/system_tray_bubble.cc |
| +++ b/ash/system/tray/system_tray_bubble.cc |
| @@ -89,6 +89,28 @@ class CloseBubbleObserver : public ui::ImplicitAnimationObserver { |
| DISALLOW_COPY_AND_ASSIGN(CloseBubbleObserver); |
| }; |
| +class SystemTrayBubbleView : public TrayBubbleView { |
|
sammiequon
2017/06/30 17:46:02
I feel it makes more sense to move the bubble rela
xdai1
2017/06/30 17:51:01
I have the same feeling too. But I also understand
minch1
2017/06/30 19:08:04
Let's keep it as-is to let owner take a look. Than
|
| + public: |
| + SystemTrayBubbleView(TrayBubbleView::InitParams* init_params, |
| + SystemTray* tray) |
| + : TrayBubbleView(*init_params), tray_(tray) {} |
| + |
| + void OnGestureEvent(ui::GestureEvent* event) override { |
|
sammiequon
2017/06/30 17:46:02
nit: // views::View:
minch1
2017/06/30 19:08:04
Done.
|
| + if (tray_) { |
| + tray_->set_target_view(this); |
| + if (tray_->ProcessGestureEvent(*event)) |
| + event->SetHandled(); |
| + } else { |
| + TrayBubbleView::OnGestureEvent(event); |
| + } |
| + } |
| + |
| + private: |
| + SystemTray* tray_; |
|
sammiequon
2017/06/30 17:46:02
nit: // Not owned.
minch1
2017/06/30 19:08:04
Done.
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(SystemTrayBubbleView); |
| +}; |
| + |
| // SystemTrayBubble |
| SystemTrayBubble::SystemTrayBubble( |
| @@ -243,7 +265,7 @@ void SystemTrayBubble::InitView(views::View* anchor, |
| } |
| init_params->anchor_view = anchor; |
| - bubble_view_ = new TrayBubbleView(*init_params); |
| + bubble_view_ = new SystemTrayBubbleView(init_params, tray_); |
| UpdateBottomPadding(); |
| bubble_view_->set_adjust_if_offscreen(false); |
| CreateItemViews(login_status); |