| 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/aura/wm_shell_aura.h" | 5 #include "ash/aura/wm_shell_aura.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/aura/key_event_watcher_aura.h" | 9 #include "ash/aura/key_event_watcher_aura.h" |
| 10 #include "ash/aura/pointer_watcher_adapter.h" | 10 #include "ash/aura/pointer_watcher_adapter.h" |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 #endif | 301 #endif |
| 302 | 302 |
| 303 void WmShellAura::OnWindowActivated( | 303 void WmShellAura::OnWindowActivated( |
| 304 aura::client::ActivationChangeObserver::ActivationReason reason, | 304 aura::client::ActivationChangeObserver::ActivationReason reason, |
| 305 aura::Window* gained_active, | 305 aura::Window* gained_active, |
| 306 aura::Window* lost_active) { | 306 aura::Window* lost_active) { |
| 307 WmWindow* gained_active_wm = WmWindowAura::Get(gained_active); | 307 WmWindow* gained_active_wm = WmWindowAura::Get(gained_active); |
| 308 WmWindow* lost_active_wm = WmWindowAura::Get(lost_active); | 308 WmWindow* lost_active_wm = WmWindowAura::Get(lost_active); |
| 309 if (gained_active_wm) | 309 if (gained_active_wm) |
| 310 set_root_window_for_new_windows(gained_active_wm->GetRootWindow()); | 310 set_root_window_for_new_windows(gained_active_wm->GetRootWindow()); |
| 311 FOR_EACH_OBSERVER(WmActivationObserver, activation_observers_, | 311 for (auto& observer : activation_observers_) |
| 312 OnWindowActivated(gained_active_wm, lost_active_wm)); | 312 observer.OnWindowActivated(gained_active_wm, lost_active_wm); |
| 313 } | 313 } |
| 314 | 314 |
| 315 void WmShellAura::OnAttemptToReactivateWindow(aura::Window* request_active, | 315 void WmShellAura::OnAttemptToReactivateWindow(aura::Window* request_active, |
| 316 aura::Window* actual_active) { | 316 aura::Window* actual_active) { |
| 317 FOR_EACH_OBSERVER( | 317 for (auto& observer : activation_observers_) { |
| 318 WmActivationObserver, activation_observers_, | 318 observer.OnAttemptToReactivateWindow(WmWindowAura::Get(request_active), |
| 319 OnAttemptToReactivateWindow(WmWindowAura::Get(request_active), | 319 WmWindowAura::Get(actual_active)); |
| 320 WmWindowAura::Get(actual_active))); | 320 } |
| 321 } | 321 } |
| 322 | 322 |
| 323 void WmShellAura::OnDisplayConfigurationChanging() { | 323 void WmShellAura::OnDisplayConfigurationChanging() { |
| 324 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_, | 324 for (auto& observer : display_observers_) |
| 325 OnDisplayConfigurationChanging()); | 325 observer.OnDisplayConfigurationChanging(); |
| 326 } | 326 } |
| 327 | 327 |
| 328 void WmShellAura::OnDisplayConfigurationChanged() { | 328 void WmShellAura::OnDisplayConfigurationChanged() { |
| 329 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_, | 329 for (auto& observer : display_observers_) |
| 330 OnDisplayConfigurationChanged()); | 330 observer.OnDisplayConfigurationChanged(); |
| 331 } | 331 } |
| 332 | 332 |
| 333 } // namespace ash | 333 } // namespace ash |
| OLD | NEW |