OLD | NEW |
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/overview/window_selector_controller.h" | 14 #include "ash/common/wm/overview/window_selector_controller.h" |
14 #include "ash/common/wm_window.h" | 15 #include "ash/common/wm_window.h" |
15 #include "base/bind.h" | 16 #include "base/bind.h" |
16 #include "base/logging.h" | 17 #include "base/logging.h" |
17 | 18 |
18 namespace ash { | 19 namespace ash { |
19 | 20 |
20 // static | 21 // static |
21 WmShell* WmShell::instance_ = nullptr; | 22 WmShell* WmShell::instance_ = nullptr; |
22 | 23 |
23 // static | 24 // static |
24 void WmShell::Set(WmShell* instance) { | 25 void WmShell::Set(WmShell* instance) { |
25 instance_ = instance; | 26 instance_ = instance; |
26 } | 27 } |
27 | 28 |
28 // static | 29 // static |
29 WmShell* WmShell::Get() { | 30 WmShell* WmShell::Get() { |
30 return instance_; | 31 return instance_; |
31 } | 32 } |
32 | 33 |
| 34 void WmShell::NotifyPinnedStateChanged(WmWindow* pinned_window) { |
| 35 FOR_EACH_OBSERVER(ShellObserver, shell_observers_, |
| 36 OnPinnedStateChanged(pinned_window)); |
| 37 } |
| 38 |
| 39 void WmShell::AddShellObserver(ShellObserver* observer) { |
| 40 shell_observers_.AddObserver(observer); |
| 41 } |
| 42 |
| 43 void WmShell::RemoveShellObserver(ShellObserver* observer) { |
| 44 shell_observers_.RemoveObserver(observer); |
| 45 } |
| 46 |
33 WmShell::WmShell() | 47 WmShell::WmShell() |
34 : focus_cycler_(new FocusCycler), | 48 : focus_cycler_(new FocusCycler), |
35 system_tray_notifier_(new SystemTrayNotifier), | 49 system_tray_notifier_(new SystemTrayNotifier), |
36 window_selector_controller_(new WindowSelectorController()) {} | 50 window_selector_controller_(new WindowSelectorController()) {} |
37 | 51 |
38 WmShell::~WmShell() {} | 52 WmShell::~WmShell() {} |
39 | 53 |
40 bool WmShell::IsSystemModalWindowOpen() { | 54 bool WmShell::IsSystemModalWindowOpen() { |
41 if (simulate_modal_window_open_for_testing_) | 55 if (simulate_modal_window_open_for_testing_) |
42 return true; | 56 return true; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 #if defined(OS_CHROMEOS) | 98 #if defined(OS_CHROMEOS) |
85 logout_confirmation_controller_.reset(); | 99 logout_confirmation_controller_.reset(); |
86 #endif | 100 #endif |
87 system_tray_delegate_.reset(); | 101 system_tray_delegate_.reset(); |
88 } | 102 } |
89 | 103 |
90 void WmShell::DeleteWindowSelectorController() { | 104 void WmShell::DeleteWindowSelectorController() { |
91 window_selector_controller_.reset(); | 105 window_selector_controller_.reset(); |
92 } | 106 } |
93 | 107 |
| 108 void WmShell::CreateMruWindowTracker() { |
| 109 mru_window_tracker_.reset(new MruWindowTracker); |
| 110 } |
| 111 |
| 112 void WmShell::DeleteMruWindowTracker() { |
| 113 mru_window_tracker_.reset(); |
| 114 } |
| 115 |
94 } // namespace ash | 116 } // namespace ash |
OLD | NEW |