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

Side by Side Diff: ash/common/wm/workspace/workspace_layout_manager.h

Issue 2234033002: mash: Remove WorkspaceLayoutManagerDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ 5 #ifndef ASH_COMMON_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_
6 #define ASH_COMMON_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ 6 #define ASH_COMMON_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <set> 9 #include <set>
10 10
11 #include "ash/ash_export.h" 11 #include "ash/ash_export.h"
12 #include "ash/common/shell_observer.h" 12 #include "ash/common/shell_observer.h"
13 #include "ash/common/wm/window_state_observer.h" 13 #include "ash/common/wm/window_state_observer.h"
14 #include "ash/common/wm/wm_types.h" 14 #include "ash/common/wm/wm_types.h"
15 #include "ash/common/wm_activation_observer.h" 15 #include "ash/common/wm_activation_observer.h"
16 #include "ash/common/wm_layout_manager.h" 16 #include "ash/common/wm_layout_manager.h"
17 #include "ash/common/wm_root_window_controller_observer.h" 17 #include "ash/common/wm_root_window_controller_observer.h"
18 #include "ash/common/wm_window_observer.h" 18 #include "ash/common/wm_window_observer.h"
19 #include "base/macros.h" 19 #include "base/macros.h"
20 #include "ui/gfx/geometry/rect.h" 20 #include "ui/gfx/geometry/rect.h"
21 #include "ui/keyboard/keyboard_controller_observer.h" 21 #include "ui/keyboard/keyboard_controller_observer.h"
22 22
23 namespace ash { 23 namespace ash {
24 class WmShell; 24 class WmShell;
25 class WmRootWindowController; 25 class WmRootWindowController;
26 class WorkspaceLayoutManagerBackdropDelegate; 26 class WorkspaceLayoutManagerBackdropDelegate;
27 27
28 namespace wm { 28 namespace wm {
29 class WorkspaceLayoutManagerDelegate;
30 class WMEvent; 29 class WMEvent;
31 } 30 }
32 31
33 // LayoutManager used on the window created for a workspace. 32 // LayoutManager used on the window created for a workspace.
34 class ASH_EXPORT WorkspaceLayoutManager 33 class ASH_EXPORT WorkspaceLayoutManager
35 : public WmLayoutManager, 34 : public WmLayoutManager,
36 public WmWindowObserver, 35 public WmWindowObserver,
37 public WmActivationObserver, 36 public WmActivationObserver,
38 public keyboard::KeyboardControllerObserver, 37 public keyboard::KeyboardControllerObserver,
39 public WmRootWindowControllerObserver, 38 public WmRootWindowControllerObserver,
40 public ShellObserver, 39 public ShellObserver,
41 public wm::WindowStateObserver { 40 public wm::WindowStateObserver {
42 public: 41 public:
43 WorkspaceLayoutManager( 42 explicit WorkspaceLayoutManager(WmWindow* window);
44 WmWindow* window,
45 std::unique_ptr<wm::WorkspaceLayoutManagerDelegate> delegate);
46
47 ~WorkspaceLayoutManager() override; 43 ~WorkspaceLayoutManager() override;
48 44
49 void DeleteDelegate();
James Cook 2016/08/10 19:55:41 Nice to get rid of calls like this.
msw 2016/08/10 20:47:40 Acknowledged.
50
51 // A delegate which can be set to add a backdrop behind the top most visible 45 // A delegate which can be set to add a backdrop behind the top most visible
52 // window. With the call the ownership of the delegate will be transferred to 46 // window. With the call the ownership of the delegate will be transferred to
53 // the WorkspaceLayoutManager. 47 // the WorkspaceLayoutManager.
54 void SetMaximizeBackdropDelegate( 48 void SetMaximizeBackdropDelegate(
55 std::unique_ptr<WorkspaceLayoutManagerBackdropDelegate> delegate); 49 std::unique_ptr<WorkspaceLayoutManagerBackdropDelegate> delegate);
56 50
57 // Overridden from WmLayoutManager: 51 // Overridden from WmLayoutManager:
58 void OnWindowResized() override; 52 void OnWindowResized() override;
59 void OnWindowAddedToLayout(WmWindow* child) override; 53 void OnWindowAddedToLayout(WmWindow* child) override;
60 void OnWillRemoveWindowFromLayout(WmWindow* child) override; 54 void OnWillRemoveWindowFromLayout(WmWindow* child) override;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 114
121 // Updates the always-on-top state for windows managed by this layout 115 // Updates the always-on-top state for windows managed by this layout
122 // manager. 116 // manager.
123 void UpdateAlwaysOnTop(WmWindow* window_on_top); 117 void UpdateAlwaysOnTop(WmWindow* window_on_top);
124 118
125 WmWindow* window_; 119 WmWindow* window_;
126 WmWindow* root_window_; 120 WmWindow* root_window_;
127 WmRootWindowController* root_window_controller_; 121 WmRootWindowController* root_window_controller_;
128 WmShell* shell_; 122 WmShell* shell_;
129 123
130 std::unique_ptr<wm::WorkspaceLayoutManagerDelegate> delegate_;
131
132 // Set of windows we're listening to. 124 // Set of windows we're listening to.
133 WindowSet windows_; 125 WindowSet windows_;
134 126
135 // The work area in the coordinates of |window_|. 127 // The work area in the coordinates of |window_|.
136 gfx::Rect work_area_in_parent_; 128 gfx::Rect work_area_in_parent_;
137 129
138 // True if this workspace is currently in fullscreen mode. 130 // True if this workspace is currently in fullscreen mode.
139 bool is_fullscreen_; 131 bool is_fullscreen_;
140 132
141 // A window which covers the full container and which gets inserted behind the 133 // A window which covers the full container and which gets inserted behind the
142 // topmost visible window. 134 // topmost visible window.
143 std::unique_ptr<WorkspaceLayoutManagerBackdropDelegate> backdrop_delegate_; 135 std::unique_ptr<WorkspaceLayoutManagerBackdropDelegate> backdrop_delegate_;
144 136
145 DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManager); 137 DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManager);
146 }; 138 };
147 139
148 } // namespace ash 140 } // namespace ash
149 141
150 #endif // ASH_COMMON_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ 142 #endif // ASH_COMMON_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698