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 COMPONENTS_HTML_VIEWER_HTML_DOCUMENT_H_ | 5 #ifndef COMPONENTS_HTML_VIEWER_HTML_DOCUMENT_H_ |
6 #define COMPONENTS_HTML_VIEWER_HTML_DOCUMENT_H_ | 6 #define COMPONENTS_HTML_VIEWER_HTML_DOCUMENT_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
51 public mojo::InterfaceFactory<mojo::AxProvider> { | 51 public mojo::InterfaceFactory<mojo::AxProvider> { |
52 public: | 52 public: |
53 // Load a new HTMLDocument with |response|. | 53 // Load a new HTMLDocument with |response|. |
54 // | 54 // |
55 // |services| should be used to implement a ServiceProvider which exposes | 55 // |services| should be used to implement a ServiceProvider which exposes |
56 // services to the connecting application. | 56 // services to the connecting application. |
57 // Commonly, the connecting application is the ViewManager and it will | 57 // Commonly, the connecting application is the ViewManager and it will |
58 // request ViewManagerClient. | 58 // request ViewManagerClient. |
59 // | 59 // |
60 // |shell| is the Shell connection for this mojo::Application. | 60 // |shell| is the Shell connection for this mojo::Application. |
61 HTMLDocument(mojo::InterfaceRequest<mojo::ServiceProvider> services, | 61 HTMLDocument(mojo::ApplicationImpl* html_document_app, |
62 mojo::ApplicationConnection* connection, | |
jam
2015/06/04 22:10:00
nit: update comment.
sky
2015/06/04 23:16:46
Done.
| |
62 mojo::URLResponsePtr response, | 63 mojo::URLResponsePtr response, |
63 mojo::ShellPtr shell, | |
64 Setup* setup); | 64 Setup* setup); |
65 ~HTMLDocument() override; | 65 ~HTMLDocument() override; |
66 | 66 |
67 private: | 67 private: |
68 // Data associated with a child iframe. | 68 // Data associated with a child iframe. |
69 struct ChildFrameData { | 69 struct ChildFrameData { |
70 mojo::View* view; | 70 mojo::View* view; |
71 blink::WebTreeScopeType scope; | 71 blink::WebTreeScopeType scope; |
72 }; | 72 }; |
73 | 73 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
133 void Create(mojo::ApplicationConnection* connection, | 133 void Create(mojo::ApplicationConnection* connection, |
134 mojo::InterfaceRequest<mojo::AxProvider> request) override; | 134 mojo::InterfaceRequest<mojo::AxProvider> request) override; |
135 | 135 |
136 void Load(mojo::URLResponsePtr response); | 136 void Load(mojo::URLResponsePtr response); |
137 | 137 |
138 // Converts a WebLocalFrame to a WebRemoteFrame. Used once we know the | 138 // Converts a WebLocalFrame to a WebRemoteFrame. Used once we know the |
139 // url of a frame to trigger the navigation. | 139 // url of a frame to trigger the navigation. |
140 void ConvertLocalFrameToRemoteFrame(blink::WebLocalFrame* frame); | 140 void ConvertLocalFrameToRemoteFrame(blink::WebLocalFrame* frame); |
141 | 141 |
142 scoped_ptr<mojo::AppRefCount> app_refcount_; | 142 scoped_ptr<mojo::AppRefCount> app_refcount_; |
143 mojo::ApplicationImpl* html_document_app_; | |
143 mojo::URLResponsePtr response_; | 144 mojo::URLResponsePtr response_; |
144 mojo::ServiceProviderImpl exported_services_; | |
145 mojo::ServiceProviderPtr embedder_service_provider_; | 145 mojo::ServiceProviderPtr embedder_service_provider_; |
146 mojo::ShellPtr shell_; | |
147 mojo::LazyInterfacePtr<mojo::NavigatorHost> navigator_host_; | 146 mojo::LazyInterfacePtr<mojo::NavigatorHost> navigator_host_; |
148 blink::WebView* web_view_; | 147 blink::WebView* web_view_; |
149 mojo::View* root_; | 148 mojo::View* root_; |
150 mojo::ViewManagerClientFactory view_manager_client_factory_; | 149 mojo::ViewManagerClientFactory view_manager_client_factory_; |
151 scoped_ptr<WebLayerTreeViewImpl> web_layer_tree_view_impl_; | 150 scoped_ptr<WebLayerTreeViewImpl> web_layer_tree_view_impl_; |
152 scoped_refptr<base::SingleThreadTaskRunner> compositor_thread_; | 151 scoped_refptr<base::SingleThreadTaskRunner> compositor_thread_; |
153 | 152 |
154 // HTMLDocument owns these pointers; binding requests after document load. | 153 // HTMLDocument owns these pointers; binding requests after document load. |
155 std::set<mojo::InterfaceRequest<mojo::AxProvider>*> ax_provider_requests_; | 154 std::set<mojo::InterfaceRequest<mojo::AxProvider>*> ax_provider_requests_; |
156 std::set<AxProviderImpl*> ax_providers_; | 155 std::set<AxProviderImpl*> ax_providers_; |
157 | 156 |
158 // A flag set on didFinishLoad. | 157 // A flag set on didFinishLoad. |
159 bool did_finish_load_ = false; | 158 bool did_finish_load_ = false; |
160 | 159 |
161 Setup* setup_; | 160 Setup* setup_; |
162 | 161 |
163 scoped_ptr<TouchHandler> touch_handler_; | 162 scoped_ptr<TouchHandler> touch_handler_; |
164 | 163 |
165 FrameToViewMap frame_to_view_; | 164 FrameToViewMap frame_to_view_; |
166 | 165 |
167 DISALLOW_COPY_AND_ASSIGN(HTMLDocument); | 166 DISALLOW_COPY_AND_ASSIGN(HTMLDocument); |
168 }; | 167 }; |
169 | 168 |
170 } // namespace html_viewer | 169 } // namespace html_viewer |
171 | 170 |
172 #endif // COMPONENTS_HTML_VIEWER_HTML_DOCUMENT_H_ | 171 #endif // COMPONENTS_HTML_VIEWER_HTML_DOCUMENT_H_ |
OLD | NEW |