diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-03 05:39:00 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-03 05:39:00 +0000 |
commit | 8dbcf0de0787507c255f15c4d47bbda86fd35f1b (patch) | |
tree | 4f7e44dafe2a431717c6c00081b2c6b18813a070 /mojo/examples/demo_launcher | |
parent | 690d3e34dcdd4dfcac08eeafe654bb86889db80b (diff) | |
download | chromium_src-8dbcf0de0787507c255f15c4d47bbda86fd35f1b.zip chromium_src-8dbcf0de0787507c255f15c4d47bbda86fd35f1b.tar.gz chromium_src-8dbcf0de0787507c255f15c4d47bbda86fd35f1b.tar.bz2 |
Implement a demo that shows one app embedding rendering in another.
launcher inits the view manager, running the "window manager" app @ root.
window manager embeds another app.
** not tested by main chrome integration testing **
R=sky@chromium.org
TEST=mojo_shell --origin=http://127.0.0.1:4444 --disable-cache mojo:mojo_demo_launcher
http://crbug.com/365012
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=274322
Review URL: https://codereview.chromium.org/303163005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274422 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'mojo/examples/demo_launcher')
-rw-r--r-- | mojo/examples/demo_launcher/demo_launcher.cc | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/mojo/examples/demo_launcher/demo_launcher.cc b/mojo/examples/demo_launcher/demo_launcher.cc new file mode 100644 index 0000000..def2e4d --- /dev/null +++ b/mojo/examples/demo_launcher/demo_launcher.cc @@ -0,0 +1,43 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/basictypes.h" +#include "base/bind.h" +#include "base/run_loop.h" +#include "mojo/public/cpp/application/application.h" +#include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h" + +namespace mojo { +namespace examples { + +class DemoLauncher : public Application { + public: + DemoLauncher() {} + virtual ~DemoLauncher() {} + + private: + // Overridden from Application: + virtual void Initialize() MOJO_OVERRIDE { + ConnectTo<view_manager::IViewManagerInit>("mojo:mojo_view_manager", + &view_manager_init_); + view_manager_init_->Connect("mojo:mojo_window_manager", + base::Bind(&DemoLauncher::OnConnect, + base::Unretained(this))); + } + + void OnConnect(bool success) {} + + view_manager::IViewManagerInitPtr view_manager_init_; + + DISALLOW_COPY_AND_ASSIGN(DemoLauncher); +}; + +} // namespace examples + +// static +Application* Application::Create() { + return new examples::DemoLauncher; +} + +} // namespace mojo |