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/sysui_application.h" | 5 #include "ash/mus/sysui_application.h" |
6 | 6 |
7 #include "ash/desktop_background/desktop_background_controller.h" | 7 #include "ash/desktop_background/desktop_background_controller.h" |
8 #include "ash/host/ash_window_tree_host_init_params.h" | 8 #include "ash/host/ash_window_tree_host_init_params.h" |
9 #include "ash/host/ash_window_tree_host_platform.h" | 9 #include "ash/host/ash_window_tree_host_platform.h" |
| 10 #include "ash/mojo_shell.h" |
10 #include "ash/mus/shell_delegate_mus.h" | 11 #include "ash/mus/shell_delegate_mus.h" |
11 #include "ash/mus/stub_context_factory.h" | 12 #include "ash/mus/stub_context_factory.h" |
12 #include "ash/root_window_settings.h" | 13 #include "ash/root_window_settings.h" |
13 #include "ash/shell.h" | 14 #include "ash/shell.h" |
14 #include "ash/shell_init_params.h" | 15 #include "ash/shell_init_params.h" |
15 #include "ash/shell_window_ids.h" | 16 #include "ash/shell_window_ids.h" |
16 #include "base/threading/sequenced_worker_pool.h" | 17 #include "base/threading/sequenced_worker_pool.h" |
17 #include "components/mus/public/cpp/property_type_converters.h" | 18 #include "components/mus/public/cpp/property_type_converters.h" |
18 #include "mash/wm/public/interfaces/container.mojom.h" | 19 #include "mash/wm/public/interfaces/container.mojom.h" |
19 #include "ui/aura/env.h" | 20 #include "ui/aura/env.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 ui::RegisterPathProvider(); | 123 ui::RegisterPathProvider(); |
123 ui::ResourceBundle::InitSharedInstanceWithLocale( | 124 ui::ResourceBundle::InitSharedInstanceWithLocale( |
124 "en-US", nullptr, ui::ResourceBundle::LOAD_COMMON_RESOURCES); | 125 "en-US", nullptr, ui::ResourceBundle::LOAD_COMMON_RESOURCES); |
125 } | 126 } |
126 | 127 |
127 ~AshInit() { worker_pool_->Shutdown(); } | 128 ~AshInit() { worker_pool_->Shutdown(); } |
128 | 129 |
129 aura::Window* root() { return ash::Shell::GetPrimaryRootWindow(); } | 130 aura::Window* root() { return ash::Shell::GetPrimaryRootWindow(); } |
130 | 131 |
131 void Initialize(mojo::Shell* shell) { | 132 void Initialize(mojo::Shell* shell) { |
| 133 SetMojoShell(shell); |
| 134 |
132 aura_init_.reset(new views::AuraInit(shell, "views_mus_resources.pak")); | 135 aura_init_.reset(new views::AuraInit(shell, "views_mus_resources.pak")); |
133 views::WindowManagerConnection::Create(shell); | 136 views::WindowManagerConnection::Create(shell); |
134 | 137 |
135 gfx::Screen* screen = gfx::Screen::GetScreen(); | 138 gfx::Screen* screen = gfx::Screen::GetScreen(); |
136 DCHECK(screen); | 139 DCHECK(screen); |
137 gfx::Size size = screen->GetPrimaryDisplay().bounds().size(); | 140 gfx::Size size = screen->GetPrimaryDisplay().bounds().size(); |
138 | 141 |
139 // Uninstall the ScreenMus installed by WindowManagerConnection, so that ash | 142 // Uninstall the ScreenMus installed by WindowManagerConnection, so that ash |
140 // installs and uses the ScreenAsh. This can be removed once ash learns to | 143 // installs and uses the ScreenAsh. This can be removed once ash learns to |
141 // talk to mus for managing displays. | 144 // talk to mus for managing displays. |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 | 201 |
199 void SysUIApplication::Initialize(mojo::Shell* shell, | 202 void SysUIApplication::Initialize(mojo::Shell* shell, |
200 const std::string& url, | 203 const std::string& url, |
201 uint32_t id) { | 204 uint32_t id) { |
202 ash_init_.reset(new AshInit()); | 205 ash_init_.reset(new AshInit()); |
203 ash_init_->Initialize(shell); | 206 ash_init_->Initialize(shell); |
204 } | 207 } |
205 | 208 |
206 } // namespace sysui | 209 } // namespace sysui |
207 } // namespace ash | 210 } // namespace ash |
OLD | NEW |