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

Side by Side Diff: mojo/examples/surfaces_app/child_app.cc

Issue 361123002: Mojo surfaces service and example app (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "mojo/examples/surfaces_app/child_impl.h"
6 #include "mojo/public/cpp/application/application_connection.h"
7 #include "mojo/public/cpp/application/application_delegate.h"
8 #include "mojo/public/cpp/application/application_impl.h"
9 #include "mojo/public/cpp/bindings/string.h"
10
11 namespace mojo {
12 namespace examples {
13
14 class ChildApp : public ApplicationDelegate, public ChildImpl::Context {
15 public:
16 ChildApp() {}
17 virtual ~ChildApp() {}
18
19 virtual void Initialize(ApplicationImpl* app) OVERRIDE { app_ = app; }
20
21 // ApplicationDelegate implementation.
22 virtual bool ConfigureIncomingConnection(
23 ApplicationConnection* connection) OVERRIDE {
24 connection->AddService<ChildImpl>(this);
25 return true;
26 }
27
28 // ChildImpl::Context implementation.
29 virtual ApplicationConnection* ShellConnection(
30 const mojo::String& application_url) OVERRIDE {
31 return app_->ConnectToApplication(application_url);
32 }
33
34 private:
35 ApplicationImpl* app_;
36
37 DISALLOW_COPY_AND_ASSIGN(ChildApp);
38 };
39
40 } // namespace examples
41
42 // static
43 ApplicationDelegate* ApplicationDelegate::Create() {
44 return new examples::ChildApp();
45 }
46
47 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698