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

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

Issue 1975993002: Change InterfaceFactory<I>::Create() to take a ConnectionContext instead of an ApplicationConnectio… (Closed) Base URL: https://github.com/domokit/mojo.git@master
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"
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « examples/indirect_service/integer_service.cc ('k') | mojo/application/content_handler_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698