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

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

Issue 2118643002: Move MaximizeModeController into ash/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: doh 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/ash_switches.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_observer.h" 9 #include "ash/common/shell_observer.h"
10 #include "ash/common/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard .h"
10 #include "ash/common/wm/mru_window_tracker.h" 11 #include "ash/common/wm/mru_window_tracker.h"
11 #include "ash/common/wm/overview/window_selector_controller.h" 12 #include "ash/common/wm/overview/window_selector_controller.h"
12 #include "ash/common/wm_activation_observer.h" 13 #include "ash/common/wm_activation_observer.h"
13 #include "ash/common/wm_display_observer.h" 14 #include "ash/common/wm_display_observer.h"
14 #include "ash/display/display_manager.h" 15 #include "ash/display/display_manager.h"
15 #include "ash/display/window_tree_host_manager.h" 16 #include "ash/display/window_tree_host_manager.h"
16 #include "ash/shell.h" 17 #include "ash/shell.h"
17 #include "ash/shell_delegate.h" 18 #include "ash/shell_delegate.h"
18 #include "ash/wm/drag_window_resizer.h" 19 #include "ash/wm/drag_window_resizer.h"
19 #include "ash/wm/maximize_mode/maximize_mode_event_handler_aura.h" 20 #include "ash/wm/maximize_mode/maximize_mode_event_handler_aura.h"
20 #include "ash/wm/screen_pinning_controller.h" 21 #include "ash/wm/screen_pinning_controller.h"
21 #include "ash/wm/window_util.h" 22 #include "ash/wm/window_util.h"
22 #include "base/memory/ptr_util.h" 23 #include "base/memory/ptr_util.h"
23 #include "ui/aura/client/focus_client.h" 24 #include "ui/aura/client/focus_client.h"
24 #include "ui/wm/public/activation_client.h" 25 #include "ui/wm/public/activation_client.h"
25 26
26 #if defined(OS_CHROMEOS) 27 #if defined(OS_CHROMEOS)
27 #include "ash/virtual_keyboard_controller.h" 28 #include "ash/virtual_keyboard_controller.h"
28 #endif 29 #endif
29 30
31 #if defined(USE_X11)
32 #include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.h"
33 #endif
34
35 #if defined(USE_OZONE)
36 #include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone. h"
37 #endif
38
30 namespace ash { 39 namespace ash {
31 40
32 WmShellAura::WmShellAura() { 41 WmShellAura::WmShellAura() {
33 WmShell::Set(this); 42 WmShell::Set(this);
34 } 43 }
35 44
36 WmShellAura::~WmShellAura() { 45 WmShellAura::~WmShellAura() {
37 WmShell::Set(nullptr); 46 WmShell::Set(nullptr);
38 } 47 }
39 48
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 } 81 }
73 82
74 WmWindow* WmShellAura::GetRootWindowForNewWindows() { 83 WmWindow* WmShellAura::GetRootWindowForNewWindows() {
75 return WmWindowAura::Get(Shell::GetTargetRootWindow()); 84 return WmWindowAura::Get(Shell::GetTargetRootWindow());
76 } 85 }
77 86
78 const DisplayInfo& WmShellAura::GetDisplayInfo(int64_t display_id) const { 87 const DisplayInfo& WmShellAura::GetDisplayInfo(int64_t display_id) const {
79 return Shell::GetInstance()->display_manager()->GetDisplayInfo(display_id); 88 return Shell::GetInstance()->display_manager()->GetDisplayInfo(display_id);
80 } 89 }
81 90
91 bool WmShellAura::IsActiveDisplayId(int64_t display_id) const {
92 return Shell::GetInstance()->display_manager()->IsActiveDisplayId(display_id);
93 }
94
82 bool WmShellAura::IsForceMaximizeOnFirstRun() { 95 bool WmShellAura::IsForceMaximizeOnFirstRun() {
83 return Shell::GetInstance()->delegate()->IsForceMaximizeOnFirstRun(); 96 return Shell::GetInstance()->delegate()->IsForceMaximizeOnFirstRun();
84 } 97 }
85 98
86 bool WmShellAura::IsPinned() { 99 bool WmShellAura::IsPinned() {
87 return Shell::GetInstance()->screen_pinning_controller()->IsPinned(); 100 return Shell::GetInstance()->screen_pinning_controller()->IsPinned();
88 } 101 }
89 102
90 void WmShellAura::SetPinnedWindow(WmWindow* window) { 103 void WmShellAura::SetPinnedWindow(WmWindow* window) {
91 return Shell::GetInstance()->screen_pinning_controller()->SetPinnedWindow( 104 return Shell::GetInstance()->screen_pinning_controller()->SetPinnedWindow(
(...skipping 29 matching lines...) Expand all
121 wm::WindowState* window_state) { 134 wm::WindowState* window_state) {
122 return base::WrapUnique( 135 return base::WrapUnique(
123 DragWindowResizer::Create(next_window_resizer.release(), window_state)); 136 DragWindowResizer::Create(next_window_resizer.release(), window_state));
124 } 137 }
125 138
126 std::unique_ptr<wm::MaximizeModeEventHandler> 139 std::unique_ptr<wm::MaximizeModeEventHandler>
127 WmShellAura::CreateMaximizeModeEventHandler() { 140 WmShellAura::CreateMaximizeModeEventHandler() {
128 return base::WrapUnique(new wm::MaximizeModeEventHandlerAura); 141 return base::WrapUnique(new wm::MaximizeModeEventHandlerAura);
129 } 142 }
130 143
144 std::unique_ptr<ScopedDisableInternalMouseAndKeyboard>
145 WmShellAura::CreateScopedDisableInternalMouseAndKeyboard() {
146 #if defined(USE_X11)
147 return base::WrapUnique(new ScopedDisableInternalMouseAndKeyboardX11);
148 #elif defined(USE_OZONE)
149 return base::WrapUnique(new ScopedDisableInternalMouseAndKeyboardOzone);
150 #endif
151 return nullptr;
152 }
153
131 void WmShellAura::OnOverviewModeStarting() { 154 void WmShellAura::OnOverviewModeStarting() {
132 FOR_EACH_OBSERVER(ShellObserver, *shell_observers(), 155 FOR_EACH_OBSERVER(ShellObserver, *shell_observers(),
133 OnOverviewModeStarting()); 156 OnOverviewModeStarting());
134 } 157 }
135 158
136 void WmShellAura::OnOverviewModeEnded() { 159 void WmShellAura::OnOverviewModeEnded() {
137 FOR_EACH_OBSERVER(ShellObserver, *shell_observers(), OnOverviewModeEnded()); 160 FOR_EACH_OBSERVER(ShellObserver, *shell_observers(), OnOverviewModeEnded());
138 } 161 }
139 162
140 AccessibilityDelegate* WmShellAura::GetAccessibilityDelegate() { 163 AccessibilityDelegate* WmShellAura::GetAccessibilityDelegate() {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_, 229 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_,
207 OnDisplayConfigurationChanging()); 230 OnDisplayConfigurationChanging());
208 } 231 }
209 232
210 void WmShellAura::OnDisplayConfigurationChanged() { 233 void WmShellAura::OnDisplayConfigurationChanged() {
211 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_, 234 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_,
212 OnDisplayConfigurationChanged()); 235 OnDisplayConfigurationChanged());
213 } 236 }
214 237
215 } // namespace ash 238 } // namespace ash
OLDNEW
« no previous file with comments | « ash/aura/wm_shell_aura.h ('k') | ash/common/ash_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698