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

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

Issue 2739763003: Moves maintaining ShellObservers back to Shell (Closed)
Patch Set: merge Created 3 years, 9 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/display/screen_orientation_controller_chromeos.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 <utility> 7 #include <utility>
8 8
9 #include "ash/common/accelerators/accelerator_controller.h" 9 #include "ash/common/accelerators/accelerator_controller.h"
10 #include "ash/common/accelerators/ash_focus_manager_factory.h" 10 #include "ash/common/accelerators/ash_focus_manager_factory.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 return; 165 return;
166 // Must occur after SessionStateDelegate creation and user login because 166 // Must occur after SessionStateDelegate creation and user login because
167 // Chrome's implementation of ShelfDelegate assumes it can get information 167 // Chrome's implementation of ShelfDelegate assumes it can get information
168 // about multi-profile login state. 168 // about multi-profile login state.
169 DCHECK(GetSessionStateDelegate()); 169 DCHECK(GetSessionStateDelegate());
170 DCHECK_GT(GetSessionStateDelegate()->NumberOfLoggedInUsers(), 0); 170 DCHECK_GT(GetSessionStateDelegate()->NumberOfLoggedInUsers(), 0);
171 shelf_delegate_.reset(delegate_->CreateShelfDelegate(shelf_model())); 171 shelf_delegate_.reset(delegate_->CreateShelfDelegate(shelf_model()));
172 shelf_window_watcher_.reset(new ShelfWindowWatcher(shelf_model())); 172 shelf_window_watcher_.reset(new ShelfWindowWatcher(shelf_model()));
173 } 173 }
174 174
175 void WmShell::OnMaximizeModeStarted() {
176 for (auto& observer : shell_observers_)
177 observer.OnMaximizeModeStarted();
178 }
179
180 void WmShell::OnMaximizeModeEnding() {
181 for (auto& observer : shell_observers_)
182 observer.OnMaximizeModeEnding();
183 }
184
185 void WmShell::OnMaximizeModeEnded() {
186 for (auto& observer : shell_observers_)
187 observer.OnMaximizeModeEnded();
188 }
189
190 void WmShell::UpdateAfterLoginStatusChange(LoginStatus status) { 175 void WmShell::UpdateAfterLoginStatusChange(LoginStatus status) {
191 for (WmWindow* root_window : GetAllRootWindows()) { 176 for (WmWindow* root_window : GetAllRootWindows()) {
192 root_window->GetRootWindowController()->UpdateAfterLoginStatusChange( 177 root_window->GetRootWindowController()->UpdateAfterLoginStatusChange(
193 status); 178 status);
194 } 179 }
195 } 180 }
196 181
197 void WmShell::NotifyFullscreenStateChanged(bool is_fullscreen,
198 WmWindow* root_window) {
199 for (auto& observer : shell_observers_)
200 observer.OnFullscreenStateChanged(is_fullscreen, root_window);
201 }
202
203 void WmShell::NotifyPinnedStateChanged(WmWindow* pinned_window) {
204 for (auto& observer : shell_observers_)
205 observer.OnPinnedStateChanged(pinned_window);
206 }
207
208 void WmShell::NotifyVirtualKeyboardActivated(bool activated) {
209 for (auto& observer : shell_observers_)
210 observer.OnVirtualKeyboardStateChanged(activated);
211 }
212
213 void WmShell::NotifyShelfCreatedForRootWindow(WmWindow* root_window) {
214 for (auto& observer : shell_observers_)
215 observer.OnShelfCreatedForRootWindow(root_window);
216 }
217
218 void WmShell::NotifyShelfAlignmentChanged(WmWindow* root_window) {
219 for (auto& observer : shell_observers_)
220 observer.OnShelfAlignmentChanged(root_window);
221 }
222
223 void WmShell::NotifyShelfAutoHideBehaviorChanged(WmWindow* root_window) {
224 for (auto& observer : shell_observers_)
225 observer.OnShelfAutoHideBehaviorChanged(root_window);
226 }
227
228 void WmShell::AddShellObserver(ShellObserver* observer) {
229 shell_observers_.AddObserver(observer);
230 }
231
232 void WmShell::RemoveShellObserver(ShellObserver* observer) {
233 shell_observers_.RemoveObserver(observer);
234 }
235
236 void WmShell::OnLockStateEvent(LockStateObserver::EventType event) { 182 void WmShell::OnLockStateEvent(LockStateObserver::EventType event) {
237 for (auto& observer : lock_state_observers_) 183 for (auto& observer : lock_state_observers_)
238 observer.OnLockStateEvent(event); 184 observer.OnLockStateEvent(event);
239 } 185 }
240 186
241 void WmShell::AddLockStateObserver(LockStateObserver* observer) { 187 void WmShell::AddLockStateObserver(LockStateObserver* observer) {
242 lock_state_observers_.AddObserver(observer); 188 lock_state_observers_.AddObserver(observer);
243 } 189 }
244 190
245 void WmShell::RemoveLockStateObserver(LockStateObserver* observer) { 191 void WmShell::RemoveLockStateObserver(LockStateObserver* observer) {
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 } 369 }
424 370
425 void WmShell::SessionStateChanged(session_manager::SessionState state) { 371 void WmShell::SessionStateChanged(session_manager::SessionState state) {
426 // Create the shelf when a session becomes active. It's safe to do this 372 // Create the shelf when a session becomes active. It's safe to do this
427 // multiple times (e.g. initial login vs. multiprofile add session). 373 // multiple times (e.g. initial login vs. multiprofile add session).
428 if (state == session_manager::SessionState::ACTIVE) 374 if (state == session_manager::SessionState::ACTIVE)
429 CreateShelfView(); 375 CreateShelfView();
430 } 376 }
431 377
432 } // namespace ash 378 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm_shell.h ('k') | ash/display/screen_orientation_controller_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698