Chromium Code Reviews| Index: mojo/examples/demo_launcher/demo_launcher.cc |
| diff --git a/mojo/examples/demo_launcher/demo_launcher.cc b/mojo/examples/demo_launcher/demo_launcher.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..96a8ba4f790ce5811cc55c3bcd3e583fe3ab5d75 |
| --- /dev/null |
| +++ b/mojo/examples/demo_launcher/demo_launcher.cc |
| @@ -0,0 +1,44 @@ |
| +// 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))); |
| + base::RunLoop().Run(); |
|
sky
2014/06/02 19:14:59
Are you sure you need 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 |