| 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/common/accessibility_delegate.h" | 7 #include "ash/common/accessibility_delegate.h" |
| 8 #include "ash/common/system/tray/system_tray_notifier.h" | 8 #include "ash/common/system/tray/system_tray_notifier.h" |
| 9 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 9 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
| 10 #include "ash/common/wm_shell.h" | |
| 11 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| 12 #include "base/memory/singleton.h" | 11 #include "base/memory/singleton.h" |
| 13 #include "ui/aura/client/focus_client.h" | 12 #include "ui/aura/client/focus_client.h" |
| 14 #include "ui/display/manager/display_manager.h" | 13 #include "ui/display/manager/display_manager.h" |
| 15 #include "ui/events/devices/device_data_manager.h" | 14 #include "ui/events/devices/device_data_manager.h" |
| 16 #include "ui/wm/public/activation_client.h" | 15 #include "ui/wm/public/activation_client.h" |
| 17 | 16 |
| 18 namespace exo { | 17 namespace exo { |
| 19 | 18 |
| 20 //////////////////////////////////////////////////////////////////////////////// | 19 //////////////////////////////////////////////////////////////////////////////// |
| 21 // WMHelperAsh, public: | 20 // WMHelperAsh, public: |
| 22 | 21 |
| 23 WMHelperAsh::WMHelperAsh() { | 22 WMHelperAsh::WMHelperAsh() { |
| 24 ash::Shell::GetInstance()->AddShellObserver(this); | 23 ash::Shell::GetInstance()->AddShellObserver(this); |
| 25 ash::Shell::GetInstance()->activation_client()->AddObserver(this); | 24 ash::Shell::GetInstance()->activation_client()->AddObserver(this); |
| 26 ash::Shell::GetInstance()->window_tree_host_manager()->AddObserver(this); | 25 ash::Shell::GetInstance()->window_tree_host_manager()->AddObserver(this); |
| 27 aura::client::FocusClient* focus_client = | 26 aura::client::FocusClient* focus_client = |
| 28 aura::client::GetFocusClient(ash::Shell::GetPrimaryRootWindow()); | 27 aura::client::GetFocusClient(ash::Shell::GetPrimaryRootWindow()); |
| 29 focus_client->AddObserver(this); | 28 focus_client->AddObserver(this); |
| 30 ui::DeviceDataManager::GetInstance()->AddObserver(this); | 29 ui::DeviceDataManager::GetInstance()->AddObserver(this); |
| 31 ash::WmShell::Get()->system_tray_notifier()->AddAccessibilityObserver(this); | 30 ash::Shell::Get()->system_tray_notifier()->AddAccessibilityObserver(this); |
| 32 } | 31 } |
| 33 | 32 |
| 34 WMHelperAsh::~WMHelperAsh() { | 33 WMHelperAsh::~WMHelperAsh() { |
| 35 if (!ash::Shell::HasInstance()) | 34 if (!ash::Shell::HasInstance()) |
| 36 return; | 35 return; |
| 37 aura::client::FocusClient* focus_client = | 36 aura::client::FocusClient* focus_client = |
| 38 aura::client::GetFocusClient(ash::Shell::GetPrimaryRootWindow()); | 37 aura::client::GetFocusClient(ash::Shell::GetPrimaryRootWindow()); |
| 39 focus_client->RemoveObserver(this); | 38 focus_client->RemoveObserver(this); |
| 40 ash::Shell::GetInstance()->window_tree_host_manager()->RemoveObserver(this); | 39 ash::Shell::GetInstance()->window_tree_host_manager()->RemoveObserver(this); |
| 41 ash::Shell::GetInstance()->activation_client()->RemoveObserver(this); | 40 ash::Shell::GetInstance()->activation_client()->RemoveObserver(this); |
| 42 ash::Shell::GetInstance()->RemoveShellObserver(this); | 41 ash::Shell::GetInstance()->RemoveShellObserver(this); |
| 43 ui::DeviceDataManager::GetInstance()->RemoveObserver(this); | 42 ui::DeviceDataManager::GetInstance()->RemoveObserver(this); |
| 44 ash::WmShell::Get()->system_tray_notifier()->RemoveAccessibilityObserver( | 43 ash::Shell::Get()->system_tray_notifier()->RemoveAccessibilityObserver(this); |
| 45 this); | |
| 46 } | 44 } |
| 47 | 45 |
| 48 //////////////////////////////////////////////////////////////////////////////// | 46 //////////////////////////////////////////////////////////////////////////////// |
| 49 // WMHelperAsh, private: | 47 // WMHelperAsh, private: |
| 50 | 48 |
| 51 const display::ManagedDisplayInfo WMHelperAsh::GetDisplayInfo( | 49 const display::ManagedDisplayInfo WMHelperAsh::GetDisplayInfo( |
| 52 int64_t display_id) const { | 50 int64_t display_id) const { |
| 53 return ash::Shell::GetInstance()->display_manager()->GetDisplayInfo( | 51 return ash::Shell::GetInstance()->display_manager()->GetDisplayInfo( |
| 54 display_id); | 52 display_id); |
| 55 } | 53 } |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 147 |
| 150 void WMHelperAsh::OnDisplayConfigurationChanged() { | 148 void WMHelperAsh::OnDisplayConfigurationChanged() { |
| 151 NotifyDisplayConfigurationChanged(); | 149 NotifyDisplayConfigurationChanged(); |
| 152 } | 150 } |
| 153 | 151 |
| 154 void WMHelperAsh::OnKeyboardDeviceConfigurationChanged() { | 152 void WMHelperAsh::OnKeyboardDeviceConfigurationChanged() { |
| 155 NotifyKeyboardDeviceConfigurationChanged(); | 153 NotifyKeyboardDeviceConfigurationChanged(); |
| 156 } | 154 } |
| 157 | 155 |
| 158 } // namespace exo | 156 } // namespace exo |
| OLD | NEW |