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 // This is a terminal client (i.e., a "raw" |mojo.terminal.Terminal| -- e.g., | 5 // This is a terminal client (i.e., a "raw" |mojo.terminal.Terminal| -- e.g., |
6 // moterm -- can be asked to talk to this) that prompts the user for a native | 6 // moterm -- can be asked to talk to this) that prompts the user for a native |
7 // (Linux) binary to run and then does so (via mojo:native_support). | 7 // (Linux) binary to run and then does so (via mojo:native_support). |
8 // | 8 // |
9 // E.g., first run mojo:moterm_example_app (embedded by a window manager). Then, | 9 // E.g., first run mojo:moterm_example_app (embedded by a window manager). Then, |
10 // at the prompt, enter "mojo:native_run_app". At the next prompt, enter "bash" | 10 // at the prompt, enter "mojo:native_run_app". At the next prompt, enter "bash" |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 GetProxy(&native_support_process_)); | 236 GetProxy(&native_support_process_)); |
237 } | 237 } |
238 | 238 |
239 bool ConfigureIncomingConnection( | 239 bool ConfigureIncomingConnection( |
240 mojo::ApplicationConnection* connection) override { | 240 mojo::ApplicationConnection* connection) override { |
241 connection->AddService<TerminalClient>(this); | 241 connection->AddService<TerminalClient>(this); |
242 return true; | 242 return true; |
243 } | 243 } |
244 | 244 |
245 // |InterfaceFactory<TerminalClient>| implementation: | 245 // |InterfaceFactory<TerminalClient>| implementation: |
246 void Create(mojo::ApplicationConnection* /*connection*/, | 246 void Create(const mojo::ConnectionContext& /*connection_context*/, |
247 mojo::InterfaceRequest<TerminalClient> request) override { | 247 mojo::InterfaceRequest<TerminalClient> request) override { |
248 new TerminalClientImpl(request.Pass(), native_support_process_.get()); | 248 new TerminalClientImpl(request.Pass(), native_support_process_.get()); |
249 } | 249 } |
250 | 250 |
251 mojo::ApplicationImpl* application_impl_; | 251 mojo::ApplicationImpl* application_impl_; |
252 native_support::ProcessPtr native_support_process_; | 252 native_support::ProcessPtr native_support_process_; |
253 | 253 |
254 DISALLOW_COPY_AND_ASSIGN(NativeRunApp); | 254 DISALLOW_COPY_AND_ASSIGN(NativeRunApp); |
255 }; | 255 }; |
256 | 256 |
257 MojoResult MojoMain(MojoHandle application_request) { | 257 MojoResult MojoMain(MojoHandle application_request) { |
258 mojo::ApplicationRunnerChromium runner(new NativeRunApp()); | 258 mojo::ApplicationRunnerChromium runner(new NativeRunApp()); |
259 return runner.Run(application_request); | 259 return runner.Run(application_request); |
260 } | 260 } |
OLD | NEW |