| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 #include "mojo/public/cpp/application/application.h" | 5 #include "mojo/public/cpp/application/application.h" |
| 6 #include "mojo/services/view_manager/root_node_manager.h" | 6 #include "mojo/services/view_manager/view_manager_init_connection.h" |
| 7 #include "mojo/services/view_manager/view_manager_connection.h" | |
| 8 | 7 |
| 9 namespace mojo { | 8 namespace mojo { |
| 10 namespace view_manager { | 9 namespace view_manager { |
| 11 namespace service { | 10 namespace service { |
| 12 | 11 |
| 13 class ViewManagerApp : public Application { | 12 class ViewManagerApp : public Application { |
| 14 public: | 13 public: |
| 15 ViewManagerApp() {} | 14 ViewManagerApp() {} |
| 16 virtual ~ViewManagerApp() {} | 15 virtual ~ViewManagerApp() {} |
| 17 | 16 |
| 18 virtual void Initialize() MOJO_OVERRIDE { | 17 virtual void Initialize() MOJO_OVERRIDE { |
| 19 root_node_manager_.reset(new RootNodeManager(service_provider())); | 18 // TODO(sky): this needs some sort of authentication as well as making sure |
| 20 AddService<ViewManagerConnection>(root_node_manager_.get()); | 19 // we only ever have one active at a time. |
| 20 AddService<ViewManagerInitConnection>(service_provider()); |
| 21 } | 21 } |
| 22 | 22 |
| 23 private: | 23 private: |
| 24 scoped_ptr<RootNodeManager> root_node_manager_; | |
| 25 DISALLOW_COPY_AND_ASSIGN(ViewManagerApp); | 24 DISALLOW_COPY_AND_ASSIGN(ViewManagerApp); |
| 26 }; | 25 }; |
| 27 | 26 |
| 28 } | 27 } // namespace service |
| 29 } | 28 } // namespace view_manager |
| 30 | 29 |
| 31 // static | 30 // static |
| 32 Application* Application::Create() { | 31 Application* Application::Create() { |
| 33 return new mojo::view_manager::service::ViewManagerApp(); | 32 return new mojo::view_manager::service::ViewManagerApp(); |
| 34 } | 33 } |
| 35 | 34 |
| 36 } | 35 } // namespace mojo |
| OLD | NEW |