OLD | NEW |
(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 "base/basictypes.h" |
| 6 #include "base/bind.h" |
| 7 #include "mojo/public/cpp/application/application.h" |
| 8 #include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h" |
| 9 |
| 10 namespace mojo { |
| 11 namespace examples { |
| 12 |
| 13 // ViewManagerInit is responsible for establishing the initial connection to |
| 14 // the view manager. When established it loads |mojo_aura_demo|. |
| 15 class ViewManagerInit : public Application { |
| 16 public: |
| 17 ViewManagerInit() {} |
| 18 virtual ~ViewManagerInit() {} |
| 19 |
| 20 virtual void Initialize() OVERRIDE { |
| 21 ConnectTo("mojo:mojo_view_manager", &view_manager_init_); |
| 22 view_manager_init_->Connect("mojo:mojo_aura_demo", |
| 23 base::Bind(&ViewManagerInit::DidConnect, |
| 24 base::Unretained(this))); |
| 25 } |
| 26 |
| 27 private: |
| 28 void DidConnect(bool result) { |
| 29 DCHECK(result); |
| 30 VLOG(1) << "ViewManagerInit::DidConnection result=" << result; |
| 31 } |
| 32 |
| 33 view_manager::IViewManagerInitPtr view_manager_init_; |
| 34 |
| 35 DISALLOW_COPY_AND_ASSIGN(ViewManagerInit); |
| 36 }; |
| 37 |
| 38 } // namespace examples |
| 39 |
| 40 // static |
| 41 Application* Application::Create() { |
| 42 return new examples::ViewManagerInit(); |
| 43 } |
| 44 |
| 45 } // namespace mojo |
| 46 |
OLD | NEW |