Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: ash/common/wm/mru_window_tracker.h

Issue 2736573002: chromeos: Move files in //ash/common to //ash, part 2 (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef ASH_COMMON_WM_MRU_WINDOW_TRACKER_H_
6 #define ASH_COMMON_WM_MRU_WINDOW_TRACKER_H_
7
8 #include <list>
9 #include <vector>
10
11 #include "ash/ash_export.h"
12 #include "ash/common/wm_activation_observer.h"
13 #include "base/macros.h"
14 #include "ui/aura/window_observer.h"
15
16 namespace ash {
17
18 class WmWindow;
19
20 // Maintains a most recently used list of windows. This is used for window
21 // cycling using Alt+Tab and overview mode.
22 class ASH_EXPORT MruWindowTracker : public WmActivationObserver,
23 public aura::WindowObserver {
24 public:
25 using WindowList = std::vector<WmWindow*>;
26
27 MruWindowTracker();
28 ~MruWindowTracker() override;
29
30 // Returns the set of windows which can be cycled through using the tracked
31 // list of most recently used windows.
32 WindowList BuildMruWindowList() const;
33
34 // This does the same thing as the above, but ignores the system modal dialog
35 // state and hence the returned list could contain more windows if a system
36 // modal dialog window is present.
37 WindowList BuildWindowListIgnoreModal() const;
38
39 // Starts or stops ignoring window activations. If no longer ignoring
40 // activations the currently active window is moved to the front of the
41 // MRU window list. Used by WindowCycleList to avoid adding all cycled
42 // windows to the front of the MRU window list.
43 void SetIgnoreActivations(bool ignore);
44
45 private:
46 // Updates the mru_windows_ list to insert/move |active_window| at/to the
47 // front.
48 void SetActiveWindow(WmWindow* active_window);
49
50 // Overridden from WmActivationObserver:
51 void OnWindowActivated(WmWindow* gained_active,
52 WmWindow* lost_active) override;
53
54 // Overridden from aura::WindowObserver:
55 void OnWindowDestroyed(aura::Window* window) override;
56
57 // List of windows that have been activated in containers that we cycle
58 // through, sorted by most recently used.
59 std::list<WmWindow*> mru_windows_;
60
61 bool ignore_window_activations_;
62
63 DISALLOW_COPY_AND_ASSIGN(MruWindowTracker);
64 };
65
66 } // namespace ash
67
68 #endif // ASH_COMMON_WM_MRU_WINDOW_TRACKER_H_
OLDNEW
« no previous file with comments | « ash/common/wm/maximize_mode/workspace_backdrop_delegate.cc ('k') | ash/common/wm/mru_window_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698