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 <stdint.h> | 7 #include <stdint.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "components/mus/common/util.h" | 11 #include "components/mus/common/util.h" |
12 #include "components/mus/public/cpp/event_matcher.h" | 12 #include "components/mus/public/cpp/event_matcher.h" |
13 #include "components/mus/public/cpp/window.h" | 13 #include "components/mus/public/cpp/window.h" |
14 #include "components/mus/public/cpp/window_tree_connection.h" | 14 #include "components/mus/public/cpp/window_tree_connection.h" |
15 #include "components/mus/public/cpp/window_tree_host_factory.h" | 15 #include "components/mus/public/cpp/window_tree_host_factory.h" |
16 #include "mash/wm/accelerator_registrar_impl.h" | 16 #include "mash/wm/accelerator_registrar_impl.h" |
17 #include "mash/wm/background_layout.h" | 17 #include "mash/wm/background_layout.h" |
| 18 #include "mash/wm/screenlock_layout.h" |
18 #include "mash/wm/shadow_controller.h" | 19 #include "mash/wm/shadow_controller.h" |
19 #include "mash/wm/shelf_layout.h" | 20 #include "mash/wm/shelf_layout.h" |
20 #include "mash/wm/user_window_controller_impl.h" | 21 #include "mash/wm/user_window_controller_impl.h" |
21 #include "mash/wm/window_layout.h" | 22 #include "mash/wm/window_layout.h" |
22 #include "mash/wm/window_manager_impl.h" | 23 #include "mash/wm/window_manager_impl.h" |
23 #include "mojo/services/tracing/public/cpp/tracing_impl.h" | 24 #include "mojo/services/tracing/public/cpp/tracing_impl.h" |
24 #include "mojo/shell/public/cpp/application_connection.h" | 25 #include "mojo/shell/public/cpp/application_connection.h" |
25 #include "ui/mojo/init/ui_init.h" | 26 #include "ui/mojo/init/ui_init.h" |
26 #include "ui/views/mus/aura_init.h" | 27 #include "ui/views/mus/aura_init.h" |
27 #include "ui/views/mus/display_converter.h" | 28 #include "ui/views/mus/display_converter.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 } | 113 } |
113 } | 114 } |
114 } | 115 } |
115 | 116 |
116 void WindowManagerApplication::OnEmbed(mus::Window* root) { | 117 void WindowManagerApplication::OnEmbed(mus::Window* root) { |
117 root_ = root; | 118 root_ = root; |
118 root_->AddObserver(this); | 119 root_->AddObserver(this); |
119 CreateContainers(); | 120 CreateContainers(); |
120 background_layout_.reset(new BackgroundLayout( | 121 background_layout_.reset(new BackgroundLayout( |
121 GetWindowForContainer(mojom::Container::USER_BACKGROUND))); | 122 GetWindowForContainer(mojom::Container::USER_BACKGROUND))); |
122 shelf_layout_.reset( | 123 screenlock_layout_.reset(new ScreenlockLayout(GetWindowForContainer( |
123 new ShelfLayout(GetWindowForContainer(mojom::Container::USER_SHELF))); | 124 mojom::Container::LOGIN_WINDOWS))); |
| 125 shelf_layout_.reset(new ShelfLayout(GetWindowForContainer( |
| 126 mojom::Container::USER_SHELF))); |
124 | 127 |
125 mus::Window* window = GetWindowForContainer(mojom::Container::USER_WINDOWS); | 128 mus::Window* window = GetWindowForContainer(mojom::Container::USER_WINDOWS); |
126 window_layout_.reset( | 129 window_layout_.reset( |
127 new WindowLayout(GetWindowForContainer(mojom::Container::USER_WINDOWS))); | 130 new WindowLayout(GetWindowForContainer(mojom::Container::USER_WINDOWS))); |
128 window_tree_host_->AddActivationParent(window->id()); | 131 window_tree_host_->AddActivationParent(window->id()); |
129 window_tree_host_->SetTitle("Mash"); | 132 window_tree_host_->SetTitle("Mash"); |
130 | 133 |
131 AddAccelerators(); | 134 AddAccelerators(); |
132 | 135 |
133 ui_init_.reset(new ui::mojo::UIInit(views::GetDisplaysFromWindow(root))); | 136 ui_init_.reset(new ui::mojo::UIInit(views::GetDisplaysFromWindow(root))); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 DCHECK_EQ(mus::LoWord(window->id()), container) | 221 DCHECK_EQ(mus::LoWord(window->id()), container) |
219 << "Containers must be created before other windows!"; | 222 << "Containers must be created before other windows!"; |
220 window->SetBounds(root_->bounds()); | 223 window->SetBounds(root_->bounds()); |
221 window->SetVisible(true); | 224 window->SetVisible(true); |
222 root_->AddChild(window); | 225 root_->AddChild(window); |
223 } | 226 } |
224 } | 227 } |
225 | 228 |
226 } // namespace wm | 229 } // namespace wm |
227 } // namespace mash | 230 } // namespace mash |
OLD | NEW |