| 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/wm/maximize_mode/maximize_mode_controller.h" | 8 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 
| 9 #include "ash/common/wm_shell.h" | 9 #include "ash/common/wm_shell.h" | 
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" | 
| 11 #include "base/memory/singleton.h" | 11 #include "base/memory/singleton.h" | 
| 12 #include "ui/aura/client/focus_client.h" | 12 #include "ui/aura/client/focus_client.h" | 
| 13 #include "ui/display/manager/display_manager.h" | 13 #include "ui/display/manager/display_manager.h" | 
|  | 14 #include "ui/events/devices/device_data_manager.h" | 
| 14 #include "ui/wm/public/activation_client.h" | 15 #include "ui/wm/public/activation_client.h" | 
| 15 | 16 | 
| 16 namespace exo { | 17 namespace exo { | 
| 17 | 18 | 
| 18 //////////////////////////////////////////////////////////////////////////////// | 19 //////////////////////////////////////////////////////////////////////////////// | 
| 19 // WMHelperAsh, public: | 20 // WMHelperAsh, public: | 
| 20 | 21 | 
| 21 WMHelperAsh::WMHelperAsh() { | 22 WMHelperAsh::WMHelperAsh() { | 
| 22   ash::WmShell::Get()->AddShellObserver(this); | 23   ash::WmShell::Get()->AddShellObserver(this); | 
| 23   ash::Shell::GetInstance()->activation_client()->AddObserver(this); | 24   ash::Shell::GetInstance()->activation_client()->AddObserver(this); | 
| 24   aura::client::FocusClient* focus_client = | 25   aura::client::FocusClient* focus_client = | 
| 25       aura::client::GetFocusClient(ash::Shell::GetPrimaryRootWindow()); | 26       aura::client::GetFocusClient(ash::Shell::GetPrimaryRootWindow()); | 
| 26   focus_client->AddObserver(this); | 27   focus_client->AddObserver(this); | 
|  | 28   ui::DeviceDataManager::GetInstance()->AddObserver(this); | 
| 27 } | 29 } | 
| 28 | 30 | 
| 29 WMHelperAsh::~WMHelperAsh() { | 31 WMHelperAsh::~WMHelperAsh() { | 
| 30   if (!ash::Shell::HasInstance()) | 32   if (!ash::Shell::HasInstance()) | 
| 31     return; | 33     return; | 
| 32   aura::client::FocusClient* focus_client = | 34   aura::client::FocusClient* focus_client = | 
| 33       aura::client::GetFocusClient(ash::Shell::GetPrimaryRootWindow()); | 35       aura::client::GetFocusClient(ash::Shell::GetPrimaryRootWindow()); | 
| 34   focus_client->RemoveObserver(this); | 36   focus_client->RemoveObserver(this); | 
| 35   ash::Shell::GetInstance()->activation_client()->RemoveObserver(this); | 37   ash::Shell::GetInstance()->activation_client()->RemoveObserver(this); | 
| 36   ash::WmShell::Get()->RemoveShellObserver(this); | 38   ash::WmShell::Get()->RemoveShellObserver(this); | 
|  | 39   ui::DeviceDataManager::GetInstance()->RemoveObserver(this); | 
| 37 } | 40 } | 
| 38 | 41 | 
| 39 //////////////////////////////////////////////////////////////////////////////// | 42 //////////////////////////////////////////////////////////////////////////////// | 
| 40 // WMHelperAsh, private: | 43 // WMHelperAsh, private: | 
| 41 | 44 | 
| 42 const display::ManagedDisplayInfo WMHelperAsh::GetDisplayInfo( | 45 const display::ManagedDisplayInfo WMHelperAsh::GetDisplayInfo( | 
| 43     int64_t display_id) const { | 46     int64_t display_id) const { | 
| 44   return ash::Shell::GetInstance()->display_manager()->GetDisplayInfo( | 47   return ash::Shell::GetInstance()->display_manager()->GetDisplayInfo( | 
| 45       display_id); | 48       display_id); | 
| 46 } | 49 } | 
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 126 } | 129 } | 
| 127 | 130 | 
| 128 void WMHelperAsh::OnMaximizeModeStarted() { | 131 void WMHelperAsh::OnMaximizeModeStarted() { | 
| 129   NotifyMaximizeModeStarted(); | 132   NotifyMaximizeModeStarted(); | 
| 130 } | 133 } | 
| 131 | 134 | 
| 132 void WMHelperAsh::OnMaximizeModeEnded() { | 135 void WMHelperAsh::OnMaximizeModeEnded() { | 
| 133   NotifyMaximizeModeEnded(); | 136   NotifyMaximizeModeEnded(); | 
| 134 } | 137 } | 
| 135 | 138 | 
|  | 139 void WMHelperAsh::OnKeyboardDeviceConfigurationChanged() { | 
|  | 140   NotifyKeyboardDeviceConfigurationChanged(); | 
|  | 141 } | 
|  | 142 | 
| 136 }  // namespace exo | 143 }  // namespace exo | 
| OLD | NEW | 
|---|