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_SERVICES_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_CONTEXT_H_ | 5 #ifndef MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_CONTEXT_H_ |
6 #define MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_CONTEXT_H_ | 6 #define MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_CONTEXT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/bind.h" | |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "mojo/public/cpp/application/service_provider_impl.h" | 11 #include "mojo/public/cpp/application/service_provider_impl.h" |
14 | 12 |
15 namespace mojo { | 13 namespace mojo { |
16 class ApplicationImpl; | 14 class ApplicationImpl; |
17 | 15 |
18 class ViewManagerContext { | 16 class ViewManagerContext { |
19 public: | 17 public: |
20 explicit ViewManagerContext(ApplicationImpl* application_impl); | 18 explicit ViewManagerContext(ApplicationImpl* application_impl); |
21 ~ViewManagerContext(); | 19 ~ViewManagerContext(); |
22 | 20 |
23 // Embed an application @ |url| at an appropriate View. | 21 // Embed an application @ |url| at an appropriate View. |
24 // The first time this method is called in the life time of the View Manager | 22 // The first time this method is called in the life time of the View Manager |
25 // service the "appropriate View" is defined as being the service' root View. | 23 // service the "appropriate View" is defined as being the service' root View. |
26 // Subsequent times, the implementation of this method is delegated to the | 24 // Subsequent times, the implementation of this method is delegated to the |
27 // application embedded at the service root View. This application will have a | 25 // application embedded at the service root View. This application will have a |
28 // specific definition of where within its View hierarchy to embed an | 26 // specific definition of where within its View hierarchy to embed an |
29 // un-parented URL. | 27 // un-parented URL. |
30 // |services| encapsulates services offered by the embedder to the embedded | 28 // |services| encapsulates services offered by the embedder to the embedded |
31 // app alongside this Embed() call. |exposed_services| provides a means for | 29 // app alongside this Embed() call. |exposed_services| provides a means for |
32 // the embedder to connect to services exposed by the embedded app. | 30 // the embedder to connect to services exposed by the embedded app. |
33 void Embed(const String& url); | 31 void Embed(const String& url); |
34 void Embed(const String& url, | 32 void Embed(const String& url, |
35 InterfaceRequest<ServiceProvider> services, | 33 InterfaceRequest<ServiceProvider> services, |
36 ServiceProviderPtr exposed_Services); | 34 ServiceProviderPtr exposed_Services); |
37 | 35 |
38 private: | 36 private: |
39 class InternalState; | 37 class InternalState; |
40 scoped_ptr<InternalState> state_; | 38 InternalState* state_; |
41 | 39 |
42 MOJO_DISALLOW_COPY_AND_ASSIGN(ViewManagerContext); | 40 MOJO_DISALLOW_COPY_AND_ASSIGN(ViewManagerContext); |
43 }; | 41 }; |
44 | 42 |
45 } // namespace mojo | 43 } // namespace mojo |
46 | 44 |
47 #endif // MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_CONTEXT_H_ | 45 #endif // MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_CONTEXT_H_ |
OLD | NEW |