OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 #ifndef COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_INIT_H_ |
| 6 #define COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_INIT_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "components/view_manager/public/interfaces/view_manager.mojom.h" |
| 11 #include "components/view_manager/public/interfaces/view_manager_root.mojom.h" |
| 12 #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h" |
| 13 namespace mojo { |
| 14 |
| 15 class ApplicationImpl; |
| 16 class ViewManagerDelegate; |
| 17 |
| 18 // ViewManagerInit is used to establish the initial connection to the |
| 19 // ViewManager. Use it when you know the ViewManager is not running and you're |
| 20 // app is going to be the first one to contact it. |
| 21 class ViewManagerInit { |
| 22 public: |
| 23 // |root_client| is optional. |
| 24 ViewManagerInit(ApplicationImpl* app, |
| 25 ViewManagerDelegate* delegate, |
| 26 ViewManagerRootClient* root_client); |
| 27 ~ViewManagerInit(); |
| 28 |
| 29 // Returns the ViewManagerRoot. This is only valid if |root_client| was |
| 30 // supplied to the constructor. |
| 31 ViewManagerRoot* view_manager_root() { return view_manager_root_.get(); } |
| 32 |
| 33 private: |
| 34 class ClientFactory; |
| 35 |
| 36 void OnCreate(InterfaceRequest<ViewManagerClient> request); |
| 37 |
| 38 ApplicationImpl* app_; |
| 39 ViewManagerDelegate* delegate_; |
| 40 scoped_ptr<ClientFactory> client_factory_; |
| 41 ViewManagerServicePtr service_; |
| 42 ViewManagerRootPtr view_manager_root_; |
| 43 scoped_ptr<Binding<ViewManagerRootClient>> root_client_binding_; |
| 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(ViewManagerInit); |
| 46 }; |
| 47 |
| 48 } // namespace mojo |
| 49 |
| 50 #endif // COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_INIT_H_ |
OLD | NEW |