| Index: components/exo/wm_helper_ash.cc
|
| diff --git a/components/exo/wm_helper_ash.cc b/components/exo/wm_helper_ash.cc
|
| index e4b96bfd6ba09d42d6235e93ed9f3eceea341209..1b32672b68adbd92ad03e4414312ff83d7a56ac2 100644
|
| --- a/components/exo/wm_helper_ash.cc
|
| +++ b/components/exo/wm_helper_ash.cc
|
| @@ -5,9 +5,11 @@
|
| #include "components/exo/wm_helper_ash.h"
|
|
|
| #include "ash/public/cpp/config.h"
|
| +#include "ash/root_window_controller.h"
|
| #include "ash/shell.h"
|
| #include "ash/shell_port.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 "base/memory/singleton.h"
|
| #include "ui/aura/client/focus_client.h"
|
| @@ -24,8 +26,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::ShellPort::Get()->GetAshConfig() != ash::Config::MUS)
|
| + if (ash::ShellPort::Get()->GetAshConfig() != ash::Config::MUS) {
|
| ash::Shell::Get()->cursor_manager()->AddObserver(this);
|
| + ash::Shell::Get()->native_cursor_manager()->AddObserver(this);
|
| + }
|
| ash::ShellPort::Get()->AddDisplayObserver(this);
|
| aura::client::FocusClient* focus_client =
|
| aura::client::GetFocusClient(ash::Shell::GetPrimaryRootWindow());
|
| @@ -41,8 +45,10 @@ WMHelperAsh::~WMHelperAsh() {
|
| focus_client->RemoveObserver(this);
|
| ash::ShellPort::Get()->RemoveDisplayObserver(this);
|
| // TODO(crbug.com/631103): Mushrome doesn't have a cursor manager yet.
|
| - if (ash::ShellPort::Get()->GetAshConfig() != ash::Config::MUS)
|
| + if (ash::ShellPort::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);
|
| ui::InputDeviceManager::GetInstance()->RemoveObserver(this);
|
| @@ -51,16 +57,17 @@ WMHelperAsh::~WMHelperAsh() {
|
| ////////////////////////////////////////////////////////////////////////////////
|
| // WMHelperAsh, private:
|
|
|
| -const display::ManagedDisplayInfo WMHelperAsh::GetDisplayInfo(
|
| +const display::ManagedDisplayInfo& WMHelperAsh::GetDisplayInfo(
|
| int64_t display_id) const {
|
| return ash::Shell::Get()->display_manager()->GetDisplayInfo(display_id);
|
| }
|
|
|
| -aura::Window* WMHelperAsh::GetContainer(int container_id) {
|
| - // TODO(domlaskowski): Use target root window once multi-display support lands
|
| - // in ARC. See crbug.com/718627.
|
| - return ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(),
|
| - container_id);
|
| +aura::Window* WMHelperAsh::GetContainer(int64_t display_id, int container_id) {
|
| + ash::RootWindowController* controller =
|
| + ash::Shell::GetRootWindowControllerWithDisplayId(display_id);
|
| + if (!controller)
|
| + return nullptr;
|
| + return ash::Shell::GetContainer(controller->GetRootWindow(), container_id);
|
| }
|
|
|
| aura::Window* WMHelperAsh::GetActiveWindow() const {
|
| @@ -80,6 +87,15 @@ ui::CursorSetType WMHelperAsh::GetCursorSet() const {
|
| return ash::Shell::Get()->cursor_manager()->GetCursorSet();
|
| }
|
|
|
| +const display::Display& WMHelperAsh::GetCursorDisplay() const {
|
| + // TODO(crbug.com/631103): Mushrome doesn't have a cursor manager yet.
|
| + if (ash::ShellPort::Get()->GetAshConfig() == ash::Config::MUS) {
|
| + static const display::Display display;
|
| + return display;
|
| + }
|
| + return ash::Shell::Get()->native_cursor_manager()->cursor_display();
|
| +}
|
| +
|
| void WMHelperAsh::AddPreTargetHandler(ui::EventHandler* handler) {
|
| ash::Shell::Get()->AddPreTargetHandler(handler);
|
| }
|
| @@ -126,6 +142,10 @@ void WMHelperAsh::OnCursorSetChanged(ui::CursorSetType cursor_set) {
|
| NotifyCursorSetChanged(cursor_set);
|
| }
|
|
|
| +void WMHelperAsh::OnCursorDisplayChanged(const display::Display& display) {
|
| + NotifyCursorDisplayChanged(display);
|
| +}
|
| +
|
| void WMHelperAsh::OnMaximizeModeStarted() {
|
| NotifyMaximizeModeStarted();
|
| }
|
|
|