Index: components/exo/wm_helper_ash.cc |
diff --git a/components/exo/wm_helper_ash.cc b/components/exo/wm_helper_ash.cc |
index 2b524f9a1a2f4a84ffa76d8ae542d9a065aa2551..9998ae6634a6979ba645ef8398d41b05989d89df 100644 |
--- a/components/exo/wm_helper_ash.cc |
+++ b/components/exo/wm_helper_ash.cc |
@@ -6,8 +6,10 @@ |
#include "ash/accessibility_delegate.h" |
#include "ash/public/cpp/config.h" |
+#include "ash/root_window_controller.h" |
#include "ash/shell.h" |
#include "ash/system/tray/system_tray_notifier.h" |
+#include "ash/wm/ash_native_cursor_manager.h" |
#include "ash/wm/maximize_mode/maximize_mode_controller.h" |
#include "ash/wm_shell.h" |
#include "base/memory/singleton.h" |
@@ -25,8 +27,10 @@ WMHelperAsh::WMHelperAsh() { |
ash::Shell::Get()->AddShellObserver(this); |
ash::Shell::Get()->activation_client()->AddObserver(this); |
// TODO(crbug.com/631103): Mushrome doesn't have a cursor manager yet. |
- if (ash::WmShell::Get()->GetAshConfig() != ash::Config::MUS) |
+ if (ash::WmShell::Get()->GetAshConfig() != ash::Config::MUS) { |
ash::Shell::Get()->cursor_manager()->AddObserver(this); |
+ ash::Shell::Get()->native_cursor_manager()->AddObserver(this); |
+ } |
ash::WmShell::Get()->AddDisplayObserver(this); |
aura::client::FocusClient* focus_client = |
aura::client::GetFocusClient(ash::Shell::GetPrimaryRootWindow()); |
@@ -45,8 +49,10 @@ WMHelperAsh::~WMHelperAsh() { |
focus_client->RemoveObserver(this); |
ash::WmShell::Get()->RemoveDisplayObserver(this); |
// TODO(crbug.com/631103): Mushrome doesn't have a cursor manager yet. |
- if (ash::WmShell::Get()->GetAshConfig() != ash::Config::MUS) |
+ if (ash::WmShell::Get()->GetAshConfig() != ash::Config::MUS) { |
ash::Shell::Get()->cursor_manager()->RemoveObserver(this); |
+ ash::Shell::Get()->native_cursor_manager()->RemoveObserver(this); |
+ } |
ash::Shell::Get()->activation_client()->RemoveObserver(this); |
ash::Shell::Get()->RemoveShellObserver(this); |
// TODO(crbug.com/709225): Mushrome doesn't have a DeviceDataManager. |
@@ -63,9 +69,13 @@ const display::ManagedDisplayInfo WMHelperAsh::GetDisplayInfo( |
return ash::Shell::Get()->display_manager()->GetDisplayInfo(display_id); |
} |
-aura::Window* WMHelperAsh::GetContainer(int container_id) { |
- return ash::Shell::GetContainer(ash::Shell::GetRootWindowForNewWindows(), |
- container_id); |
+aura::Window* WMHelperAsh::GetContainer(int64_t display_id, int container_id) { |
+ ash::RootWindowController* controller = |
+ ash::Shell::GetRootWindowControllerWithDisplayId(display_id); |
+ return ash::Shell::GetContainer( |
+ controller ? controller->GetRootWindow() |
reveman
2017/04/10 21:47:13
when is controller null?
Dominik Laskowski
2017/04/11 04:42:55
When a display with |display_id| does not exist.
reveman
2017/04/11 19:25:13
and why does it need to be valid behavior to call
Dominik Laskowski
2017/04/11 20:40:37
To retain the old behavior as an option, but YAGNI
|
+ : ash::Shell::GetRootWindowForNewWindows(), |
+ container_id); |
} |
aura::Window* WMHelperAsh::GetActiveWindow() const { |
@@ -139,6 +149,10 @@ void WMHelperAsh::OnCursorSetChanged(ui::CursorSetType cursor_set) { |
NotifyCursorSetChanged(cursor_set); |
} |
+void WMHelperAsh::OnCursorDisplayChanging(const display::Display& display) { |
+ NotifyCursorDisplayChanging(display); |
+} |
+ |
void WMHelperAsh::OnAccessibilityModeChanged( |
ash::AccessibilityNotificationVisibility notify) { |
NotifyAccessibilityModeChanged(); |