| 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_WM_MRU_WINDOW_TRACKER_H_ | 5 #ifndef ASH_WM_MRU_WINDOW_TRACKER_H_ |
| 6 #define ASH_WM_MRU_WINDOW_TRACKER_H_ | 6 #define ASH_WM_MRU_WINDOW_TRACKER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // Returns the set of windows which can be cycled through using the tracked | 54 // Returns the set of windows which can be cycled through using the tracked |
| 55 // list of most recently used windows. | 55 // list of most recently used windows. |
| 56 WindowList BuildMruWindowList(); | 56 WindowList BuildMruWindowList(); |
| 57 | 57 |
| 58 // Starts or stops ignoring window activations. If no longer ignoring | 58 // Starts or stops ignoring window activations. If no longer ignoring |
| 59 // activations the currently active window is moved to the front of the | 59 // activations the currently active window is moved to the front of the |
| 60 // MRU window list. Used by WindowCycleList to avoid adding all cycled | 60 // MRU window list. Used by WindowCycleList to avoid adding all cycled |
| 61 // windows to the front of the MRU window list. | 61 // windows to the front of the MRU window list. |
| 62 void SetIgnoreActivations(bool ignore); | 62 void SetIgnoreActivations(bool ignore); |
| 63 | 63 |
| 64 // Returns the most recently used window in |root_window| or NULL if none |
| 65 // found. |
| 66 const aura::Window* GetMruWindowInRoot(const aura::Window* root_window); |
| 67 |
| 64 private: | 68 private: |
| 65 // Updates the mru_windows_ list to insert/move |active_window| at/to the | 69 // Updates the mru_windows_ list to insert/move |active_window| at/to the |
| 66 // front. | 70 // front. |
| 67 void SetActiveWindow(aura::Window* active_window); | 71 void SetActiveWindow(aura::Window* active_window); |
| 68 | 72 |
| 69 // Overridden from aura::client::ActivationChangeObserver: | 73 // Overridden from aura::client::ActivationChangeObserver: |
| 70 virtual void OnWindowActivated(aura::Window* gained_active, | 74 virtual void OnWindowActivated(aura::Window* gained_active, |
| 71 aura::Window* lost_active) OVERRIDE; | 75 aura::Window* lost_active) OVERRIDE; |
| 72 | 76 |
| 73 // Overridden from WindowObserver: | 77 // Overridden from WindowObserver: |
| 74 virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE; | 78 virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE; |
| 75 | 79 |
| 76 // List of windows that have been activated in containers that we cycle | 80 // List of windows that have been activated in containers that we cycle |
| 77 // through, sorted by most recently used. | 81 // through, sorted by most recently used. |
| 78 std::list<aura::Window*> mru_windows_; | 82 std::list<aura::Window*> mru_windows_; |
| 79 | 83 |
| 80 aura::client::ActivationClient* activation_client_; | 84 aura::client::ActivationClient* activation_client_; |
| 81 | 85 |
| 82 bool ignore_window_activations_; | 86 bool ignore_window_activations_; |
| 83 | 87 |
| 84 DISALLOW_COPY_AND_ASSIGN(MruWindowTracker); | 88 DISALLOW_COPY_AND_ASSIGN(MruWindowTracker); |
| 85 }; | 89 }; |
| 86 | 90 |
| 87 } // namespace ash | 91 } // namespace ash |
| 88 | 92 |
| 89 #endif // ASH_WM_MRU_WINDOW_TRACKER_H_ | 93 #endif // ASH_WM_MRU_WINDOW_TRACKER_H_ |
| OLD | NEW |