| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/exo/wm_helper_ash.h" | 5 #include "components/exo/wm_helper_ash.h" |
| 6 | 6 |
| 7 #include "ash/public/cpp/config.h" | 7 #include "ash/public/cpp/config.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/shell_port.h" | 9 #include "ash/shell_port.h" |
| 10 #include "ash/system/tray/system_tray_notifier.h" | 10 #include "ash/system/tray/system_tray_notifier.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 if (ash::ShellPort::Get()->GetAshConfig() != ash::Config::MUS) | 44 if (ash::ShellPort::Get()->GetAshConfig() != ash::Config::MUS) |
| 45 ash::Shell::Get()->cursor_manager()->RemoveObserver(this); | 45 ash::Shell::Get()->cursor_manager()->RemoveObserver(this); |
| 46 ash::Shell::Get()->activation_client()->RemoveObserver(this); | 46 ash::Shell::Get()->activation_client()->RemoveObserver(this); |
| 47 ash::Shell::Get()->RemoveShellObserver(this); | 47 ash::Shell::Get()->RemoveShellObserver(this); |
| 48 ui::InputDeviceManager::GetInstance()->RemoveObserver(this); | 48 ui::InputDeviceManager::GetInstance()->RemoveObserver(this); |
| 49 } | 49 } |
| 50 | 50 |
| 51 //////////////////////////////////////////////////////////////////////////////// | 51 //////////////////////////////////////////////////////////////////////////////// |
| 52 // WMHelperAsh, private: | 52 // WMHelperAsh, private: |
| 53 | 53 |
| 54 const display::ManagedDisplayInfo WMHelperAsh::GetDisplayInfo( | 54 const display::ManagedDisplayInfo& WMHelperAsh::GetDisplayInfo( |
| 55 int64_t display_id) const { | 55 int64_t display_id) const { |
| 56 return ash::Shell::Get()->display_manager()->GetDisplayInfo(display_id); | 56 return ash::Shell::Get()->display_manager()->GetDisplayInfo(display_id); |
| 57 } | 57 } |
| 58 | 58 |
| 59 aura::Window* WMHelperAsh::GetContainer(int container_id) { | 59 aura::Window* WMHelperAsh::GetPrimaryDisplayContainer(int container_id) { |
| 60 // TODO(domlaskowski): Use target root window once multi-display support lands | |
| 61 // in ARC. See crbug.com/718627. | |
| 62 return ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), | 60 return ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), |
| 63 container_id); | 61 container_id); |
| 64 } | 62 } |
| 65 | 63 |
| 66 aura::Window* WMHelperAsh::GetActiveWindow() const { | 64 aura::Window* WMHelperAsh::GetActiveWindow() const { |
| 67 return ash::Shell::Get()->activation_client()->GetActiveWindow(); | 65 return ash::Shell::Get()->activation_client()->GetActiveWindow(); |
| 68 } | 66 } |
| 69 | 67 |
| 70 aura::Window* WMHelperAsh::GetFocusedWindow() const { | 68 aura::Window* WMHelperAsh::GetFocusedWindow() const { |
| 71 aura::client::FocusClient* focus_client = | 69 aura::client::FocusClient* focus_client = |
| 72 aura::client::GetFocusClient(ash::Shell::GetPrimaryRootWindow()); | 70 aura::client::GetFocusClient(ash::Shell::GetPrimaryRootWindow()); |
| 73 return focus_client->GetFocusedWindow(); | 71 return focus_client->GetFocusedWindow(); |
| 74 } | 72 } |
| 75 | 73 |
| 76 ui::CursorSetType WMHelperAsh::GetCursorSet() const { | 74 ui::CursorSetType WMHelperAsh::GetCursorSet() const { |
| 77 // TODO(crbug.com/631103): Mushrome doesn't have a cursor manager yet. | 75 // TODO(crbug.com/631103): Mushrome doesn't have a cursor manager yet. |
| 78 if (ash::ShellPort::Get()->GetAshConfig() == ash::Config::MUS) | 76 if (ash::ShellPort::Get()->GetAshConfig() == ash::Config::MUS) |
| 79 return ui::CURSOR_SET_NORMAL; | 77 return ui::CURSOR_SET_NORMAL; |
| 80 return ash::Shell::Get()->cursor_manager()->GetCursorSet(); | 78 return ash::Shell::Get()->cursor_manager()->GetCursorSet(); |
| 81 } | 79 } |
| 82 | 80 |
| 81 const display::Display& WMHelperAsh::GetCursorDisplay() const { |
| 82 // TODO(crbug.com/631103): Mushrome doesn't have a cursor manager yet. |
| 83 if (ash::ShellPort::Get()->GetAshConfig() == ash::Config::MUS) { |
| 84 static const display::Display display; |
| 85 return display; |
| 86 } |
| 87 return ash::Shell::Get()->cursor_manager()->GetDisplay(); |
| 88 } |
| 89 |
| 83 void WMHelperAsh::AddPreTargetHandler(ui::EventHandler* handler) { | 90 void WMHelperAsh::AddPreTargetHandler(ui::EventHandler* handler) { |
| 84 ash::Shell::Get()->AddPreTargetHandler(handler); | 91 ash::Shell::Get()->AddPreTargetHandler(handler); |
| 85 } | 92 } |
| 86 | 93 |
| 87 void WMHelperAsh::PrependPreTargetHandler(ui::EventHandler* handler) { | 94 void WMHelperAsh::PrependPreTargetHandler(ui::EventHandler* handler) { |
| 88 ash::Shell::Get()->PrependPreTargetHandler(handler); | 95 ash::Shell::Get()->PrependPreTargetHandler(handler); |
| 89 } | 96 } |
| 90 | 97 |
| 91 void WMHelperAsh::RemovePreTargetHandler(ui::EventHandler* handler) { | 98 void WMHelperAsh::RemovePreTargetHandler(ui::EventHandler* handler) { |
| 92 ash::Shell::Get()->RemovePreTargetHandler(handler); | 99 ash::Shell::Get()->RemovePreTargetHandler(handler); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 119 } | 126 } |
| 120 | 127 |
| 121 void WMHelperAsh::OnCursorVisibilityChanged(bool is_visible) { | 128 void WMHelperAsh::OnCursorVisibilityChanged(bool is_visible) { |
| 122 NotifyCursorVisibilityChanged(is_visible); | 129 NotifyCursorVisibilityChanged(is_visible); |
| 123 } | 130 } |
| 124 | 131 |
| 125 void WMHelperAsh::OnCursorSetChanged(ui::CursorSetType cursor_set) { | 132 void WMHelperAsh::OnCursorSetChanged(ui::CursorSetType cursor_set) { |
| 126 NotifyCursorSetChanged(cursor_set); | 133 NotifyCursorSetChanged(cursor_set); |
| 127 } | 134 } |
| 128 | 135 |
| 136 void WMHelperAsh::OnCursorDisplayChanged(const display::Display& display) { |
| 137 NotifyCursorDisplayChanged(display); |
| 138 } |
| 139 |
| 129 void WMHelperAsh::OnMaximizeModeStarted() { | 140 void WMHelperAsh::OnMaximizeModeStarted() { |
| 130 NotifyMaximizeModeStarted(); | 141 NotifyMaximizeModeStarted(); |
| 131 } | 142 } |
| 132 | 143 |
| 133 void WMHelperAsh::OnMaximizeModeEnding() { | 144 void WMHelperAsh::OnMaximizeModeEnding() { |
| 134 NotifyMaximizeModeEnding(); | 145 NotifyMaximizeModeEnding(); |
| 135 } | 146 } |
| 136 | 147 |
| 137 void WMHelperAsh::OnMaximizeModeEnded() { | 148 void WMHelperAsh::OnMaximizeModeEnded() { |
| 138 NotifyMaximizeModeEnded(); | 149 NotifyMaximizeModeEnded(); |
| 139 } | 150 } |
| 140 | 151 |
| 141 void WMHelperAsh::OnDisplayConfigurationChanged() { | 152 void WMHelperAsh::OnDisplayConfigurationChanged() { |
| 142 NotifyDisplayConfigurationChanged(); | 153 NotifyDisplayConfigurationChanged(); |
| 143 } | 154 } |
| 144 | 155 |
| 145 void WMHelperAsh::OnKeyboardDeviceConfigurationChanged() { | 156 void WMHelperAsh::OnKeyboardDeviceConfigurationChanged() { |
| 146 NotifyKeyboardDeviceConfigurationChanged(); | 157 NotifyKeyboardDeviceConfigurationChanged(); |
| 147 } | 158 } |
| 148 | 159 |
| 149 } // namespace exo | 160 } // namespace exo |
| OLD | NEW |