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 "content/browser/mojo/mojo_shell_context.h" | 5 #include "content/browser/mojo/mojo_shell_context.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
12 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
13 #include "base/thread_task_runner_handle.h" | 13 #include "base/thread_task_runner_handle.h" |
| 14 #include "components/profile_service/profile_app.h" |
14 #include "content/browser/gpu/gpu_process_host.h" | 15 #include "content/browser/gpu/gpu_process_host.h" |
15 #include "content/common/gpu/gpu_process_launch_causes.h" | 16 #include "content/common/gpu/gpu_process_launch_causes.h" |
16 #include "content/common/mojo/mojo_shell_connection_impl.h" | 17 #include "content/common/mojo/mojo_shell_connection_impl.h" |
17 #include "content/common/mojo/static_application_loader.h" | 18 #include "content/common/mojo/static_application_loader.h" |
18 #include "content/common/process_control.mojom.h" | 19 #include "content/common/process_control.mojom.h" |
19 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
20 #include "content/public/browser/content_browser_client.h" | 21 #include "content/public/browser/content_browser_client.h" |
21 #include "content/public/browser/utility_process_host.h" | 22 #include "content/public/browser/utility_process_host.h" |
22 #include "content/public/browser/utility_process_host_client.h" | 23 #include "content/public/browser/utility_process_host_client.h" |
23 #include "content/public/common/content_client.h" | 24 #include "content/public/common/content_client.h" |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 new UtilityProcessLoader(app.second, false /* use_sandbox */)), | 254 new UtilityProcessLoader(app.second, false /* use_sandbox */)), |
254 app.first); | 255 app.first); |
255 } | 256 } |
256 | 257 |
257 #if (ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) | 258 #if (ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) |
258 application_manager_->SetLoaderForURL( | 259 application_manager_->SetLoaderForURL( |
259 scoped_ptr<mojo::shell::ApplicationLoader>(new GpuProcessLoader()), | 260 scoped_ptr<mojo::shell::ApplicationLoader>(new GpuProcessLoader()), |
260 GURL("mojo:media")); | 261 GURL("mojo:media")); |
261 #endif | 262 #endif |
262 | 263 |
| 264 base::Callback<scoped_ptr<mojo::ShellClient>()> profile_callback = |
| 265 base::Bind(&profile::CreateProfileApp); |
| 266 application_manager_->SetLoaderForURL( |
| 267 scoped_ptr<mojo::shell::ApplicationLoader>( |
| 268 new StaticApplicationLoader(profile_callback)), |
| 269 GURL("mojo:profile")); |
| 270 |
263 if (!IsRunningInMojoShell()) { | 271 if (!IsRunningInMojoShell()) { |
264 MojoShellConnectionImpl::Create( | 272 MojoShellConnectionImpl::Create( |
265 application_manager_->InitInstanceForEmbedder(GURL(kBrowserAppUrl))); | 273 application_manager_->InitInstanceForEmbedder(GURL(kBrowserAppUrl))); |
266 } | 274 } |
267 } | 275 } |
268 | 276 |
269 MojoShellContext::~MojoShellContext() { | 277 MojoShellContext::~MojoShellContext() { |
270 if (!IsRunningInMojoShell()) | 278 if (!IsRunningInMojoShell()) |
271 MojoShellConnectionImpl::Destroy(); | 279 MojoShellConnectionImpl::Destroy(); |
272 } | 280 } |
(...skipping 26 matching lines...) Expand all Loading... |
299 params->set_source(source_id); | 307 params->set_source(source_id); |
300 params->set_target(mojo::shell::Identity( | 308 params->set_target(mojo::shell::Identity( |
301 url, std::string(), mojo::shell::mojom::Connector::kUserRoot)); | 309 url, std::string(), mojo::shell::mojom::Connector::kUserRoot)); |
302 params->set_remote_interfaces(std::move(request)); | 310 params->set_remote_interfaces(std::move(request)); |
303 params->set_local_interfaces(std::move(exposed_services)); | 311 params->set_local_interfaces(std::move(exposed_services)); |
304 params->set_connect_callback(callback); | 312 params->set_connect_callback(callback); |
305 application_manager_->Connect(std::move(params)); | 313 application_manager_->Connect(std::move(params)); |
306 } | 314 } |
307 | 315 |
308 } // namespace content | 316 } // namespace content |
OLD | NEW |