| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef ASH_MUS_SHADOW_CONTROLLER_H_ | 5 #ifndef ASH_MUS_SHADOW_CONTROLLER_H_ |
| 6 #define ASH_MUS_SHADOW_CONTROLLER_H_ | 6 #define ASH_MUS_SHADOW_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "services/ui/public/cpp/window_observer.h" | 9 #include "ui/aura/client/focus_change_observer.h" |
| 10 #include "services/ui/public/cpp/window_tree_client_observer.h" | 10 #include "ui/aura/env_observer.h" |
| 11 #include "ui/aura/window_observer.h" |
| 11 | 12 |
| 12 namespace ui { | 13 namespace aura { |
| 13 class WindowTreeClient; | 14 namespace client { |
| 15 class FocusClient; |
| 16 } |
| 14 } | 17 } |
| 15 | 18 |
| 16 namespace ash { | 19 namespace ash { |
| 17 namespace mus { | 20 namespace mus { |
| 18 | 21 |
| 19 class ShadowController : public ui::WindowTreeClientObserver, | 22 // TODO: use the wm::ShadowController. http://crbug.com/670840. |
| 20 public ui::WindowObserver { | 23 class ShadowController : public aura::EnvObserver, |
| 24 public aura::WindowObserver, |
| 25 public aura::client::FocusChangeObserver { |
| 21 public: | 26 public: |
| 22 explicit ShadowController(ui::WindowTreeClient* window_tree); | 27 ShadowController(); |
| 23 ~ShadowController() override; | 28 ~ShadowController() override; |
| 24 | 29 |
| 25 private: | 30 private: |
| 26 void SetActiveWindow(ui::Window* window); | 31 void SetActiveWindow(aura::Window* window); |
| 32 void SetFocusClient(aura::client::FocusClient* focus_client); |
| 27 | 33 |
| 28 // ui::WindowTreeClientObserver: | 34 // aura::EnvObserver: |
| 29 void OnWindowTreeFocusChanged(ui::Window* gained_focus, | 35 void OnWindowInitialized(aura::Window* window) override; |
| 30 ui::Window* lost_focus) override; | 36 void OnActiveFocusClientChanged(aura::client::FocusClient* focus_client, |
| 37 aura::Window* window) override; |
| 38 |
| 39 // aura::client::FocusChangeObserver: |
| 40 void OnWindowFocused(aura::Window* gained_focus, |
| 41 aura::Window* lost_focus) override; |
| 31 | 42 |
| 32 // ui::WindowObserver: | 43 // ui::WindowObserver: |
| 33 void OnWindowDestroying(ui::Window* window) override; | 44 void OnWindowDestroying(aura::Window* window) override; |
| 34 | 45 |
| 35 ui::WindowTreeClient* window_tree_; | 46 aura::Window* active_window_ = nullptr; |
| 36 ui::Window* active_window_; | 47 aura::client::FocusClient* active_focus_client_ = nullptr; |
| 37 | 48 |
| 38 DISALLOW_COPY_AND_ASSIGN(ShadowController); | 49 DISALLOW_COPY_AND_ASSIGN(ShadowController); |
| 39 }; | 50 }; |
| 40 | 51 |
| 41 } // namespace mus | 52 } // namespace mus |
| 42 } // namespace ash | 53 } // namespace ash |
| 43 | 54 |
| 44 #endif // ASH_MUS_SHADOW_CONTROLLER_H_ | 55 #endif // ASH_MUS_SHADOW_CONTROLLER_H_ |
| OLD | NEW |