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

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

Issue 2739763003: Moves maintaining ShellObservers back to Shell (Closed)
Patch Set: merge Created 3 years, 9 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 | « chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc ('k') | 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/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" 10 #include "ash/common/wm_shell.h"
11 #include "ash/shell.h" 11 #include "ash/shell.h"
12 #include "base/memory/singleton.h" 12 #include "base/memory/singleton.h"
13 #include "ui/aura/client/focus_client.h" 13 #include "ui/aura/client/focus_client.h"
14 #include "ui/display/manager/display_manager.h" 14 #include "ui/display/manager/display_manager.h"
15 #include "ui/events/devices/device_data_manager.h" 15 #include "ui/events/devices/device_data_manager.h"
16 #include "ui/wm/public/activation_client.h" 16 #include "ui/wm/public/activation_client.h"
17 17
18 namespace exo { 18 namespace exo {
19 19
20 //////////////////////////////////////////////////////////////////////////////// 20 ////////////////////////////////////////////////////////////////////////////////
21 // WMHelperAsh, public: 21 // WMHelperAsh, public:
22 22
23 WMHelperAsh::WMHelperAsh() { 23 WMHelperAsh::WMHelperAsh() {
24 ash::WmShell::Get()->AddShellObserver(this); 24 ash::Shell::GetInstance()->AddShellObserver(this);
25 ash::Shell::GetInstance()->activation_client()->AddObserver(this); 25 ash::Shell::GetInstance()->activation_client()->AddObserver(this);
26 aura::client::FocusClient* focus_client = 26 aura::client::FocusClient* focus_client =
27 aura::client::GetFocusClient(ash::Shell::GetPrimaryRootWindow()); 27 aura::client::GetFocusClient(ash::Shell::GetPrimaryRootWindow());
28 focus_client->AddObserver(this); 28 focus_client->AddObserver(this);
29 ui::DeviceDataManager::GetInstance()->AddObserver(this); 29 ui::DeviceDataManager::GetInstance()->AddObserver(this);
30 ash::WmShell::Get()->system_tray_notifier()->AddAccessibilityObserver(this); 30 ash::WmShell::Get()->system_tray_notifier()->AddAccessibilityObserver(this);
31 } 31 }
32 32
33 WMHelperAsh::~WMHelperAsh() { 33 WMHelperAsh::~WMHelperAsh() {
34 if (!ash::Shell::HasInstance()) 34 if (!ash::Shell::HasInstance())
35 return; 35 return;
36 aura::client::FocusClient* focus_client = 36 aura::client::FocusClient* focus_client =
37 aura::client::GetFocusClient(ash::Shell::GetPrimaryRootWindow()); 37 aura::client::GetFocusClient(ash::Shell::GetPrimaryRootWindow());
38 focus_client->RemoveObserver(this); 38 focus_client->RemoveObserver(this);
39 ash::Shell::GetInstance()->activation_client()->RemoveObserver(this); 39 ash::Shell::GetInstance()->activation_client()->RemoveObserver(this);
40 ash::WmShell::Get()->RemoveShellObserver(this); 40 ash::Shell::GetInstance()->RemoveShellObserver(this);
41 ui::DeviceDataManager::GetInstance()->RemoveObserver(this); 41 ui::DeviceDataManager::GetInstance()->RemoveObserver(this);
42 ash::WmShell::Get()->system_tray_notifier()->RemoveAccessibilityObserver( 42 ash::WmShell::Get()->system_tray_notifier()->RemoveAccessibilityObserver(
43 this); 43 this);
44 } 44 }
45 45
46 //////////////////////////////////////////////////////////////////////////////// 46 ////////////////////////////////////////////////////////////////////////////////
47 // WMHelperAsh, private: 47 // WMHelperAsh, private:
48 48
49 const display::ManagedDisplayInfo WMHelperAsh::GetDisplayInfo( 49 const display::ManagedDisplayInfo WMHelperAsh::GetDisplayInfo(
50 int64_t display_id) const { 50 int64_t display_id) const {
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 142
143 void WMHelperAsh::OnMaximizeModeEnded() { 143 void WMHelperAsh::OnMaximizeModeEnded() {
144 NotifyMaximizeModeEnded(); 144 NotifyMaximizeModeEnded();
145 } 145 }
146 146
147 void WMHelperAsh::OnKeyboardDeviceConfigurationChanged() { 147 void WMHelperAsh::OnKeyboardDeviceConfigurationChanged() {
148 NotifyKeyboardDeviceConfigurationChanged(); 148 NotifyKeyboardDeviceConfigurationChanged();
149 } 149 }
150 150
151 } // namespace exo 151 } // namespace exo
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698