| 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 #ifndef MOJO_SHELL_VIEW_MANAGER_LOADER_H_ | 5 #ifndef MOJO_SHELL_VIEW_MANAGER_LOADER_H_ |
| 6 #define MOJO_SHELL_VIEW_MANAGER_LOADER_H_ | 6 #define MOJO_SHELL_VIEW_MANAGER_LOADER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" |
| 8 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| 10 #include "mojo/application_manager/application_loader.h" | 11 #include "mojo/application_manager/application_loader.h" |
| 11 #include "mojo/public/cpp/application/application_delegate.h" | 12 #include "mojo/public/cpp/application/application_delegate.h" |
| 12 #include "mojo/public/cpp/application/interface_factory.h" | 13 #include "mojo/public/cpp/application/interface_factory.h" |
| 13 #include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h" | 14 #include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h" |
| 14 #include "mojo/services/view_manager/view_manager_init_service_context.h" | 15 #include "mojo/services/view_manager/view_manager_init_service_context.h" |
| 15 | 16 |
| 16 namespace mojo { | 17 namespace mojo { |
| 17 | 18 |
| 18 class Application; | 19 class Application; |
| 19 | 20 |
| 20 namespace shell { | 21 namespace shell { |
| 21 | 22 |
| 22 // ApplicationLoader responsible for creating connections to the ViewManager. | 23 // ApplicationLoader responsible for creating connections to the ViewManager. |
| 23 class ViewManagerLoader : public ApplicationLoader, | 24 class ViewManagerLoader : public ApplicationLoader, |
| 24 public ApplicationDelegate, | 25 public ApplicationDelegate, |
| 25 public InterfaceFactory<ViewManagerInitService> { | 26 public InterfaceFactory<ViewManagerInitService> { |
| 26 public: | 27 public: |
| 27 ViewManagerLoader(); | 28 ViewManagerLoader(); |
| 28 virtual ~ViewManagerLoader(); | 29 virtual ~ViewManagerLoader(); |
| 29 | 30 |
| 30 private: | 31 private: |
| 31 // ApplicationLoader overrides: | 32 // ApplicationLoader overrides: |
| 32 virtual void Load(ApplicationManager* manager, | 33 virtual void Load(ApplicationManager* manager, |
| 33 const GURL& url, | 34 const GURL& url, |
| 34 scoped_refptr<LoadCallbacks> callbacks) OVERRIDE; | 35 scoped_refptr<LoadCallbacks> callbacks) override; |
| 35 virtual void OnApplicationError(ApplicationManager* manager, | 36 virtual void OnApplicationError(ApplicationManager* manager, |
| 36 const GURL& url) OVERRIDE; | 37 const GURL& url) override; |
| 37 | 38 |
| 38 // ApplicationDelegate overrides. | 39 // ApplicationDelegate overrides. |
| 39 virtual bool ConfigureIncomingConnection( | 40 virtual bool ConfigureIncomingConnection( |
| 40 mojo::ApplicationConnection* connection) OVERRIDE; | 41 mojo::ApplicationConnection* connection) override; |
| 41 | 42 |
| 42 // InterfaceFactory<ViewManagerInitService> overrides. | 43 // InterfaceFactory<ViewManagerInitService> overrides. |
| 43 virtual void Create( | 44 virtual void Create( |
| 44 ApplicationConnection* connection, | 45 ApplicationConnection* connection, |
| 45 InterfaceRequest<ViewManagerInitService> request) OVERRIDE; | 46 InterfaceRequest<ViewManagerInitService> request) override; |
| 46 | 47 |
| 47 ScopedVector<Application> apps_; | 48 ScopedVector<Application> apps_; |
| 48 service::ViewManagerInitServiceContext context_; | 49 service::ViewManagerInitServiceContext context_; |
| 49 | 50 |
| 50 DISALLOW_COPY_AND_ASSIGN(ViewManagerLoader); | 51 DISALLOW_COPY_AND_ASSIGN(ViewManagerLoader); |
| 51 }; | 52 }; |
| 52 | 53 |
| 53 } // namespace shell | 54 } // namespace shell |
| 54 } // namespace mojo | 55 } // namespace mojo |
| 55 | 56 |
| 56 #endif // MOJO_SHELL_VIEW_MANAGER_LOADER_H_ | 57 #endif // MOJO_SHELL_VIEW_MANAGER_LOADER_H_ |
| OLD | NEW |