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

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

Issue 2887103002: Revert of Refactor backdrop (Closed)
Patch Set: Created 3 years, 7 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/wm/workspace/backdrop_delegate.h ('k') | ash/wm/workspace/workspace_layout_manager.cc » ('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 (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_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ 5 #ifndef ASH_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_
6 #define ASH_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ 6 #define ASH_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <set> 9 #include <set>
10 10
(...skipping 10 matching lines...) Expand all
21 #include "ui/keyboard/keyboard_controller_observer.h" 21 #include "ui/keyboard/keyboard_controller_observer.h"
22 #include "ui/wm/public/activation_change_observer.h" 22 #include "ui/wm/public/activation_change_observer.h"
23 23
24 namespace keyboard { 24 namespace keyboard {
25 class KeyboardController; 25 class KeyboardController;
26 } 26 }
27 27
28 namespace ash { 28 namespace ash {
29 29
30 class RootWindowController; 30 class RootWindowController;
31 class BackdropDelegate; 31 class WorkspaceLayoutManagerBackdropDelegate;
32 class BackdropController;
33
34 namespace test {
35 class WorkspaceControllerTestApi;
36 }
37 32
38 namespace wm { 33 namespace wm {
39 class WMEvent; 34 class WMEvent;
40 } 35 }
41 36
42 // LayoutManager used on the window created for a workspace. 37 // LayoutManager used on the window created for a workspace.
43 class ASH_EXPORT WorkspaceLayoutManager 38 class ASH_EXPORT WorkspaceLayoutManager
44 : public aura::LayoutManager, 39 : public aura::LayoutManager,
45 public aura::WindowObserver, 40 public aura::WindowObserver,
46 public aura::client::ActivationChangeObserver, 41 public aura::client::ActivationChangeObserver,
47 public keyboard::KeyboardControllerObserver, 42 public keyboard::KeyboardControllerObserver,
48 public display::DisplayObserver, 43 public display::DisplayObserver,
49 public ShellObserver, 44 public ShellObserver,
50 public wm::WindowStateObserver { 45 public wm::WindowStateObserver {
51 public: 46 public:
52 // |window| is the container for this layout manager. 47 // |window| is the container for this layout manager.
53 explicit WorkspaceLayoutManager(aura::Window* window); 48 explicit WorkspaceLayoutManager(aura::Window* window);
54 ~WorkspaceLayoutManager() override; 49 ~WorkspaceLayoutManager() override;
55 50
56 // A delegate which can be set to add a backdrop behind the top most visible 51 // A delegate which can be set to add a backdrop behind the top most visible
57 // window. With the call the ownership of the delegate will be transferred to 52 // window. With the call the ownership of the delegate will be transferred to
58 // the WorkspaceLayoutManager. 53 // the WorkspaceLayoutManager.
59 void SetBackdropDelegate(std::unique_ptr<BackdropDelegate> delegate); 54 void SetMaximizeBackdropDelegate(
55 std::unique_ptr<WorkspaceLayoutManagerBackdropDelegate> delegate);
60 56
61 // Overridden from aura::LayoutManager: 57 // Overridden from aura::LayoutManager:
62 void OnWindowResized() override; 58 void OnWindowResized() override;
63 void OnWindowAddedToLayout(aura::Window* child) override; 59 void OnWindowAddedToLayout(aura::Window* child) override;
64 void OnWillRemoveWindowFromLayout(aura::Window* child) override; 60 void OnWillRemoveWindowFromLayout(aura::Window* child) override;
65 void OnWindowRemovedFromLayout(aura::Window* child) override; 61 void OnWindowRemovedFromLayout(aura::Window* child) override;
66 void OnChildWindowVisibilityChanged(aura::Window* child, 62 void OnChildWindowVisibilityChanged(aura::Window* child,
67 bool visible) override; 63 bool visible) override;
68 void SetChildBounds(aura::Window* child, 64 void SetChildBounds(aura::Window* child,
69 const gfx::Rect& requested_bounds) override; 65 const gfx::Rect& requested_bounds) override;
(...skipping 27 matching lines...) Expand all
97 uint32_t changed_metrics) override; 93 uint32_t changed_metrics) override;
98 94
99 // ShellObserver overrides: 95 // ShellObserver overrides:
100 void OnFullscreenStateChanged(bool is_fullscreen, 96 void OnFullscreenStateChanged(bool is_fullscreen,
101 WmWindow* root_window) override; 97 WmWindow* root_window) override;
102 void OnPinnedStateChanged(WmWindow* pinned_window) override; 98 void OnPinnedStateChanged(WmWindow* pinned_window) override;
103 void OnVirtualKeyboardStateChanged(bool activated, 99 void OnVirtualKeyboardStateChanged(bool activated,
104 aura::Window* root_window) override; 100 aura::Window* root_window) override;
105 101
106 private: 102 private:
107 friend class test::WorkspaceControllerTestApi;
108 typedef std::set<aura::Window*> WindowSet; 103 typedef std::set<aura::Window*> WindowSet;
109 104
110 // Adjusts the bounds of all managed windows when the display area changes. 105 // Adjusts the bounds of all managed windows when the display area changes.
111 // This happens when the display size, work area insets has changed. 106 // This happens when the display size, work area insets has changed.
112 // If this is called for a display size change (i.e. |event| 107 // If this is called for a display size change (i.e. |event|
113 // is DISPLAY_RESIZED), the non-maximized/non-fullscreen 108 // is DISPLAY_RESIZED), the non-maximized/non-fullscreen
114 // windows are readjusted to make sure the window is completely within the 109 // windows are readjusted to make sure the window is completely within the
115 // display region. Otherwise, it makes sure at least some parts of the window 110 // display region. Otherwise, it makes sure at least some parts of the window
116 // is on display. 111 // is on display.
117 void AdjustAllWindowsBoundsForWorkAreaChange(const wm::WMEvent* event); 112 void AdjustAllWindowsBoundsForWorkAreaChange(const wm::WMEvent* event);
(...skipping 17 matching lines...) Expand all
135 WindowSet windows_; 130 WindowSet windows_;
136 131
137 // The work area in the coordinates of |window_|. 132 // The work area in the coordinates of |window_|.
138 gfx::Rect work_area_in_parent_; 133 gfx::Rect work_area_in_parent_;
139 134
140 // True if this workspace is currently in fullscreen mode. 135 // True if this workspace is currently in fullscreen mode.
141 bool is_fullscreen_; 136 bool is_fullscreen_;
142 137
143 // A window which covers the full container and which gets inserted behind the 138 // A window which covers the full container and which gets inserted behind the
144 // topmost visible window. 139 // topmost visible window.
145 std::unique_ptr<BackdropController> backdrop_controller_; 140 std::unique_ptr<WorkspaceLayoutManagerBackdropDelegate> backdrop_delegate_;
146 141
147 ScopedObserver<keyboard::KeyboardController, 142 ScopedObserver<keyboard::KeyboardController,
148 keyboard::KeyboardControllerObserver> 143 keyboard::KeyboardControllerObserver>
149 keyboard_observer_; 144 keyboard_observer_;
150 145
151 DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManager); 146 DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManager);
152 }; 147 };
153 148
154 } // namespace ash 149 } // namespace ash
155 150
156 #endif // ASH_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ 151 #endif // ASH_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_
OLDNEW
« no previous file with comments | « ash/wm/workspace/backdrop_delegate.h ('k') | ash/wm/workspace/workspace_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698