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" |
11 #include "base/debug/debugger.h" | 11 #include "base/debug/debugger.h" |
12 #include "base/i18n/icu_util.h" | 12 #include "base/i18n/icu_util.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
15 #include "base/process/launch.h" | 15 #include "base/process/launch.h" |
16 #include "components/mus/mus_app.h" | 16 #include "components/mus/mus_app.h" |
17 #include "components/resource_provider/resource_provider_app.h" | 17 #include "components/resource_provider/resource_provider_app.h" |
18 #include "content/public/common/content_switches.h" | 18 #include "content/public/common/content_switches.h" |
19 #include "mash/quick_launch/quick_launch_application.h" | 19 #include "mash/quick_launch/quick_launch_application.h" |
20 #include "mash/shell/shell_application_delegate.h" | 20 #include "mash/shell/shell_application_delegate.h" |
21 #include "mash/wm/window_manager_application.h" | 21 #include "mash/wm/window_manager_application.h" |
22 #include "mojo/common/mojo_scheme_register.h" | 22 #include "mojo/common/mojo_scheme_register.h" |
23 #include "mojo/public/cpp/bindings/weak_binding_set.h" | 23 #include "mojo/public/cpp/bindings/binding_set.h" |
24 #include "mojo/shell/background/background_shell.h" | 24 #include "mojo/shell/background/background_shell.h" |
25 #include "mojo/shell/identity.h" | 25 #include "mojo/shell/identity.h" |
26 #include "mojo/shell/native_runner_delegate.h" | 26 #include "mojo/shell/native_runner_delegate.h" |
27 #include "mojo/shell/public/cpp/shell_client.h" | 27 #include "mojo/shell/public/cpp/shell_client.h" |
28 #include "mojo/shell/public/cpp/shell_connection.h" | 28 #include "mojo/shell/public/cpp/shell_connection.h" |
29 #include "mojo/shell/public/interfaces/shell_client_factory.mojom.h" | 29 #include "mojo/shell/public/interfaces/shell_client_factory.mojom.h" |
30 #include "mojo/shell/runner/common/switches.h" | 30 #include "mojo/shell/runner/common/switches.h" |
31 #include "mojo/shell/runner/host/child_process_base.h" | 31 #include "mojo/shell/runner/host/child_process_base.h" |
32 #include "url/gurl.h" | 32 #include "url/gurl.h" |
33 #include "url/url_util.h" | 33 #include "url/url_util.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 return make_scoped_ptr( | 98 return make_scoped_ptr( |
99 new resource_provider::ResourceProviderApp("mojo:resource_provider")); | 99 new resource_provider::ResourceProviderApp("mojo:resource_provider")); |
100 } | 100 } |
101 #if defined(OS_LINUX) | 101 #if defined(OS_LINUX) |
102 if (url == GURL("mojo:font_service")) | 102 if (url == GURL("mojo:font_service")) |
103 return make_scoped_ptr(new font_service::FontServiceApp); | 103 return make_scoped_ptr(new font_service::FontServiceApp); |
104 #endif | 104 #endif |
105 return nullptr; | 105 return nullptr; |
106 } | 106 } |
107 | 107 |
108 mojo::WeakBindingSet<ShellClientFactory> shell_client_factory_bindings_; | 108 mojo::BindingSet<ShellClientFactory> shell_client_factory_bindings_; |
109 scoped_ptr<mojo::ShellClient> shell_client_; | 109 scoped_ptr<mojo::ShellClient> shell_client_; |
110 scoped_ptr<mojo::ShellConnection> shell_connection_; | 110 scoped_ptr<mojo::ShellConnection> shell_connection_; |
111 | 111 |
112 DISALLOW_COPY_AND_ASSIGN(DefaultShellClient); | 112 DISALLOW_COPY_AND_ASSIGN(DefaultShellClient); |
113 }; | 113 }; |
114 | 114 |
115 bool IsChild() { | 115 bool IsChild() { |
116 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 116 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
117 switches::kProcessType) && | 117 switches::kProcessType) && |
118 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 118 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 scoped_ptr<base::MessageLoop> message_loop; | 230 scoped_ptr<base::MessageLoop> message_loop; |
231 #if defined(OS_LINUX) | 231 #if defined(OS_LINUX) |
232 base::AtExitManager exit_manager; | 232 base::AtExitManager exit_manager; |
233 #endif | 233 #endif |
234 if (!IsChild()) | 234 if (!IsChild()) |
235 message_loop.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI)); | 235 message_loop.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI)); |
236 MashRunner mash_runner; | 236 MashRunner mash_runner; |
237 mash_runner.Run(); | 237 mash_runner.Run(); |
238 return 0; | 238 return 0; |
239 } | 239 } |
OLD | NEW |