| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "mash/wm/window_manager_application.h" | 5 #include "mash/wm/window_manager_application.h" |
| 6 | 6 |
| 7 #include "components/mus/common/util.h" | 7 #include "components/mus/common/util.h" |
| 8 #include "components/mus/public/cpp/window.h" | 8 #include "components/mus/public/cpp/window.h" |
| 9 #include "components/mus/public/cpp/window_tree_connection.h" | 9 #include "components/mus/public/cpp/window_tree_connection.h" |
| 10 #include "components/mus/public/cpp/window_tree_host_factory.h" | 10 #include "components/mus/public/cpp/window_tree_host_factory.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 background_layout_.reset(new BackgroundLayout( | 56 background_layout_.reset(new BackgroundLayout( |
| 57 GetWindowForContainer(mash::wm::mojom::CONTAINER_USER_BACKGROUND))); | 57 GetWindowForContainer(mash::wm::mojom::CONTAINER_USER_BACKGROUND))); |
| 58 shelf_layout_.reset(new ShelfLayout( | 58 shelf_layout_.reset(new ShelfLayout( |
| 59 GetWindowForContainer(mash::wm::mojom::CONTAINER_USER_SHELF))); | 59 GetWindowForContainer(mash::wm::mojom::CONTAINER_USER_SHELF))); |
| 60 window_layout_.reset(new WindowLayout( | 60 window_layout_.reset(new WindowLayout( |
| 61 GetWindowForContainer(mash::wm::mojom::CONTAINER_USER_WINDOWS))); | 61 GetWindowForContainer(mash::wm::mojom::CONTAINER_USER_WINDOWS))); |
| 62 | 62 |
| 63 window_manager_.reset(new WindowManagerImpl(this)); | 63 window_manager_.reset(new WindowManagerImpl(this)); |
| 64 | 64 |
| 65 ui_init_.reset(new ui::mojo::UIInit(views::GetDisplaysFromWindow(root))); | 65 ui_init_.reset(new ui::mojo::UIInit(views::GetDisplaysFromWindow(root))); |
| 66 aura_init_.reset(new views::AuraInit(app_, "views_mus_resources.pak")); | 66 aura_init_.reset(new views::AuraInit(app_, "mash_wm_resources.pak")); |
| 67 | 67 |
| 68 for (auto request : requests_) | 68 for (auto request : requests_) |
| 69 window_manager_binding_.AddBinding(window_manager_.get(), request->Pass()); | 69 window_manager_binding_.AddBinding(window_manager_.get(), request->Pass()); |
| 70 requests_.clear(); | 70 requests_.clear(); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void WindowManagerApplication::OnConnectionLost( | 73 void WindowManagerApplication::OnConnectionLost( |
| 74 mus::WindowTreeConnection* connection) { | 74 mus::WindowTreeConnection* connection) { |
| 75 // TODO(sky): shutdown. | 75 // TODO(sky): shutdown. |
| 76 NOTIMPLEMENTED(); | 76 NOTIMPLEMENTED(); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 container < static_cast<uint16_t>(mash::wm::mojom::CONTAINER_COUNT); | 117 container < static_cast<uint16_t>(mash::wm::mojom::CONTAINER_COUNT); |
| 118 ++container) { | 118 ++container) { |
| 119 mus::Window* window = root_->connection()->NewWindow(); | 119 mus::Window* window = root_->connection()->NewWindow(); |
| 120 DCHECK_EQ(mus::LoWord(window->id()), container) | 120 DCHECK_EQ(mus::LoWord(window->id()), container) |
| 121 << "Containers must be created before other windows!"; | 121 << "Containers must be created before other windows!"; |
| 122 window->SetBounds(root_->bounds()); | 122 window->SetBounds(root_->bounds()); |
| 123 window->SetVisible(true); | 123 window->SetVisible(true); |
| 124 root_->AddChild(window); | 124 root_->AddChild(window); |
| 125 } | 125 } |
| 126 } | 126 } |
| OLD | NEW |