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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 } | 50 } |
51 | 51 |
52 void WindowManagerApplication::OnEmbed(mus::Window* root) { | 52 void WindowManagerApplication::OnEmbed(mus::Window* root) { |
53 root_ = root; | 53 root_ = root; |
54 root_->AddObserver(this); | 54 root_->AddObserver(this); |
55 CreateContainers(); | 55 CreateContainers(); |
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 |
| 61 mus::Window* window = |
| 62 GetWindowForContainer(mash::wm::mojom::CONTAINER_USER_WINDOWS); |
60 window_layout_.reset(new WindowLayout( | 63 window_layout_.reset(new WindowLayout( |
61 GetWindowForContainer(mash::wm::mojom::CONTAINER_USER_WINDOWS))); | 64 GetWindowForContainer(mash::wm::mojom::CONTAINER_USER_WINDOWS))); |
| 65 host_->AddActivationParent(window->id()); |
62 | 66 |
63 window_manager_.reset(new WindowManagerImpl(this)); | 67 window_manager_.reset(new WindowManagerImpl(this)); |
64 | 68 |
65 ui_init_.reset(new ui::mojo::UIInit(views::GetDisplaysFromWindow(root))); | 69 ui_init_.reset(new ui::mojo::UIInit(views::GetDisplaysFromWindow(root))); |
66 aura_init_.reset(new views::AuraInit(app_, "mash_wm_resources.pak")); | 70 aura_init_.reset(new views::AuraInit(app_, "mash_wm_resources.pak")); |
67 | 71 |
68 for (auto request : requests_) | 72 for (auto request : requests_) |
69 window_manager_binding_.AddBinding(window_manager_.get(), request->Pass()); | 73 window_manager_binding_.AddBinding(window_manager_.get(), request->Pass()); |
70 requests_.clear(); | 74 requests_.clear(); |
71 } | 75 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 container < static_cast<uint16_t>(mash::wm::mojom::CONTAINER_COUNT); | 123 container < static_cast<uint16_t>(mash::wm::mojom::CONTAINER_COUNT); |
120 ++container) { | 124 ++container) { |
121 mus::Window* window = root_->connection()->NewWindow(); | 125 mus::Window* window = root_->connection()->NewWindow(); |
122 DCHECK_EQ(mus::LoWord(window->id()), container) | 126 DCHECK_EQ(mus::LoWord(window->id()), container) |
123 << "Containers must be created before other windows!"; | 127 << "Containers must be created before other windows!"; |
124 window->SetBounds(root_->bounds()); | 128 window->SetBounds(root_->bounds()); |
125 window->SetVisible(true); | 129 window->SetVisible(true); |
126 root_->AddChild(window); | 130 root_->AddChild(window); |
127 } | 131 } |
128 } | 132 } |
OLD | NEW |