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

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

Issue 2131733002: mash: Migrate [Keyboard]Brightness code to ash/common. (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/common/wm_shell.h ('k') | ash/shell.cc » ('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 "ash/common/focus_cycler.h" 7 #include "ash/common/focus_cycler.h"
8 #include "ash/common/keyboard/keyboard_ui.h" 8 #include "ash/common/keyboard/keyboard_ui.h"
9 #include "ash/common/shell_delegate.h" 9 #include "ash/common/shell_delegate.h"
10 #include "ash/common/shell_window_ids.h" 10 #include "ash/common/shell_window_ids.h"
11 #include "ash/common/system/chromeos/session/logout_confirmation_controller.h" 11 #include "ash/common/system/brightness_control_delegate.h"
12 #include "ash/common/system/keyboard_brightness_control_delegate.h"
12 #include "ash/common/system/tray/system_tray_delegate.h" 13 #include "ash/common/system/tray/system_tray_delegate.h"
13 #include "ash/common/system/tray/system_tray_notifier.h" 14 #include "ash/common/system/tray/system_tray_notifier.h"
14 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" 15 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
15 #include "ash/common/wm/mru_window_tracker.h" 16 #include "ash/common/wm/mru_window_tracker.h"
16 #include "ash/common/wm/overview/window_selector_controller.h" 17 #include "ash/common/wm/overview/window_selector_controller.h"
17 #include "ash/common/wm_window.h" 18 #include "ash/common/wm_window.h"
18 #include "base/bind.h" 19 #include "base/bind.h"
19 #include "base/logging.h" 20 #include "base/logging.h"
20 21
22 #if defined(OS_CHROMEOS)
23 #include "ash/common/system/chromeos/brightness/brightness_controller_chromeos.h "
24 #include "ash/common/system/chromeos/keyboard_brightness_controller.h"
25 #include "ash/common/system/chromeos/session/logout_confirmation_controller.h"
26 #endif
27
21 namespace ash { 28 namespace ash {
22 29
23 // static 30 // static
24 WmShell* WmShell::instance_ = nullptr; 31 WmShell* WmShell::instance_ = nullptr;
25 32
26 // static 33 // static
27 void WmShell::Set(WmShell* instance) { 34 void WmShell::Set(WmShell* instance) {
28 instance_ = instance; 35 instance_ = instance;
29 } 36 }
30 37
(...skipping 20 matching lines...) Expand all
51 } 58 }
52 59
53 void WmShell::RemoveShellObserver(ShellObserver* observer) { 60 void WmShell::RemoveShellObserver(ShellObserver* observer) {
54 shell_observers_.RemoveObserver(observer); 61 shell_observers_.RemoveObserver(observer);
55 } 62 }
56 63
57 WmShell::WmShell(ShellDelegate* delegate) 64 WmShell::WmShell(ShellDelegate* delegate)
58 : delegate_(delegate), 65 : delegate_(delegate),
59 focus_cycler_(new FocusCycler), 66 focus_cycler_(new FocusCycler),
60 system_tray_notifier_(new SystemTrayNotifier), 67 system_tray_notifier_(new SystemTrayNotifier),
61 window_selector_controller_(new WindowSelectorController()) {} 68 window_selector_controller_(new WindowSelectorController) {
69 #if defined(OS_CHROMEOS)
70 brightness_control_delegate_.reset(new system::BrightnessControllerChromeos);
71 keyboard_brightness_control_delegate_.reset(new KeyboardBrightnessController);
72 #endif
73 }
62 74
63 WmShell::~WmShell() {} 75 WmShell::~WmShell() {}
64 76
65 bool WmShell::IsSystemModalWindowOpen() { 77 bool WmShell::IsSystemModalWindowOpen() {
66 if (simulate_modal_window_open_for_testing_) 78 if (simulate_modal_window_open_for_testing_)
67 return true; 79 return true;
68 80
69 // Traverse all system modal containers, and find its direct child window 81 // Traverse all system modal containers, and find its direct child window
70 // with "SystemModal" setting, and visible. 82 // with "SystemModal" setting, and visible.
71 for (WmWindow* root : GetAllRootWindows()) { 83 for (WmWindow* root : GetAllRootWindows()) {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 138
127 void WmShell::CreateMruWindowTracker() { 139 void WmShell::CreateMruWindowTracker() {
128 mru_window_tracker_.reset(new MruWindowTracker); 140 mru_window_tracker_.reset(new MruWindowTracker);
129 } 141 }
130 142
131 void WmShell::DeleteMruWindowTracker() { 143 void WmShell::DeleteMruWindowTracker() {
132 mru_window_tracker_.reset(); 144 mru_window_tracker_.reset();
133 } 145 }
134 146
135 } // namespace ash 147 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm_shell.h ('k') | ash/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698