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

Side by Side Diff: ash/mus/root_window_controller.cc

Issue 2234033002: mash: Remove WorkspaceLayoutManagerDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove WmRootWindowControllerObserver::OnFullscreenStateChanged; use ShellObserver. 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 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 #include "ash/mus/root_window_controller.h" 5 #include "ash/mus/root_window_controller.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
11 #include <sstream> 11 #include <sstream>
12 #include <string> 12 #include <string>
13 #include <utility> 13 #include <utility>
14 #include <vector> 14 #include <vector>
15 15
16 #include "ash/common/root_window_controller_common.h" 16 #include "ash/common/root_window_controller_common.h"
17 #include "ash/common/shell_window_ids.h" 17 #include "ash/common/shell_window_ids.h"
18 #include "ash/common/wm/always_on_top_controller.h" 18 #include "ash/common/wm/always_on_top_controller.h"
19 #include "ash/common/wm/container_finder.h" 19 #include "ash/common/wm/container_finder.h"
20 #include "ash/common/wm/dock/docked_window_layout_manager.h" 20 #include "ash/common/wm/dock/docked_window_layout_manager.h"
21 #include "ash/common/wm/panels/panel_layout_manager.h" 21 #include "ash/common/wm/panels/panel_layout_manager.h"
22 #include "ash/common/wm/root_window_layout_manager.h" 22 #include "ash/common/wm/root_window_layout_manager.h"
23 #include "ash/common/wm/workspace/workspace_layout_manager.h" 23 #include "ash/common/wm/workspace/workspace_layout_manager.h"
24 #include "ash/common/wm/workspace/workspace_layout_manager_delegate.h"
25 #include "ash/mus/bridge/wm_root_window_controller_mus.h" 24 #include "ash/mus/bridge/wm_root_window_controller_mus.h"
26 #include "ash/mus/bridge/wm_shelf_mus.h" 25 #include "ash/mus/bridge/wm_shelf_mus.h"
27 #include "ash/mus/bridge/wm_shell_mus.h" 26 #include "ash/mus/bridge/wm_shell_mus.h"
28 #include "ash/mus/bridge/wm_window_mus.h" 27 #include "ash/mus/bridge/wm_window_mus.h"
29 #include "ash/mus/container_ids.h" 28 #include "ash/mus/container_ids.h"
30 #include "ash/mus/non_client_frame_controller.h" 29 #include "ash/mus/non_client_frame_controller.h"
31 #include "ash/mus/property_util.h" 30 #include "ash/mus/property_util.h"
32 #include "ash/mus/screenlock_layout.h" 31 #include "ash/mus/screenlock_layout.h"
33 #include "ash/mus/shelf_layout_manager.h" 32 #include "ash/mus/shelf_layout_manager.h"
34 #include "ash/mus/status_layout_manager.h" 33 #include "ash/mus/status_layout_manager.h"
35 #include "ash/mus/window_manager.h" 34 #include "ash/mus/window_manager.h"
36 #include "base/bind.h" 35 #include "base/bind.h"
37 #include "base/command_line.h" 36 #include "base/command_line.h"
38 #include "base/memory/ptr_util.h" 37 #include "base/memory/ptr_util.h"
39 #include "mojo/public/cpp/bindings/type_converter.h" 38 #include "mojo/public/cpp/bindings/type_converter.h"
40 #include "services/shell/public/cpp/connector.h" 39 #include "services/shell/public/cpp/connector.h"
41 #include "services/ui/common/switches.h" 40 #include "services/ui/common/switches.h"
42 #include "services/ui/common/util.h" 41 #include "services/ui/common/util.h"
43 #include "services/ui/public/cpp/property_type_converters.h" 42 #include "services/ui/public/cpp/property_type_converters.h"
44 #include "services/ui/public/cpp/window.h" 43 #include "services/ui/public/cpp/window.h"
45 #include "services/ui/public/cpp/window_property.h" 44 #include "services/ui/public/cpp/window_property.h"
46 #include "services/ui/public/cpp/window_tree_client.h" 45 #include "services/ui/public/cpp/window_tree_client.h"
47 #include "services/ui/public/cpp/window_tree_host_factory.h" 46 #include "services/ui/public/cpp/window_tree_host_factory.h"
48 47
49 using ash::mojom::Container; 48 using ash::mojom::Container;
50 49
51 namespace ash { 50 namespace ash {
52 namespace mus { 51 namespace mus {
53 namespace {
54
55 class WorkspaceLayoutManagerDelegateImpl
56 : public wm::WorkspaceLayoutManagerDelegate {
57 public:
58 explicit WorkspaceLayoutManagerDelegateImpl(
59 WmRootWindowControllerMus* root_window_controller)
60 : root_window_controller_(root_window_controller) {}
61 ~WorkspaceLayoutManagerDelegateImpl() override = default;
62
63 // WorkspaceLayoutManagerDelegate:
64 void UpdateShelfVisibility() override { NOTIMPLEMENTED(); }
65 void OnFullscreenStateChanged(bool is_fullscreen) override {
66 // TODO(sky): this should only do something if there is a shelf, see
67 // implementation in ash/shell.cc.
68 NOTIMPLEMENTED();
69 root_window_controller_->NotifyFullscreenStateChange(is_fullscreen);
70 }
71
72 private:
73 WmRootWindowControllerMus* root_window_controller_;
74
75 DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManagerDelegateImpl);
76 };
77
78 } // namespace
79 52
80 RootWindowController::RootWindowController(WindowManager* window_manager, 53 RootWindowController::RootWindowController(WindowManager* window_manager,
81 ui::Window* root, 54 ui::Window* root,
82 const display::Display& display) 55 const display::Display& display)
83 : window_manager_(window_manager), 56 : window_manager_(window_manager),
84 root_(root), 57 root_(root),
85 window_count_(0), 58 window_count_(0),
86 display_(display) { 59 display_(display) {
87 wm_root_window_controller_.reset( 60 wm_root_window_controller_.reset(
88 new WmRootWindowControllerMus(window_manager_->shell(), this)); 61 new WmRootWindowControllerMus(window_manager_->shell(), this));
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 213
241 WmWindowMus* status_container = 214 WmWindowMus* status_container =
242 GetWindowByShellWindowId(kShellWindowId_StatusContainer); 215 GetWindowByShellWindowId(kShellWindowId_StatusContainer);
243 layout_managers_[status_container->mus_window()].reset( 216 layout_managers_[status_container->mus_window()].reset(
244 new StatusLayoutManager(status_container->mus_window())); 217 new StatusLayoutManager(status_container->mus_window()));
245 218
246 WmWindowMus* default_container = 219 WmWindowMus* default_container =
247 GetWindowByShellWindowId(kShellWindowId_DefaultContainer); 220 GetWindowByShellWindowId(kShellWindowId_DefaultContainer);
248 // WorkspaceLayoutManager is not a mash::wm::LayoutManager (it's a 221 // WorkspaceLayoutManager is not a mash::wm::LayoutManager (it's a
249 // wm::LayoutManager), so it can't be in |layout_managers_|. 222 // wm::LayoutManager), so it can't be in |layout_managers_|.
250 std::unique_ptr<WorkspaceLayoutManagerDelegateImpl> 223 workspace_layout_manager_ = new WorkspaceLayoutManager(default_container);
251 workspace_layout_manager_delegate(new WorkspaceLayoutManagerDelegateImpl(
252 wm_root_window_controller_.get()));
253 workspace_layout_manager_ = new WorkspaceLayoutManager(
254 default_container, std::move(workspace_layout_manager_delegate));
255 default_container->SetLayoutManager( 224 default_container->SetLayoutManager(
256 base::WrapUnique(workspace_layout_manager_)); 225 base::WrapUnique(workspace_layout_manager_));
257 226
258 WmWindowMus* docked_container = 227 WmWindowMus* docked_container =
259 GetWindowByShellWindowId(kShellWindowId_DockedContainer); 228 GetWindowByShellWindowId(kShellWindowId_DockedContainer);
260 docked_container->SetLayoutManager( 229 docked_container->SetLayoutManager(
261 base::WrapUnique(new DockedWindowLayoutManager(docked_container))); 230 base::WrapUnique(new DockedWindowLayoutManager(docked_container)));
262 231
263 WmWindowMus* panel_container = 232 WmWindowMus* panel_container =
264 GetWindowByShellWindowId(kShellWindowId_PanelContainer); 233 GetWindowByShellWindowId(kShellWindowId_PanelContainer);
265 panel_container->SetLayoutManager( 234 panel_container->SetLayoutManager(
266 base::WrapUnique(new PanelLayoutManager(panel_container))); 235 base::WrapUnique(new PanelLayoutManager(panel_container)));
267 } 236 }
268 237
269 } // namespace mus 238 } // namespace mus
270 } // namespace ash 239 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/bridge/wm_root_window_controller_mus.cc ('k') | ash/mus/workspace/workspace_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698