Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(351)

Side by Side Diff: examples/native_run_app/native_run_app.cc

Issue 1977023003: ApplicationConnection devolution, part 4 (the end). (Closed) Base URL: https://github.com/domokit/mojo.git@work790_app_conn_devo_3.1
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 // (or "echo hello mojo"). 11 // (or "echo hello mojo").
12 // 12 //
13 // TODO(vtl): Maybe it should optionally be able to extract the binary path (and 13 // TODO(vtl): Maybe it should optionally be able to extract the binary path (and
14 // args) from the connection URL? 14 // args) from the connection URL?
15 15
16 #include <string.h> 16 #include <string.h>
17 17
18 #include <string> 18 #include <string>
19 #include <utility> 19 #include <utility>
20 #include <vector> 20 #include <vector>
21 21
22 #include "base/logging.h" 22 #include "base/logging.h"
23 #include "base/macros.h" 23 #include "base/macros.h"
24 #include "base/strings/string_split.h" 24 #include "base/strings/string_split.h"
25 #include "mojo/application/application_runner_chromium.h" 25 #include "mojo/application/application_runner_chromium.h"
26 #include "mojo/public/c/system/main.h" 26 #include "mojo/public/c/system/main.h"
27 #include "mojo/public/cpp/application/application_connection.h"
28 #include "mojo/public/cpp/application/application_delegate.h" 27 #include "mojo/public/cpp/application/application_delegate.h"
29 #include "mojo/public/cpp/application/application_impl.h" 28 #include "mojo/public/cpp/application/application_impl.h"
30 #include "mojo/public/cpp/application/connect.h" 29 #include "mojo/public/cpp/application/connect.h"
30 #include "mojo/public/cpp/application/service_provider_impl.h"
31 #include "mojo/public/cpp/bindings/interface_request.h" 31 #include "mojo/public/cpp/bindings/interface_request.h"
32 #include "mojo/public/cpp/bindings/strong_binding.h" 32 #include "mojo/public/cpp/bindings/strong_binding.h"
33 #include "mojo/services/files/interfaces/files.mojom.h" 33 #include "mojo/services/files/interfaces/files.mojom.h"
34 #include "mojo/services/files/interfaces/ioctl.mojom.h" 34 #include "mojo/services/files/interfaces/ioctl.mojom.h"
35 #include "mojo/services/files/interfaces/ioctl_terminal.mojom.h" 35 #include "mojo/services/files/interfaces/ioctl_terminal.mojom.h"
36 #include "mojo/services/files/interfaces/types.mojom.h" 36 #include "mojo/services/files/interfaces/types.mojom.h"
37 #include "mojo/services/native_support/interfaces/process.mojom.h" 37 #include "mojo/services/native_support/interfaces/process.mojom.h"
38 #include "mojo/services/terminal/interfaces/terminal_client.mojom.h" 38 #include "mojo/services/terminal/interfaces/terminal_client.mojom.h"
39 39
40 using mojo::terminal::TerminalClient; 40 using mojo::terminal::TerminalClient;
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 mojo::ApplicationImpl* application_impl_; 248 mojo::ApplicationImpl* application_impl_;
249 native_support::ProcessPtr native_support_process_; 249 native_support::ProcessPtr native_support_process_;
250 250
251 DISALLOW_COPY_AND_ASSIGN(NativeRunApp); 251 DISALLOW_COPY_AND_ASSIGN(NativeRunApp);
252 }; 252 };
253 253
254 MojoResult MojoMain(MojoHandle application_request) { 254 MojoResult MojoMain(MojoHandle application_request) {
255 mojo::ApplicationRunnerChromium runner(new NativeRunApp()); 255 mojo::ApplicationRunnerChromium runner(new NativeRunApp());
256 return runner.Run(application_request); 256 return runner.Run(application_request);
257 } 257 }
OLDNEW
« no previous file with comments | « examples/moterm_example_app/moterm_example_app.cc ('k') | examples/recursive_content_handler/recursive_content_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698