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

Side by Side Diff: ash/common/wm_shell.h

Issue 2041423002: Moves MruWindowTracker to WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_mru_window_tracker
Patch Set: wm Created 4 years, 6 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
« no previous file with comments | « ash/common/wm/window_positioner.cc ('k') | ash/common/wm_shell_common.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_COMMON_WM_SHELL_H_ 5 #ifndef ASH_COMMON_WM_SHELL_H_
6 #define ASH_COMMON_WM_SHELL_H_ 6 #define ASH_COMMON_WM_SHELL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <vector> 11 #include <vector>
12 12
13 #include "ash/ash_export.h" 13 #include "ash/ash_export.h"
14 14
15 namespace gfx { 15 namespace gfx {
16 class Rect; 16 class Rect;
17 } 17 }
18 18
19 namespace ash { 19 namespace ash {
20 20
21 class MruWindowTracker;
21 class SessionStateDelegate; 22 class SessionStateDelegate;
22 class WindowResizer; 23 class WindowResizer;
23 class WmActivationObserver; 24 class WmActivationObserver;
24 class WmDisplayObserver; 25 class WmDisplayObserver;
25 class WmOverviewModeObserver; 26 class WmOverviewModeObserver;
26 class WmWindow; 27 class WmWindow;
27 28
28 namespace wm { 29 namespace wm {
29 30
30 class WindowState; 31 class WindowState;
31 32
32 enum class WmUserMetricsAction; 33 enum class WmUserMetricsAction;
33 } 34 }
34 35
35 // Similar to ash::Shell. Eventually the two will be merged. 36 // Similar to ash::Shell. Eventually the two will be merged.
36 class ASH_EXPORT WmShell { 37 class ASH_EXPORT WmShell {
37 public: 38 public:
38 virtual ~WmShell() {}
39
40 // This is necessary for a handful of places that is difficult to plumb 39 // This is necessary for a handful of places that is difficult to plumb
41 // through context. 40 // through context.
42 static void Set(WmShell* instance); 41 static void Set(WmShell* instance);
43 static WmShell* Get(); 42 static WmShell* Get();
44 43
44 virtual MruWindowTracker* GetMruWindowTracker() = 0;
45
45 // Creates a new window used as a container of other windows. No painting is 46 // Creates a new window used as a container of other windows. No painting is
46 // done to the created window. 47 // done to the created window.
47 virtual WmWindow* NewContainerWindow() = 0; 48 virtual WmWindow* NewContainerWindow() = 0;
48 49
49 virtual WmWindow* GetFocusedWindow() = 0; 50 virtual WmWindow* GetFocusedWindow() = 0;
50 virtual WmWindow* GetActiveWindow() = 0; 51 virtual WmWindow* GetActiveWindow() = 0;
51 52
52 virtual WmWindow* GetPrimaryRootWindow() = 0; 53 virtual WmWindow* GetPrimaryRootWindow() = 0;
53 54
54 // Returns the root window for the specified display. 55 // Returns the root window for the specified display.
55 virtual WmWindow* GetRootWindowForDisplayId(int64_t display_id) = 0; 56 virtual WmWindow* GetRootWindowForDisplayId(int64_t display_id) = 0;
56 57
57 // Returns the root window that newly created windows should be added to. 58 // Returns the root window that newly created windows should be added to.
58 // NOTE: this returns the root, newly created window should be added to the 59 // NOTE: this returns the root, newly created window should be added to the
59 // appropriate container in the returned window. 60 // appropriate container in the returned window.
60 virtual WmWindow* GetRootWindowForNewWindows() = 0; 61 virtual WmWindow* GetRootWindowForNewWindows() = 0;
61 62
62 // Returns the list of most recently used windows.
63 virtual std::vector<WmWindow*> GetMruWindowList() = 0;
64
65 // Returns the list of most recently used windows excluding modals.
66 virtual std::vector<WmWindow*> GetMruWindowListIgnoreModals() = 0;
67
68 // Returns true if the first window shown on first run should be 63 // Returns true if the first window shown on first run should be
69 // unconditionally maximized, overriding the heuristic that normally chooses 64 // unconditionally maximized, overriding the heuristic that normally chooses
70 // the window size. 65 // the window size.
71 virtual bool IsForceMaximizeOnFirstRun() = 0; 66 virtual bool IsForceMaximizeOnFirstRun() = 0;
72 67
73 // Returns true if |window| can be shown for the current user. This is 68 // Returns true if |window| can be shown for the current user. This is
74 // intended to check if the current user matches the user associated with 69 // intended to check if the current user matches the user associated with
75 // |window|. 70 // |window|.
76 virtual bool CanShowWindowForUser(WmWindow* window) = 0; 71 virtual bool CanShowWindowForUser(WmWindow* window) = 0;
77 72
(...skipping 21 matching lines...) Expand all
99 94
100 virtual void AddActivationObserver(WmActivationObserver* observer) = 0; 95 virtual void AddActivationObserver(WmActivationObserver* observer) = 0;
101 virtual void RemoveActivationObserver(WmActivationObserver* observer) = 0; 96 virtual void RemoveActivationObserver(WmActivationObserver* observer) = 0;
102 97
103 virtual void AddDisplayObserver(WmDisplayObserver* observer) = 0; 98 virtual void AddDisplayObserver(WmDisplayObserver* observer) = 0;
104 virtual void RemoveDisplayObserver(WmDisplayObserver* observer) = 0; 99 virtual void RemoveDisplayObserver(WmDisplayObserver* observer) = 0;
105 100
106 virtual void AddOverviewModeObserver(WmOverviewModeObserver* observer) = 0; 101 virtual void AddOverviewModeObserver(WmOverviewModeObserver* observer) = 0;
107 virtual void RemoveOverviewModeObserver(WmOverviewModeObserver* observer) = 0; 102 virtual void RemoveOverviewModeObserver(WmOverviewModeObserver* observer) = 0;
108 103
104 protected:
105 virtual ~WmShell() {}
106
109 private: 107 private:
110 static WmShell* instance_; 108 static WmShell* instance_;
111 }; 109 };
112 110
113 } // namespace ash 111 } // namespace ash
114 112
115 #endif // ASH_COMMON_WM_SHELL_H_ 113 #endif // ASH_COMMON_WM_SHELL_H_
OLDNEW
« no previous file with comments | « ash/common/wm/window_positioner.cc ('k') | ash/common/wm_shell_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698