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

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

Issue 2112403002: NOSUBMIT: Initialize a StatusAreaWidget inside ash wm (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « no previous file | ash/mus/BUILD.gn » ('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_window_ids.h" 9 #include "ash/common/shell_window_ids.h"
10 #include "ash/common/system/chromeos/session/logout_confirmation_controller.h" 10 #include "ash/common/system/chromeos/session/logout_confirmation_controller.h"
11 #include "ash/common/system/tray/system_tray_delegate.h" 11 #include "ash/common/system/tray/system_tray_delegate.h"
12 #include "ash/common/system/tray/system_tray_notifier.h" 12 #include "ash/common/system/tray/system_tray_notifier.h"
13 #include "ash/common/wm/mru_window_tracker.h" 13 #include "ash/common/wm/mru_window_tracker.h"
14 #include "ash/common/wm/overview/window_selector_controller.h" 14 #include "ash/common/wm/overview/window_selector_controller.h"
15 #include "ash/common/wm_window.h" 15 #include "ash/common/wm_window.h"
16 #include "base/bind.h" 16 #include "base/bind.h"
17 #include "base/logging.h" 17 #include "base/logging.h"
18 18
19 #if defined(OS_CHROMEOS)
20 #include "ash/common/system/chromeos/power/power_status.h"
21 #endif
22
19 namespace ash { 23 namespace ash {
20 24
21 // static 25 // static
22 WmShell* WmShell::instance_ = nullptr; 26 WmShell* WmShell::instance_ = nullptr;
23 27
24 // static 28 // static
25 void WmShell::Set(WmShell* instance) { 29 void WmShell::Set(WmShell* instance) {
26 instance_ = instance; 30 instance_ = instance;
27 } 31 }
28 32
(...skipping 11 matching lines...) Expand all
40 shell_observers_.AddObserver(observer); 44 shell_observers_.AddObserver(observer);
41 } 45 }
42 46
43 void WmShell::RemoveShellObserver(ShellObserver* observer) { 47 void WmShell::RemoveShellObserver(ShellObserver* observer) {
44 shell_observers_.RemoveObserver(observer); 48 shell_observers_.RemoveObserver(observer);
45 } 49 }
46 50
47 WmShell::WmShell() 51 WmShell::WmShell()
48 : focus_cycler_(new FocusCycler), 52 : focus_cycler_(new FocusCycler),
49 system_tray_notifier_(new SystemTrayNotifier), 53 system_tray_notifier_(new SystemTrayNotifier),
50 window_selector_controller_(new WindowSelectorController()) {} 54 window_selector_controller_(new WindowSelectorController()) {
55 #if defined(OS_CHROMEOS)
56 //JAMES move this to WindowManagerApplication and sort out the protocol
57 //buffer version problems.
58 if (!PowerStatus::IsInitialized())
59 PowerStatus::Initialize();
60 #endif
61 }
51 62
52 WmShell::~WmShell() {} 63 WmShell::~WmShell() {}
53 64
54 bool WmShell::IsSystemModalWindowOpen() { 65 bool WmShell::IsSystemModalWindowOpen() {
55 if (simulate_modal_window_open_for_testing_) 66 if (simulate_modal_window_open_for_testing_)
56 return true; 67 return true;
57 68
58 // Traverse all system modal containers, and find its direct child window 69 // Traverse all system modal containers, and find its direct child window
59 // with "SystemModal" setting, and visible. 70 // with "SystemModal" setting, and visible.
60 for (WmWindow* root : GetAllRootWindows()) { 71 for (WmWindow* root : GetAllRootWindows()) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 118
108 void WmShell::CreateMruWindowTracker() { 119 void WmShell::CreateMruWindowTracker() {
109 mru_window_tracker_.reset(new MruWindowTracker); 120 mru_window_tracker_.reset(new MruWindowTracker);
110 } 121 }
111 122
112 void WmShell::DeleteMruWindowTracker() { 123 void WmShell::DeleteMruWindowTracker() {
113 mru_window_tracker_.reset(); 124 mru_window_tracker_.reset();
114 } 125 }
115 126
116 } // namespace ash 127 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/mus/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698