Chromium Code Reviews| Index: ash/system/web_notification/web_notification_tray.cc |
| diff --git a/ash/system/web_notification/web_notification_tray.cc b/ash/system/web_notification/web_notification_tray.cc |
| index 9f300f4eef8c1706da7edb325602ef50d2762a59..208187b9972a67c591f93046e8c98e7aa87d3065 100644 |
| --- a/ash/system/web_notification/web_notification_tray.cc |
| +++ b/ash/system/web_notification/web_notification_tray.cc |
| @@ -10,6 +10,7 @@ |
| #include "ash/common/shelf/shelf_constants.h" |
| #include "ash/common/shelf/wm_shelf.h" |
| #include "ash/common/shelf/wm_shelf_util.h" |
| +#include "ash/common/shell_window_ids.h" |
| #include "ash/common/system/tray/tray_constants.h" |
| #include "ash/common/system/tray/tray_utils.h" |
| #include "ash/common/wm_lookup.h" |
| @@ -94,8 +95,11 @@ class WebNotificationBubbleWrapper { |
| views::View::ConvertPointToWidget(anchor, &bounds); |
| init_params.arrow_offset = bounds.x(); |
| } |
| - views::TrayBubbleView* bubble_view = views::TrayBubbleView::Create( |
| - tray->GetBubbleWindowContainer(), anchor, tray, &init_params); |
| + DCHECK(anchor); |
| + // TrayBubbleView uses |anchor| and |tray| to determine the parent |
| + // container. See WebNotificationTray::OnBeforeBubbleWidgetInit(). |
| + views::TrayBubbleView* bubble_view = |
| + views::TrayBubbleView::Create(anchor, tray, &init_params); |
| bubble_wrapper_.reset(new TrayBubbleWrapper(tray, bubble_view)); |
| bubble_view->SetArrowPaintType(views::BubbleBorder::PAINT_NONE); |
| bubble->InitializeContents(bubble_view); |
| @@ -407,6 +411,18 @@ gfx::Rect WebNotificationTray::GetAnchorRect( |
| return GetBubbleAnchorRect(anchor_widget, anchor_type, anchor_alignment); |
| } |
| +void WebNotificationTray::OnBeforeBubbleWidgetInit( |
| + views::Widget* anchor_widget, |
| + views::Widget* bubble_widget, |
| + views::Widget::InitParams* params) const { |
| + // Place the bubble in the same root window as |anchor_widget|. |
| + WmLookup::Get() |
|
James Cook
2016/06/22 21:01:27
This duplicates the code in system_tray.cc, but I
msw
2016/06/22 23:00:23
I don't have a strong opinion; hopefully there are
|
| + ->GetWindowForWidget(anchor_widget) |
| + ->GetRootWindowController() |
| + ->ConfigureWidgetInitParamsForContainer( |
| + bubble_widget, kShellWindowId_SettingBubbleContainer, params); |
| +} |
| + |
| void WebNotificationTray::HideBubble(const views::TrayBubbleView* bubble_view) { |
| HideBubbleWithView(bubble_view); |
| } |