| 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 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 WmWindowMus::Get(window)->GetShellWindowId()); | 446 WmWindowMus::Get(window)->GetShellWindowId()); |
| 447 } | 447 } |
| 448 | 448 |
| 449 // TODO: support OnAttemptToReactivateWindow, http://crbug.com/615114. | 449 // TODO: support OnAttemptToReactivateWindow, http://crbug.com/615114. |
| 450 void WmShellMus::OnWindowTreeFocusChanged(ui::Window* gained_focus, | 450 void WmShellMus::OnWindowTreeFocusChanged(ui::Window* gained_focus, |
| 451 ui::Window* lost_focus) { | 451 ui::Window* lost_focus) { |
| 452 WmWindow* gained_active = GetToplevelAncestor(gained_focus); | 452 WmWindow* gained_active = GetToplevelAncestor(gained_focus); |
| 453 if (gained_active) | 453 if (gained_active) |
| 454 set_root_window_for_new_windows(gained_active->GetRootWindow()); | 454 set_root_window_for_new_windows(gained_active->GetRootWindow()); |
| 455 | 455 |
| 456 WmWindow* lost_active = GetToplevelAncestor(gained_focus); | 456 WmWindow* lost_active = GetToplevelAncestor(lost_focus); |
| 457 if (gained_active == lost_active) | 457 if (gained_active == lost_active) |
| 458 return; | 458 return; |
| 459 | 459 |
| 460 FOR_EACH_OBSERVER(WmActivationObserver, activation_observers_, | 460 FOR_EACH_OBSERVER(WmActivationObserver, activation_observers_, |
| 461 OnWindowActivated(gained_active, lost_active)); | 461 OnWindowActivated(gained_active, lost_active)); |
| 462 } | 462 } |
| 463 | 463 |
| 464 void WmShellMus::OnDidDestroyClient(ui::WindowTreeClient* client) { | 464 void WmShellMus::OnDidDestroyClient(ui::WindowTreeClient* client) { |
| 465 DCHECK_EQ(window_tree_client(), client); | 465 DCHECK_EQ(window_tree_client(), client); |
| 466 client->RemoveObserver(this); | 466 client->RemoveObserver(this); |
| 467 } | 467 } |
| 468 | 468 |
| 469 } // namespace mus | 469 } // namespace mus |
| 470 } // namespace ash | 470 } // namespace ash |
| OLD | NEW |