| OLD | NEW |
| 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 <map> | 10 #include <map> |
| 10 #include <sstream> | 11 #include <sstream> |
| 11 | 12 |
| 12 #include "ash/common/root_window_controller_common.h" | 13 #include "ash/common/root_window_controller_common.h" |
| 13 #include "ash/common/shell_window_ids.h" | 14 #include "ash/common/shell_window_ids.h" |
| 14 #include "ash/common/wm/always_on_top_controller.h" | 15 #include "ash/common/wm/always_on_top_controller.h" |
| 15 #include "ash/common/wm/container_finder.h" | 16 #include "ash/common/wm/container_finder.h" |
| 16 #include "ash/common/wm/dock/docked_window_layout_manager.h" | 17 #include "ash/common/wm/dock/docked_window_layout_manager.h" |
| 17 #include "ash/common/wm/panels/panel_layout_manager.h" | 18 #include "ash/common/wm/panels/panel_layout_manager.h" |
| 18 #include "ash/common/wm/root_window_layout_manager.h" | 19 #include "ash/common/wm/root_window_layout_manager.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 36 #include "components/mus/common/util.h" | 37 #include "components/mus/common/util.h" |
| 37 #include "components/mus/public/cpp/property_type_converters.h" | 38 #include "components/mus/public/cpp/property_type_converters.h" |
| 38 #include "components/mus/public/cpp/window.h" | 39 #include "components/mus/public/cpp/window.h" |
| 39 #include "components/mus/public/cpp/window_property.h" | 40 #include "components/mus/public/cpp/window_property.h" |
| 40 #include "components/mus/public/cpp/window_tree_client.h" | 41 #include "components/mus/public/cpp/window_tree_client.h" |
| 41 #include "components/mus/public/cpp/window_tree_host_factory.h" | 42 #include "components/mus/public/cpp/window_tree_host_factory.h" |
| 42 #include "mojo/public/cpp/bindings/type_converter.h" | 43 #include "mojo/public/cpp/bindings/type_converter.h" |
| 43 #include "services/shell/public/cpp/connector.h" | 44 #include "services/shell/public/cpp/connector.h" |
| 44 #include "ui/display/mojo/display_type_converters.h" | 45 #include "ui/display/mojo/display_type_converters.h" |
| 45 | 46 |
| 47 //JAMES hack |
| 48 #include "ash/system/status_area_widget.h" |
| 49 |
| 46 using ash::mojom::Container; | 50 using ash::mojom::Container; |
| 47 | 51 |
| 48 namespace ash { | 52 namespace ash { |
| 49 namespace mus { | 53 namespace mus { |
| 50 namespace { | 54 namespace { |
| 51 | 55 |
| 52 class WorkspaceLayoutManagerDelegateImpl | 56 class WorkspaceLayoutManagerDelegateImpl |
| 53 : public wm::WorkspaceLayoutManagerDelegate { | 57 : public wm::WorkspaceLayoutManagerDelegate { |
| 54 public: | 58 public: |
| 55 explicit WorkspaceLayoutManagerDelegateImpl( | 59 explicit WorkspaceLayoutManagerDelegateImpl( |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 void RootWindowController::OnShelfWindowAvailable() { | 203 void RootWindowController::OnShelfWindowAvailable() { |
| 200 DockedWindowLayoutManager::Get(WmWindowMus::Get(root_)) | 204 DockedWindowLayoutManager::Get(WmWindowMus::Get(root_)) |
| 201 ->SetShelf(wm_shelf_.get()); | 205 ->SetShelf(wm_shelf_.get()); |
| 202 | 206 |
| 203 PanelLayoutManager::Get(WmWindowMus::Get(root_))->SetShelf(wm_shelf_.get()); | 207 PanelLayoutManager::Get(WmWindowMus::Get(root_))->SetShelf(wm_shelf_.get()); |
| 204 | 208 |
| 205 // TODO: http://crbug.com/614182 Ash's ShelfLayoutManager implements | 209 // TODO: http://crbug.com/614182 Ash's ShelfLayoutManager implements |
| 206 // DockedWindowLayoutManagerObserver so that it can inset by the docked | 210 // DockedWindowLayoutManagerObserver so that it can inset by the docked |
| 207 // windows. | 211 // windows. |
| 208 // docked_layout_manager_->AddObserver(shelf_->shelf_layout_manager()); | 212 // docked_layout_manager_->AddObserver(shelf_->shelf_layout_manager()); |
| 213 |
| 214 //JAMES hack |
| 215 LOG(ERROR) << "JAMES creating status area widget"; |
| 216 WmWindowMus* status_container = |
| 217 GetWindowByShellWindowId(kShellWindowId_StatusContainer); |
| 218 StatusAreaWidget* status_area_widget = |
| 219 new StatusAreaWidget(status_container, wm_shelf_.get()); |
| 220 status_area_widget->CreateTrayViews(); |
| 221 status_area_widget->SetBounds(gfx::Rect(200, 300, 150, 250)); |
| 222 status_area_widget->Show(); |
| 209 } | 223 } |
| 210 | 224 |
| 211 void RootWindowController::CreateLayoutManagers() { | 225 void RootWindowController::CreateLayoutManagers() { |
| 212 // Override the default layout managers for certain containers. | 226 // Override the default layout managers for certain containers. |
| 213 WmWindowMus* lock_screen_container = | 227 WmWindowMus* lock_screen_container = |
| 214 GetWindowByShellWindowId(kShellWindowId_LockScreenContainer); | 228 GetWindowByShellWindowId(kShellWindowId_LockScreenContainer); |
| 215 layout_managers_[lock_screen_container->mus_window()].reset( | 229 layout_managers_[lock_screen_container->mus_window()].reset( |
| 216 new ScreenlockLayout(lock_screen_container->mus_window())); | 230 new ScreenlockLayout(lock_screen_container->mus_window())); |
| 217 | 231 |
| 218 WmWindowMus* shelf_container = | 232 WmWindowMus* shelf_container = |
| (...skipping 27 matching lines...) Expand all Loading... |
| 246 base::WrapUnique(new DockedWindowLayoutManager(docked_container))); | 260 base::WrapUnique(new DockedWindowLayoutManager(docked_container))); |
| 247 | 261 |
| 248 WmWindowMus* panel_container = | 262 WmWindowMus* panel_container = |
| 249 GetWindowByShellWindowId(kShellWindowId_PanelContainer); | 263 GetWindowByShellWindowId(kShellWindowId_PanelContainer); |
| 250 panel_container->SetLayoutManager( | 264 panel_container->SetLayoutManager( |
| 251 base::WrapUnique(new PanelLayoutManager(panel_container))); | 265 base::WrapUnique(new PanelLayoutManager(panel_container))); |
| 252 } | 266 } |
| 253 | 267 |
| 254 } // namespace mus | 268 } // namespace mus |
| 255 } // namespace ash | 269 } // namespace ash |
| OLD | NEW |