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 <set> | 8 #include <set> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 public HTMLFrameDelegate, | 53 public HTMLFrameDelegate, |
54 public mojo::InterfaceFactory<mojo::AxProvider>, | 54 public mojo::InterfaceFactory<mojo::AxProvider>, |
55 public mojo::InterfaceFactory<web_view::mojom::FrameClient>, | 55 public mojo::InterfaceFactory<web_view::mojom::FrameClient>, |
56 public mojo::InterfaceFactory<TestHTMLViewer>, | 56 public mojo::InterfaceFactory<TestHTMLViewer>, |
57 public mojo::InterfaceFactory<devtools_service::DevToolsAgent>, | 57 public mojo::InterfaceFactory<devtools_service::DevToolsAgent>, |
58 public mojo::InterfaceFactory<mus::mojom::WindowTreeClient> { | 58 public mojo::InterfaceFactory<mus::mojom::WindowTreeClient> { |
59 public: | 59 public: |
60 using DeleteCallback = base::Callback<void(HTMLDocument*)>; | 60 using DeleteCallback = base::Callback<void(HTMLDocument*)>; |
61 | 61 |
62 // Load a new HTMLDocument with |response|. | 62 // Load a new HTMLDocument with |response|. |
63 // |html_document_app| is the application this app was created in, and | 63 // |html_document_shell| is the application this app was created in, and |
64 // |connection| the specific connection triggering this new instance. | 64 // |connection| the specific connection triggering this new instance. |
65 // |setup| is used to obtain init type state (such as resources). | 65 // |setup| is used to obtain init type state (such as resources). |
66 HTMLDocument(mojo::ApplicationImpl* html_document_app, | 66 HTMLDocument(mojo::Shell* html_document_shell, |
67 mojo::ApplicationConnection* connection, | 67 mojo::ApplicationConnection* connection, |
68 mojo::URLResponsePtr response, | 68 mojo::URLResponsePtr response, |
69 GlobalState* setup, | 69 GlobalState* setup, |
70 const DeleteCallback& delete_callback, | 70 const DeleteCallback& delete_callback, |
71 HTMLFactory* factory); | 71 HTMLFactory* factory); |
72 | 72 |
73 // Deletes this object. | 73 // Deletes this object. |
74 void Destroy(); | 74 void Destroy(); |
75 | 75 |
76 private: | 76 private: |
(...skipping 27 matching lines...) Expand all Loading... |
104 | 104 |
105 void Load(); | 105 void Load(); |
106 | 106 |
107 BeforeLoadCache* GetBeforeLoadCache(); | 107 BeforeLoadCache* GetBeforeLoadCache(); |
108 | 108 |
109 // WindowTreeDelegate: | 109 // WindowTreeDelegate: |
110 void OnEmbed(mus::Window* root) override; | 110 void OnEmbed(mus::Window* root) override; |
111 void OnConnectionLost(mus::WindowTreeConnection* connection) override; | 111 void OnConnectionLost(mus::WindowTreeConnection* connection) override; |
112 | 112 |
113 // HTMLFrameDelegate: | 113 // HTMLFrameDelegate: |
114 mojo::ApplicationImpl* GetApp() override; | 114 mojo::Shell* GetShell() override; |
115 HTMLFactory* GetHTMLFactory() override; | 115 HTMLFactory* GetHTMLFactory() override; |
116 void OnFrameDidFinishLoad() override; | 116 void OnFrameDidFinishLoad() override; |
117 void OnFrameSwappedToRemote() override; | 117 void OnFrameSwappedToRemote() override; |
118 void OnSwap(HTMLFrame* frame, HTMLFrameDelegate* old_delegate) override; | 118 void OnSwap(HTMLFrame* frame, HTMLFrameDelegate* old_delegate) override; |
119 void OnFrameDestroyed() override; | 119 void OnFrameDestroyed() override; |
120 | 120 |
121 // mojo::InterfaceFactory<mojo::AxProvider>: | 121 // mojo::InterfaceFactory<mojo::AxProvider>: |
122 void Create(mojo::ApplicationConnection* connection, | 122 void Create(mojo::ApplicationConnection* connection, |
123 mojo::InterfaceRequest<mojo::AxProvider> request) override; | 123 mojo::InterfaceRequest<mojo::AxProvider> request) override; |
124 | 124 |
(...skipping 10 matching lines...) Expand all Loading... |
135 void Create( | 135 void Create( |
136 mojo::ApplicationConnection* connection, | 136 mojo::ApplicationConnection* connection, |
137 mojo::InterfaceRequest<devtools_service::DevToolsAgent> request) override; | 137 mojo::InterfaceRequest<devtools_service::DevToolsAgent> request) override; |
138 | 138 |
139 // mojo::InterfaceFactory<mus::WindowTreeClient>: | 139 // mojo::InterfaceFactory<mus::WindowTreeClient>: |
140 void Create( | 140 void Create( |
141 mojo::ApplicationConnection* connection, | 141 mojo::ApplicationConnection* connection, |
142 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> request) override; | 142 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> request) override; |
143 | 143 |
144 scoped_ptr<mojo::AppRefCount> app_refcount_; | 144 scoped_ptr<mojo::AppRefCount> app_refcount_; |
145 mojo::ApplicationImpl* html_document_app_; | 145 mojo::Shell* html_document_shell_; |
146 mojo::ApplicationConnection* connection_; | 146 mojo::ApplicationConnection* connection_; |
147 | 147 |
148 // HTMLDocument owns these pointers; binding requests after document load. | 148 // HTMLDocument owns these pointers; binding requests after document load. |
149 std::set<AxProviderImpl*> ax_providers_; | 149 std::set<AxProviderImpl*> ax_providers_; |
150 | 150 |
151 ScopedVector<TestHTMLViewerImpl> test_html_viewers_; | 151 ScopedVector<TestHTMLViewerImpl> test_html_viewers_; |
152 | 152 |
153 // Set to true when the local frame has finished loading. | 153 // Set to true when the local frame has finished loading. |
154 bool did_finish_local_frame_load_ = false; | 154 bool did_finish_local_frame_load_ = false; |
155 | 155 |
(...skipping 15 matching lines...) Expand all Loading... |
171 // initialized. | 171 // initialized. |
172 mojo::InterfaceRequest<devtools_service::DevToolsAgent> | 172 mojo::InterfaceRequest<devtools_service::DevToolsAgent> |
173 devtools_agent_request_; | 173 devtools_agent_request_; |
174 | 174 |
175 DISALLOW_COPY_AND_ASSIGN(HTMLDocument); | 175 DISALLOW_COPY_AND_ASSIGN(HTMLDocument); |
176 }; | 176 }; |
177 | 177 |
178 } // namespace html_viewer | 178 } // namespace html_viewer |
179 | 179 |
180 #endif // COMPONENTS_HTML_VIEWER_HTML_DOCUMENT_H_ | 180 #endif // COMPONENTS_HTML_VIEWER_HTML_DOCUMENT_H_ |
OLD | NEW |