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

Side by Side Diff: ash/common/wm_shell.cc

Issue 2157393002: Moves WindowCycleList/Controller to ash/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback and std::move 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/common/wm_shell.h ('k') | ash/common/wm_window.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/common/wm_shell.h" 5 #include "ash/common/wm_shell.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/accessibility_delegate.h" 9 #include "ash/common/accessibility_delegate.h"
10 #include "ash/common/focus_cycler.h" 10 #include "ash/common/focus_cycler.h"
11 #include "ash/common/keyboard/keyboard_ui.h" 11 #include "ash/common/keyboard/keyboard_ui.h"
12 #include "ash/common/shell_delegate.h" 12 #include "ash/common/shell_delegate.h"
13 #include "ash/common/shell_window_ids.h" 13 #include "ash/common/shell_window_ids.h"
14 #include "ash/common/system/brightness_control_delegate.h" 14 #include "ash/common/system/brightness_control_delegate.h"
15 #include "ash/common/system/keyboard_brightness_control_delegate.h" 15 #include "ash/common/system/keyboard_brightness_control_delegate.h"
16 #include "ash/common/system/tray/system_tray_delegate.h" 16 #include "ash/common/system/tray/system_tray_delegate.h"
17 #include "ash/common/system/tray/system_tray_notifier.h" 17 #include "ash/common/system/tray/system_tray_notifier.h"
18 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" 18 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
19 #include "ash/common/wm/mru_window_tracker.h" 19 #include "ash/common/wm/mru_window_tracker.h"
20 #include "ash/common/wm/overview/window_selector_controller.h" 20 #include "ash/common/wm/overview/window_selector_controller.h"
21 #include "ash/common/wm/window_cycle_controller.h"
21 #include "ash/common/wm_window.h" 22 #include "ash/common/wm_window.h"
22 #include "base/bind.h" 23 #include "base/bind.h"
23 #include "base/logging.h" 24 #include "base/logging.h"
24 25
25 #if defined(OS_CHROMEOS) 26 #if defined(OS_CHROMEOS)
26 #include "ash/common/system/chromeos/brightness/brightness_controller_chromeos.h " 27 #include "ash/common/system/chromeos/brightness/brightness_controller_chromeos.h "
27 #include "ash/common/system/chromeos/keyboard_brightness_controller.h" 28 #include "ash/common/system/chromeos/keyboard_brightness_controller.h"
28 #include "ash/common/system/chromeos/session/logout_confirmation_controller.h" 29 #include "ash/common/system/chromeos/session/logout_confirmation_controller.h"
29 #endif 30 #endif
30 31
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 84
84 WmShell::WmShell(std::unique_ptr<ShellDelegate> shell_delegate) 85 WmShell::WmShell(std::unique_ptr<ShellDelegate> shell_delegate)
85 : delegate_(std::move(shell_delegate)), 86 : delegate_(std::move(shell_delegate)),
86 focus_cycler_(new FocusCycler), 87 focus_cycler_(new FocusCycler),
87 system_tray_notifier_(new SystemTrayNotifier), 88 system_tray_notifier_(new SystemTrayNotifier),
88 window_selector_controller_(new WindowSelectorController) { 89 window_selector_controller_(new WindowSelectorController) {
89 #if defined(OS_CHROMEOS) 90 #if defined(OS_CHROMEOS)
90 brightness_control_delegate_.reset(new system::BrightnessControllerChromeos); 91 brightness_control_delegate_.reset(new system::BrightnessControllerChromeos);
91 keyboard_brightness_control_delegate_.reset(new KeyboardBrightnessController); 92 keyboard_brightness_control_delegate_.reset(new KeyboardBrightnessController);
92 #endif 93 #endif
94 window_cycle_controller_.reset(new WindowCycleController());
93 } 95 }
94 96
95 WmShell::~WmShell() {} 97 WmShell::~WmShell() {}
96 98
97 bool WmShell::IsSystemModalWindowOpen() { 99 bool WmShell::IsSystemModalWindowOpen() {
98 if (simulate_modal_window_open_for_testing_) 100 if (simulate_modal_window_open_for_testing_)
99 return true; 101 return true;
100 102
101 // Traverse all system modal containers, and find its direct child window 103 // Traverse all system modal containers, and find its direct child window
102 // with "SystemModal" setting, and visible. 104 // with "SystemModal" setting, and visible.
(...skipping 30 matching lines...) Expand all
133 } 135 }
134 136
135 void WmShell::DeleteSystemTrayDelegate() { 137 void WmShell::DeleteSystemTrayDelegate() {
136 DCHECK(system_tray_delegate_); 138 DCHECK(system_tray_delegate_);
137 #if defined(OS_CHROMEOS) 139 #if defined(OS_CHROMEOS)
138 logout_confirmation_controller_.reset(); 140 logout_confirmation_controller_.reset();
139 #endif 141 #endif
140 system_tray_delegate_.reset(); 142 system_tray_delegate_.reset();
141 } 143 }
142 144
145 void WmShell::DeleteWindowCycleController() {
146 window_cycle_controller_.reset();
147 }
148
143 void WmShell::DeleteWindowSelectorController() { 149 void WmShell::DeleteWindowSelectorController() {
144 window_selector_controller_.reset(); 150 window_selector_controller_.reset();
145 } 151 }
146 152
147 void WmShell::CreateMaximizeModeController() { 153 void WmShell::CreateMaximizeModeController() {
148 maximize_mode_controller_.reset(new MaximizeModeController); 154 maximize_mode_controller_.reset(new MaximizeModeController);
149 } 155 }
150 156
151 void WmShell::DeleteMaximizeModeController() { 157 void WmShell::DeleteMaximizeModeController() {
152 maximize_mode_controller_.reset(); 158 maximize_mode_controller_.reset();
153 } 159 }
154 160
155 void WmShell::CreateMruWindowTracker() { 161 void WmShell::CreateMruWindowTracker() {
156 mru_window_tracker_.reset(new MruWindowTracker); 162 mru_window_tracker_.reset(new MruWindowTracker);
157 } 163 }
158 164
159 void WmShell::DeleteMruWindowTracker() { 165 void WmShell::DeleteMruWindowTracker() {
160 mru_window_tracker_.reset(); 166 mru_window_tracker_.reset();
161 } 167 }
162 168
163 } // namespace ash 169 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm_shell.h ('k') | ash/common/wm_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698