| 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 #ifndef ASH_WM_AURA_WM_GLOBALS_AURA_H_ | 5 #ifndef ASH_WM_AURA_WM_GLOBALS_AURA_H_ |
| 6 #define ASH_WM_AURA_WM_GLOBALS_AURA_H_ | 6 #define ASH_WM_AURA_WM_GLOBALS_AURA_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| 11 #include "ash/wm/common/wm_globals.h" | 11 #include "ash/wm/common/wm_globals.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/observer_list.h" |
| 14 #include "ui/wm/public/activation_change_observer.h" |
| 13 | 15 |
| 14 namespace ash { | 16 namespace ash { |
| 15 namespace wm { | 17 namespace wm { |
| 16 | 18 |
| 17 class ASH_EXPORT WmGlobalsAura : public WmGlobals { | 19 class ASH_EXPORT WmGlobalsAura : public WmGlobals, |
| 20 public aura::client::ActivationChangeObserver { |
| 18 public: | 21 public: |
| 19 WmGlobalsAura(); | 22 WmGlobalsAura(); |
| 20 ~WmGlobalsAura() override; | 23 ~WmGlobalsAura() override; |
| 21 | 24 |
| 22 static WmGlobalsAura* Get(); | 25 static WmGlobalsAura* Get(); |
| 23 | 26 |
| 24 // WmGlobals: | 27 // WmGlobals: |
| 28 WmWindow* GetFocusedWindow() override; |
| 25 WmWindow* GetActiveWindow() override; | 29 WmWindow* GetActiveWindow() override; |
| 26 WmWindow* GetRootWindowForDisplayId(int64_t display_id) override; | 30 WmWindow* GetRootWindowForDisplayId(int64_t display_id) override; |
| 27 WmWindow* GetRootWindowForNewWindows() override; | 31 WmWindow* GetRootWindowForNewWindows() override; |
| 28 std::vector<WmWindow*> GetMruWindowListIgnoreModals() override; | 32 std::vector<WmWindow*> GetMruWindowListIgnoreModals() override; |
| 29 bool IsForceMaximizeOnFirstRun() override; | 33 bool IsForceMaximizeOnFirstRun() override; |
| 30 void LockCursor() override; | 34 void LockCursor() override; |
| 31 void UnlockCursor() override; | 35 void UnlockCursor() override; |
| 32 std::vector<WmWindow*> GetAllRootWindows() override; | 36 std::vector<WmWindow*> GetAllRootWindows() override; |
| 37 void AddActivationObserver(WmActivationObserver* observer) override; |
| 38 void RemoveActivationObserver(WmActivationObserver* observer) override; |
| 33 | 39 |
| 34 private: | 40 private: |
| 41 // aura::client::ActivationChangeObserver: |
| 42 void OnWindowActivated(ActivationReason reason, |
| 43 aura::Window* gained_active, |
| 44 aura::Window* lost_active) override; |
| 45 |
| 46 bool added_activation_observer_ = false; |
| 47 base::ObserverList<WmActivationObserver> activation_observers_; |
| 48 |
| 35 DISALLOW_COPY_AND_ASSIGN(WmGlobalsAura); | 49 DISALLOW_COPY_AND_ASSIGN(WmGlobalsAura); |
| 36 }; | 50 }; |
| 37 | 51 |
| 38 } // namespace wm | 52 } // namespace wm |
| 39 } // namespace ash | 53 } // namespace ash |
| 40 | 54 |
| 41 #endif // ASH_WM_AURA_WM_GLOBALS_AURA_H_ | 55 #endif // ASH_WM_AURA_WM_GLOBALS_AURA_H_ |
| OLD | NEW |