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 a5713b60232672cbaeed5aef2c1d4faa43fa0270..7c5a3d8d90fd05517172cd00e428240f29e60332 100644 |
| --- a/ash/system/web_notification/web_notification_tray.cc |
| +++ b/ash/system/web_notification/web_notification_tray.cc |
| @@ -20,7 +20,6 @@ |
| #include "ash/system/tray/tray_container.h" |
| #include "ash/system/tray/tray_utils.h" |
| #include "ash/system/web_notification/ash_popup_alignment_delegate.h" |
| -#include "ash/wm_window.h" |
| #include "base/auto_reset.h" |
| #include "base/i18n/number_formatting.h" |
| #include "base/i18n/rtl.h" |
| @@ -267,7 +266,7 @@ class WebNotificationLabel : public WebNotificationItem { |
| }; |
| WebNotificationTray::WebNotificationTray(WmShelf* shelf, |
| - WmWindow* status_area_window, |
| + aura::Window* status_area_window, |
| SystemTray* system_tray) |
| : TrayBackgroundView(shelf), |
| status_area_window_(status_area_window), |
| @@ -294,10 +293,9 @@ WebNotificationTray::WebNotificationTray(WmShelf* shelf, |
| popup_collection_.reset(new message_center::MessagePopupCollection( |
| message_center(), message_center_tray_.get(), |
| popup_alignment_delegate_.get())); |
| - const display::Display& display = |
| - status_area_window_->GetDisplayNearestWindow(); |
| - popup_alignment_delegate_->StartObserving(display::Screen::GetScreen(), |
| - display); |
| + display::Screen* screen = display::Screen::GetScreen(); |
| + popup_alignment_delegate_->StartObserving( |
| + screen, screen->GetDisplayNearestWindow(status_area_window_)); |
| OnMessageCenterTrayChanged(); |
| tray_container()->SetMargin(kTrayMainAxisInset, kTrayCrossAxisInset); |
| @@ -339,9 +337,7 @@ bool WebNotificationTray::ShowMessageCenterInternal(bool show_settings) { |
| // horizontal (i.e. bottom) shelves, anchor to the system tray. |
| TrayBackgroundView* anchor_tray = this; |
| if (shelf()->IsHorizontalAlignment()) { |
|
msw
2017/05/15 22:50:10
nit: curlies not needed
James Cook
2017/05/16 00:24:27
Done.
|
| - anchor_tray = WmShelf::ForWindow(status_area_window_) |
| - ->GetStatusAreaWidget() |
| - ->system_tray(); |
| + anchor_tray = system_tray_; |
| } |
| message_center_bubble_.reset(new WebNotificationBubbleWrapper( |
| @@ -463,8 +459,7 @@ void WebNotificationTray::OnBeforeBubbleWidgetInit( |
| views::Widget* bubble_widget, |
| views::Widget::InitParams* params) const { |
| // Place the bubble in the same root window as |anchor_widget|. |
| - WmWindow::Get(anchor_widget->GetNativeWindow()) |
| - ->GetRootWindowController() |
| + RootWindowController::ForWindow(anchor_widget->GetNativeWindow()) |
| ->ConfigureWidgetInitParamsForContainer( |
| bubble_widget, kShellWindowId_SettingBubbleContainer, params); |
| } |