Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(491)

Side by Side Diff: components/exo/wm_helper_ash.cc

Issue 2840193004: Mushrome: Use ui::InputDeviceManager in exo. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/accessibility_delegate.h" 7 #include "ash/accessibility_delegate.h"
8 #include "ash/public/cpp/config.h" 8 #include "ash/public/cpp/config.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_port.h" 10 #include "ash/shell_port.h"
11 #include "ash/system/tray/system_tray_notifier.h" 11 #include "ash/system/tray/system_tray_notifier.h"
12 #include "ash/wm/maximize_mode/maximize_mode_controller.h" 12 #include "ash/wm/maximize_mode/maximize_mode_controller.h"
13 #include "base/memory/singleton.h" 13 #include "base/memory/singleton.h"
14 #include "ui/aura/client/focus_client.h" 14 #include "ui/aura/client/focus_client.h"
15 #include "ui/display/manager/display_manager.h" 15 #include "ui/display/manager/display_manager.h"
16 #include "ui/events/devices/device_data_manager.h" 16 #include "ui/events/devices/input_device_manager.h"
17 #include "ui/wm/public/activation_client.h" 17 #include "ui/wm/public/activation_client.h"
18 18
19 namespace exo { 19 namespace exo {
20 20
21 //////////////////////////////////////////////////////////////////////////////// 21 ////////////////////////////////////////////////////////////////////////////////
22 // WMHelperAsh, public: 22 // WMHelperAsh, public:
23 23
24 WMHelperAsh::WMHelperAsh() { 24 WMHelperAsh::WMHelperAsh() {
25 ash::Shell::Get()->AddShellObserver(this); 25 ash::Shell::Get()->AddShellObserver(this);
26 ash::Shell::Get()->activation_client()->AddObserver(this); 26 ash::Shell::Get()->activation_client()->AddObserver(this);
27 // TODO(crbug.com/631103): Mushrome doesn't have a cursor manager yet. 27 // TODO(crbug.com/631103): Mushrome doesn't have a cursor manager yet.
28 if (ash::ShellPort::Get()->GetAshConfig() != ash::Config::MUS) 28 if (ash::ShellPort::Get()->GetAshConfig() != ash::Config::MUS)
29 ash::Shell::Get()->cursor_manager()->AddObserver(this); 29 ash::Shell::Get()->cursor_manager()->AddObserver(this);
30 ash::ShellPort::Get()->AddDisplayObserver(this); 30 ash::ShellPort::Get()->AddDisplayObserver(this);
31 aura::client::FocusClient* focus_client = 31 aura::client::FocusClient* focus_client =
32 aura::client::GetFocusClient(ash::Shell::GetPrimaryRootWindow()); 32 aura::client::GetFocusClient(ash::Shell::GetPrimaryRootWindow());
33 focus_client->AddObserver(this); 33 focus_client->AddObserver(this);
34 // TODO(crbug.com/709225): Mushrome doesn't have a DeviceDataManager. 34 ui::InputDeviceManager::GetInstance()->AddObserver(this);
35 if (ash::ShellPort::Get()->GetAshConfig() != ash::Config::MUS)
36 ui::DeviceDataManager::GetInstance()->AddObserver(this);
37 ash::Shell::Get()->system_tray_notifier()->AddAccessibilityObserver(this); 35 ash::Shell::Get()->system_tray_notifier()->AddAccessibilityObserver(this);
38 } 36 }
39 37
40 WMHelperAsh::~WMHelperAsh() { 38 WMHelperAsh::~WMHelperAsh() {
41 if (!ash::Shell::HasInstance()) 39 if (!ash::Shell::HasInstance())
42 return; 40 return;
43 aura::client::FocusClient* focus_client = 41 aura::client::FocusClient* focus_client =
44 aura::client::GetFocusClient(ash::Shell::GetPrimaryRootWindow()); 42 aura::client::GetFocusClient(ash::Shell::GetPrimaryRootWindow());
45 focus_client->RemoveObserver(this); 43 focus_client->RemoveObserver(this);
46 ash::ShellPort::Get()->RemoveDisplayObserver(this); 44 ash::ShellPort::Get()->RemoveDisplayObserver(this);
47 // TODO(crbug.com/631103): Mushrome doesn't have a cursor manager yet. 45 // TODO(crbug.com/631103): Mushrome doesn't have a cursor manager yet.
48 if (ash::ShellPort::Get()->GetAshConfig() != ash::Config::MUS) 46 if (ash::ShellPort::Get()->GetAshConfig() != ash::Config::MUS)
49 ash::Shell::Get()->cursor_manager()->RemoveObserver(this); 47 ash::Shell::Get()->cursor_manager()->RemoveObserver(this);
50 ash::Shell::Get()->activation_client()->RemoveObserver(this); 48 ash::Shell::Get()->activation_client()->RemoveObserver(this);
51 ash::Shell::Get()->RemoveShellObserver(this); 49 ash::Shell::Get()->RemoveShellObserver(this);
52 // TODO(crbug.com/709225): Mushrome doesn't have a DeviceDataManager. 50 ui::InputDeviceManager::GetInstance()->RemoveObserver(this);
53 if (ash::ShellPort::Get()->GetAshConfig() != ash::Config::MUS)
54 ui::DeviceDataManager::GetInstance()->RemoveObserver(this);
55 ash::Shell::Get()->system_tray_notifier()->RemoveAccessibilityObserver(this); 51 ash::Shell::Get()->system_tray_notifier()->RemoveAccessibilityObserver(this);
56 } 52 }
57 53
58 //////////////////////////////////////////////////////////////////////////////// 54 ////////////////////////////////////////////////////////////////////////////////
59 // WMHelperAsh, private: 55 // WMHelperAsh, private:
60 56
61 const display::ManagedDisplayInfo WMHelperAsh::GetDisplayInfo( 57 const display::ManagedDisplayInfo WMHelperAsh::GetDisplayInfo(
62 int64_t display_id) const { 58 int64_t display_id) const {
63 return ash::Shell::Get()->display_manager()->GetDisplayInfo(display_id); 59 return ash::Shell::Get()->display_manager()->GetDisplayInfo(display_id);
64 } 60 }
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 154
159 void WMHelperAsh::OnDisplayConfigurationChanged() { 155 void WMHelperAsh::OnDisplayConfigurationChanged() {
160 NotifyDisplayConfigurationChanged(); 156 NotifyDisplayConfigurationChanged();
161 } 157 }
162 158
163 void WMHelperAsh::OnKeyboardDeviceConfigurationChanged() { 159 void WMHelperAsh::OnKeyboardDeviceConfigurationChanged() {
164 NotifyKeyboardDeviceConfigurationChanged(); 160 NotifyKeyboardDeviceConfigurationChanged();
165 } 161 }
166 162
167 } // namespace exo 163 } // namespace exo
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698