| 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 <unordered_map> | 7 #include <unordered_map> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 shell_->InitInstanceForEmbedder(kBrowserMojoApplicationName), | 271 shell_->InitInstanceForEmbedder(kBrowserMojoApplicationName), |
| 272 false /* is_external */); | 272 false /* is_external */); |
| 273 } | 273 } |
| 274 GetContentClient()->browser()->AddMojoShellConnectionListeners(); | 274 GetContentClient()->browser()->AddMojoShellConnectionListeners(); |
| 275 | 275 |
| 276 std::unique_ptr<BrowserShellConnection> browser_shell_connection( | 276 std::unique_ptr<BrowserShellConnection> browser_shell_connection( |
| 277 new BrowserShellConnection); | 277 new BrowserShellConnection); |
| 278 | 278 |
| 279 ContentBrowserClient::StaticMojoApplicationMap apps; | 279 ContentBrowserClient::StaticMojoApplicationMap apps; |
| 280 GetContentClient()->browser()->RegisterInProcessMojoApplications(&apps); | 280 GetContentClient()->browser()->RegisterInProcessMojoApplications(&apps); |
| 281 for (const auto& entry : apps) { | 281 for (const auto& entry : apps) |
| 282 browser_shell_connection->AddEmbeddedApplication( | 282 browser_shell_connection->AddEmbeddedApplication(entry.first, entry.second); |
| 283 entry.first, entry.second.application_factory, | |
| 284 entry.second.application_task_runner); | |
| 285 } | |
| 286 | 283 |
| 287 ContentBrowserClient::OutOfProcessMojoApplicationMap sandboxed_apps; | 284 ContentBrowserClient::OutOfProcessMojoApplicationMap sandboxed_apps; |
| 288 GetContentClient() | 285 GetContentClient() |
| 289 ->browser() | 286 ->browser() |
| 290 ->RegisterOutOfProcessMojoApplications(&sandboxed_apps); | 287 ->RegisterOutOfProcessMojoApplications(&sandboxed_apps); |
| 291 for (const auto& app : sandboxed_apps) { | 288 for (const auto& app : sandboxed_apps) { |
| 292 browser_shell_connection->AddShellClientRequestHandler( | 289 browser_shell_connection->AddShellClientRequestHandler( |
| 293 app.first, | 290 app.first, |
| 294 base::Bind(&LaunchAppInUtilityProcess, app.first, app.second, | 291 base::Bind(&LaunchAppInUtilityProcess, app.first, app.second, |
| 295 true /* use_sandbox */)); | 292 true /* use_sandbox */)); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 shell::Identity source_id(requestor_name, user_id); | 345 shell::Identity source_id(requestor_name, user_id); |
| 349 params->set_source(source_id); | 346 params->set_source(source_id); |
| 350 params->set_target(shell::Identity(name, user_id)); | 347 params->set_target(shell::Identity(name, user_id)); |
| 351 params->set_remote_interfaces(std::move(request)); | 348 params->set_remote_interfaces(std::move(request)); |
| 352 params->set_local_interfaces(std::move(exposed_services)); | 349 params->set_local_interfaces(std::move(exposed_services)); |
| 353 params->set_connect_callback(callback); | 350 params->set_connect_callback(callback); |
| 354 shell_->Connect(std::move(params)); | 351 shell_->Connect(std::move(params)); |
| 355 } | 352 } |
| 356 | 353 |
| 357 } // namespace content | 354 } // namespace content |
| OLD | NEW |