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

Side by Side Diff: ash/aura/wm_shell_aura.cc

Issue 2118593002: mash: Migrate ShellDelegate ownership and access to WmShell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 4 years, 5 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 | « ash/aura/wm_shell_aura.h ('k') | ash/common/shell_delegate.h » ('j') | 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 "ash/aura/wm_shell_aura.h" 5 #include "ash/aura/wm_shell_aura.h"
6 6
7 #include "ash/aura/wm_window_aura.h" 7 #include "ash/aura/wm_window_aura.h"
8 #include "ash/common/session/session_state_delegate.h" 8 #include "ash/common/session/session_state_delegate.h"
9 #include "ash/common/shell_delegate.h"
9 #include "ash/common/shell_observer.h" 10 #include "ash/common/shell_observer.h"
10 #include "ash/common/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard .h" 11 #include "ash/common/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard .h"
11 #include "ash/common/wm/mru_window_tracker.h" 12 #include "ash/common/wm/mru_window_tracker.h"
12 #include "ash/common/wm/overview/window_selector_controller.h" 13 #include "ash/common/wm/overview/window_selector_controller.h"
13 #include "ash/common/wm_activation_observer.h" 14 #include "ash/common/wm_activation_observer.h"
14 #include "ash/common/wm_display_observer.h" 15 #include "ash/common/wm_display_observer.h"
15 #include "ash/display/display_manager.h" 16 #include "ash/display/display_manager.h"
16 #include "ash/display/window_tree_host_manager.h" 17 #include "ash/display/window_tree_host_manager.h"
17 #include "ash/shell.h" 18 #include "ash/shell.h"
18 #include "ash/shell_delegate.h"
19 #include "ash/wm/drag_window_resizer.h" 19 #include "ash/wm/drag_window_resizer.h"
20 #include "ash/wm/maximize_mode/maximize_mode_event_handler_aura.h" 20 #include "ash/wm/maximize_mode/maximize_mode_event_handler_aura.h"
21 #include "ash/wm/screen_pinning_controller.h" 21 #include "ash/wm/screen_pinning_controller.h"
22 #include "ash/wm/window_util.h" 22 #include "ash/wm/window_util.h"
23 #include "base/memory/ptr_util.h" 23 #include "base/memory/ptr_util.h"
24 #include "ui/aura/client/focus_client.h" 24 #include "ui/aura/client/focus_client.h"
25 #include "ui/wm/public/activation_client.h" 25 #include "ui/wm/public/activation_client.h"
26 26
27 #if defined(OS_CHROMEOS) 27 #if defined(OS_CHROMEOS)
28 #include "ash/virtual_keyboard_controller.h" 28 #include "ash/virtual_keyboard_controller.h"
29 #endif 29 #endif
30 30
31 #if defined(USE_X11) 31 #if defined(USE_X11)
32 #include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.h" 32 #include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.h"
33 #endif 33 #endif
34 34
35 #if defined(USE_OZONE) 35 #if defined(USE_OZONE)
36 #include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone. h" 36 #include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone. h"
37 #endif 37 #endif
38 38
39 namespace ash { 39 namespace ash {
40 40
41 WmShellAura::WmShellAura() { 41 WmShellAura::WmShellAura(ShellDelegate* delegate) : WmShell(delegate) {
42 WmShell::Set(this); 42 WmShell::Set(this);
43 } 43 }
44 44
45 WmShellAura::~WmShellAura() { 45 WmShellAura::~WmShellAura() {
46 WmShell::Set(nullptr); 46 WmShell::Set(nullptr);
47 } 47 }
48 48
49 void WmShellAura::PrepareForShutdown() { 49 void WmShellAura::PrepareForShutdown() {
50 if (added_activation_observer_) 50 if (added_activation_observer_)
51 Shell::GetInstance()->activation_client()->RemoveObserver(this); 51 Shell::GetInstance()->activation_client()->RemoveObserver(this);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 86
87 const DisplayInfo& WmShellAura::GetDisplayInfo(int64_t display_id) const { 87 const DisplayInfo& WmShellAura::GetDisplayInfo(int64_t display_id) const {
88 return Shell::GetInstance()->display_manager()->GetDisplayInfo(display_id); 88 return Shell::GetInstance()->display_manager()->GetDisplayInfo(display_id);
89 } 89 }
90 90
91 bool WmShellAura::IsActiveDisplayId(int64_t display_id) const { 91 bool WmShellAura::IsActiveDisplayId(int64_t display_id) const {
92 return Shell::GetInstance()->display_manager()->IsActiveDisplayId(display_id); 92 return Shell::GetInstance()->display_manager()->IsActiveDisplayId(display_id);
93 } 93 }
94 94
95 bool WmShellAura::IsForceMaximizeOnFirstRun() { 95 bool WmShellAura::IsForceMaximizeOnFirstRun() {
96 return Shell::GetInstance()->delegate()->IsForceMaximizeOnFirstRun(); 96 return delegate()->IsForceMaximizeOnFirstRun();
97 } 97 }
98 98
99 bool WmShellAura::IsPinned() { 99 bool WmShellAura::IsPinned() {
100 return Shell::GetInstance()->screen_pinning_controller()->IsPinned(); 100 return Shell::GetInstance()->screen_pinning_controller()->IsPinned();
101 } 101 }
102 102
103 void WmShellAura::SetPinnedWindow(WmWindow* window) { 103 void WmShellAura::SetPinnedWindow(WmWindow* window) {
104 return Shell::GetInstance()->screen_pinning_controller()->SetPinnedWindow( 104 return Shell::GetInstance()->screen_pinning_controller()->SetPinnedWindow(
105 window); 105 window);
106 } 106 }
107 107
108 bool WmShellAura::CanShowWindowForUser(WmWindow* window) { 108 bool WmShellAura::CanShowWindowForUser(WmWindow* window) {
109 return Shell::GetInstance()->delegate()->CanShowWindowForUser(window); 109 return delegate()->CanShowWindowForUser(window);
110 } 110 }
111 111
112 void WmShellAura::LockCursor() { 112 void WmShellAura::LockCursor() {
113 Shell::GetInstance()->cursor_manager()->LockCursor(); 113 Shell::GetInstance()->cursor_manager()->LockCursor();
114 } 114 }
115 115
116 void WmShellAura::UnlockCursor() { 116 void WmShellAura::UnlockCursor() {
117 Shell::GetInstance()->cursor_manager()->UnlockCursor(); 117 Shell::GetInstance()->cursor_manager()->UnlockCursor();
118 } 118 }
119 119
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_, 229 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_,
230 OnDisplayConfigurationChanging()); 230 OnDisplayConfigurationChanging());
231 } 231 }
232 232
233 void WmShellAura::OnDisplayConfigurationChanged() { 233 void WmShellAura::OnDisplayConfigurationChanged() {
234 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_, 234 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_,
235 OnDisplayConfigurationChanged()); 235 OnDisplayConfigurationChanged());
236 } 236 }
237 237
238 } // namespace ash 238 } // namespace ash
OLDNEW
« no previous file with comments | « ash/aura/wm_shell_aura.h ('k') | ash/common/shell_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698