| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_COMMON_WM_MRU_WINDOW_TRACKER_H_ | 5 #ifndef ASH_COMMON_WM_MRU_WINDOW_TRACKER_H_ |
| 6 #define ASH_COMMON_WM_MRU_WINDOW_TRACKER_H_ | 6 #define ASH_COMMON_WM_MRU_WINDOW_TRACKER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "ash/ash_export.h" | 11 #include "ash/ash_export.h" |
| 12 #include "ash/common/wm_activation_observer.h" | 12 #include "ash/common/wm_activation_observer.h" |
| 13 #include "ash/common/wm_window_observer.h" | |
| 14 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "ui/aura/window_observer.h" |
| 15 | 15 |
| 16 namespace ash { | 16 namespace ash { |
| 17 | 17 |
| 18 class WmWindow; | 18 class WmWindow; |
| 19 | 19 |
| 20 // Maintains a most recently used list of windows. This is used for window | 20 // Maintains a most recently used list of windows. This is used for window |
| 21 // cycling using Alt+Tab and overview mode. | 21 // cycling using Alt+Tab and overview mode. |
| 22 class ASH_EXPORT MruWindowTracker : public WmActivationObserver, | 22 class ASH_EXPORT MruWindowTracker : public WmActivationObserver, |
| 23 public WmWindowObserver { | 23 public aura::WindowObserver { |
| 24 public: | 24 public: |
| 25 using WindowList = std::vector<WmWindow*>; | 25 using WindowList = std::vector<WmWindow*>; |
| 26 | 26 |
| 27 MruWindowTracker(); | 27 MruWindowTracker(); |
| 28 ~MruWindowTracker() override; | 28 ~MruWindowTracker() override; |
| 29 | 29 |
| 30 // Returns the set of windows which can be cycled through using the tracked | 30 // Returns the set of windows which can be cycled through using the tracked |
| 31 // list of most recently used windows. | 31 // list of most recently used windows. |
| 32 WindowList BuildMruWindowList() const; | 32 WindowList BuildMruWindowList() const; |
| 33 | 33 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 // Updates the mru_windows_ list to insert/move |active_window| at/to the | 46 // Updates the mru_windows_ list to insert/move |active_window| at/to the |
| 47 // front. | 47 // front. |
| 48 void SetActiveWindow(WmWindow* active_window); | 48 void SetActiveWindow(WmWindow* active_window); |
| 49 | 49 |
| 50 // Overridden from WmActivationObserver: | 50 // Overridden from WmActivationObserver: |
| 51 void OnWindowActivated(WmWindow* gained_active, | 51 void OnWindowActivated(WmWindow* gained_active, |
| 52 WmWindow* lost_active) override; | 52 WmWindow* lost_active) override; |
| 53 | 53 |
| 54 // Overridden from WmWindowObserver: | 54 // Overridden from aura::WindowObserver: |
| 55 void OnWindowDestroyed(WmWindow* window) override; | 55 void OnWindowDestroyed(aura::Window* window) override; |
| 56 | 56 |
| 57 // List of windows that have been activated in containers that we cycle | 57 // List of windows that have been activated in containers that we cycle |
| 58 // through, sorted by most recently used. | 58 // through, sorted by most recently used. |
| 59 std::list<WmWindow*> mru_windows_; | 59 std::list<WmWindow*> mru_windows_; |
| 60 | 60 |
| 61 bool ignore_window_activations_; | 61 bool ignore_window_activations_; |
| 62 | 62 |
| 63 DISALLOW_COPY_AND_ASSIGN(MruWindowTracker); | 63 DISALLOW_COPY_AND_ASSIGN(MruWindowTracker); |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 } // namespace ash | 66 } // namespace ash |
| 67 | 67 |
| 68 #endif // ASH_COMMON_WM_MRU_WINDOW_TRACKER_H_ | 68 #endif // ASH_COMMON_WM_MRU_WINDOW_TRACKER_H_ |
| OLD | NEW |