| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 UI_WM_CORE_TRANSIENT_WINDOW_CONTROLLER_H_ | 5 #ifndef UI_WM_CORE_TRANSIENT_WINDOW_CONTROLLER_H_ |
| 6 #define UI_WM_CORE_TRANSIENT_WINDOW_CONTROLLER_H_ | 6 #define UI_WM_CORE_TRANSIENT_WINDOW_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "ui/wm/public/transient_window_client.h" | 9 #include "base/observer_list.h" |
| 10 #include "ui/aura/client/transient_window_client.h" |
| 10 #include "ui/wm/wm_export.h" | 11 #include "ui/wm/wm_export.h" |
| 11 | 12 |
| 12 namespace wm { | 13 namespace wm { |
| 13 | 14 |
| 15 class TransientWindowManager; |
| 16 |
| 14 // TransientWindowClient implementation. Uses TransientWindowManager to handle | 17 // TransientWindowClient implementation. Uses TransientWindowManager to handle |
| 15 // tracking transient per window. | 18 // tracking transient per window. |
| 16 class WM_EXPORT TransientWindowController | 19 class WM_EXPORT TransientWindowController |
| 17 : public aura::client::TransientWindowClient { | 20 : public aura::client::TransientWindowClient { |
| 18 public: | 21 public: |
| 19 TransientWindowController(); | 22 TransientWindowController(); |
| 20 ~TransientWindowController() override; | 23 ~TransientWindowController() override; |
| 21 | 24 |
| 25 // Returns the single TransientWindowController instance. |
| 26 static TransientWindowController* Get() { return instance_; } |
| 27 |
| 22 // TransientWindowClient: | 28 // TransientWindowClient: |
| 23 void AddTransientChild(aura::Window* parent, aura::Window* child) override; | 29 void AddTransientChild(aura::Window* parent, aura::Window* child) override; |
| 24 void RemoveTransientChild(aura::Window* parent, aura::Window* child) override; | 30 void RemoveTransientChild(aura::Window* parent, aura::Window* child) override; |
| 25 aura::Window* GetTransientParent(aura::Window* window) override; | 31 aura::Window* GetTransientParent(aura::Window* window) override; |
| 26 const aura::Window* GetTransientParent(const aura::Window* window) override; | 32 const aura::Window* GetTransientParent(const aura::Window* window) override; |
| 33 void AddObserver( |
| 34 aura::client::TransientWindowClientObserver* observer) override; |
| 35 void RemoveObserver( |
| 36 aura::client::TransientWindowClientObserver* observer) override; |
| 27 | 37 |
| 28 private: | 38 private: |
| 39 friend class TransientWindowManager; |
| 40 |
| 41 static TransientWindowController* instance_; |
| 42 |
| 43 base::ObserverList<aura::client::TransientWindowClientObserver> observers_; |
| 44 |
| 29 DISALLOW_COPY_AND_ASSIGN(TransientWindowController); | 45 DISALLOW_COPY_AND_ASSIGN(TransientWindowController); |
| 30 }; | 46 }; |
| 31 | 47 |
| 32 } // namespace wm | 48 } // namespace wm |
| 33 | 49 |
| 34 #endif // UI_WM_CORE_TRANSIENT_WINDOW_CONTROLLER_H_ | 50 #endif // UI_WM_CORE_TRANSIENT_WINDOW_CONTROLLER_H_ |
| OLD | NEW |