| 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 "chrome/app/mash/mash_runner.h" | 5 #include "chrome/app/mash/mash_runner.h" |
| 6 | 6 |
| 7 #include "ash/mus/sysui_application.h" | 7 #include "ash/mus/sysui_application.h" |
| 8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 mojo::shell::BackgroundShell background_shell; | 183 mojo::shell::BackgroundShell background_shell; |
| 184 scoped_ptr<mojo::shell::BackgroundShell::InitParams> init_params( | 184 scoped_ptr<mojo::shell::BackgroundShell::InitParams> init_params( |
| 185 new mojo::shell::BackgroundShell::InitParams); | 185 new mojo::shell::BackgroundShell::InitParams); |
| 186 init_params->native_runner_delegate = &native_runner_delegate; | 186 init_params->native_runner_delegate = &native_runner_delegate; |
| 187 background_shell.Init(std::move(init_params)); | 187 background_shell.Init(std::move(init_params)); |
| 188 shell_client_.reset(new DefaultShellClient); | 188 shell_client_.reset(new DefaultShellClient); |
| 189 shell_connection_.reset(new mojo::ShellConnection( | 189 shell_connection_.reset(new mojo::ShellConnection( |
| 190 shell_client_.get(), | 190 shell_client_.get(), |
| 191 background_shell.CreateShellClientRequest(GURL("exe:chrome_mash")))); | 191 background_shell.CreateShellClientRequest(GURL("exe:chrome_mash")))); |
| 192 shell_connection_->WaitForInitialize(); | 192 shell_connection_->WaitForInitialize(); |
| 193 static_cast<mojo::Shell*>(shell_connection_.get()) | 193 shell_connection_->connector()->Connect("mojo:mash_shell"); |
| 194 ->Connect("mojo:mash_shell"); | |
| 195 base::MessageLoop::current()->Run(); | 194 base::MessageLoop::current()->Run(); |
| 196 } | 195 } |
| 197 | 196 |
| 198 void MashRunner::RunChild() { | 197 void MashRunner::RunChild() { |
| 199 base::i18n::InitializeICU(); | 198 base::i18n::InitializeICU(); |
| 200 mojo::shell::ChildProcessMain( | 199 mojo::shell::ChildProcessMain( |
| 201 base::Bind(&MashRunner::StartChildApp, base::Unretained(this))); | 200 base::Bind(&MashRunner::StartChildApp, base::Unretained(this))); |
| 202 } | 201 } |
| 203 | 202 |
| 204 void MashRunner::StartChildApp( | 203 void MashRunner::StartChildApp( |
| (...skipping 25 matching lines...) Expand all Loading... |
| 230 scoped_ptr<base::MessageLoop> message_loop; | 229 scoped_ptr<base::MessageLoop> message_loop; |
| 231 #if defined(OS_LINUX) | 230 #if defined(OS_LINUX) |
| 232 base::AtExitManager exit_manager; | 231 base::AtExitManager exit_manager; |
| 233 #endif | 232 #endif |
| 234 if (!IsChild()) | 233 if (!IsChild()) |
| 235 message_loop.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI)); | 234 message_loop.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI)); |
| 236 MashRunner mash_runner; | 235 MashRunner mash_runner; |
| 237 mash_runner.Run(); | 236 mash_runner.Run(); |
| 238 return 0; | 237 return 0; |
| 239 } | 238 } |
| OLD | NEW |