| 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/mus/bridge/wm_shell_mus.h" | 5 #include "ash/mus/bridge/wm_shell_mus.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/key_event_watcher.h" | 10 #include "ash/common/key_event_watcher.h" |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 return base::MakeUnique<ImmersiveFullscreenController>(); | 373 return base::MakeUnique<ImmersiveFullscreenController>(); |
| 374 } | 374 } |
| 375 | 375 |
| 376 std::unique_ptr<KeyEventWatcher> WmShellMus::CreateKeyEventWatcher() { | 376 std::unique_ptr<KeyEventWatcher> WmShellMus::CreateKeyEventWatcher() { |
| 377 // TODO: needs implementation for mus, http://crbug.com/649600. | 377 // TODO: needs implementation for mus, http://crbug.com/649600. |
| 378 NOTIMPLEMENTED(); | 378 NOTIMPLEMENTED(); |
| 379 return std::unique_ptr<KeyEventWatcher>(); | 379 return std::unique_ptr<KeyEventWatcher>(); |
| 380 } | 380 } |
| 381 | 381 |
| 382 void WmShellMus::OnOverviewModeStarting() { | 382 void WmShellMus::OnOverviewModeStarting() { |
| 383 FOR_EACH_OBSERVER(ShellObserver, *shell_observers(), | 383 for (auto& observer : *shell_observers()) |
| 384 OnOverviewModeStarting()); | 384 observer.OnOverviewModeStarting(); |
| 385 } | 385 } |
| 386 | 386 |
| 387 void WmShellMus::OnOverviewModeEnded() { | 387 void WmShellMus::OnOverviewModeEnded() { |
| 388 FOR_EACH_OBSERVER(ShellObserver, *shell_observers(), OnOverviewModeEnded()); | 388 for (auto& observer : *shell_observers()) |
| 389 observer.OnOverviewModeEnded(); |
| 389 } | 390 } |
| 390 | 391 |
| 391 SessionStateDelegate* WmShellMus::GetSessionStateDelegate() { | 392 SessionStateDelegate* WmShellMus::GetSessionStateDelegate() { |
| 392 return session_state_delegate_.get(); | 393 return session_state_delegate_.get(); |
| 393 } | 394 } |
| 394 | 395 |
| 395 void WmShellMus::AddActivationObserver(WmActivationObserver* observer) { | 396 void WmShellMus::AddActivationObserver(WmActivationObserver* observer) { |
| 396 activation_observers_.AddObserver(observer); | 397 activation_observers_.AddObserver(observer); |
| 397 } | 398 } |
| 398 | 399 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 void WmShellMus::OnWindowTreeFocusChanged(ui::Window* gained_focus, | 451 void WmShellMus::OnWindowTreeFocusChanged(ui::Window* gained_focus, |
| 451 ui::Window* lost_focus) { | 452 ui::Window* lost_focus) { |
| 452 WmWindow* gained_active = GetToplevelAncestor(gained_focus); | 453 WmWindow* gained_active = GetToplevelAncestor(gained_focus); |
| 453 if (gained_active) | 454 if (gained_active) |
| 454 set_root_window_for_new_windows(gained_active->GetRootWindow()); | 455 set_root_window_for_new_windows(gained_active->GetRootWindow()); |
| 455 | 456 |
| 456 WmWindow* lost_active = GetToplevelAncestor(lost_focus); | 457 WmWindow* lost_active = GetToplevelAncestor(lost_focus); |
| 457 if (gained_active == lost_active) | 458 if (gained_active == lost_active) |
| 458 return; | 459 return; |
| 459 | 460 |
| 460 FOR_EACH_OBSERVER(WmActivationObserver, activation_observers_, | 461 for (auto& observer : activation_observers_) |
| 461 OnWindowActivated(gained_active, lost_active)); | 462 observer.OnWindowActivated(gained_active, lost_active); |
| 462 } | 463 } |
| 463 | 464 |
| 464 void WmShellMus::OnDidDestroyClient(ui::WindowTreeClient* client) { | 465 void WmShellMus::OnDidDestroyClient(ui::WindowTreeClient* client) { |
| 465 DCHECK_EQ(window_tree_client(), client); | 466 DCHECK_EQ(window_tree_client(), client); |
| 466 client->RemoveObserver(this); | 467 client->RemoveObserver(this); |
| 467 } | 468 } |
| 468 | 469 |
| 469 } // namespace mus | 470 } // namespace mus |
| 470 } // namespace ash | 471 } // namespace ash |
| OLD | NEW |