OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_ | 5 #ifndef IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_ |
6 #define IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_ | 6 #define IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 // Clears any current WebUI. Should be called when the page changes. | 150 // Clears any current WebUI. Should be called when the page changes. |
151 // TODO(stuartmorgan): Remove once more logic is moved from WebController | 151 // TODO(stuartmorgan): Remove once more logic is moved from WebController |
152 // into this class. | 152 // into this class. |
153 void ClearWebUI(); | 153 void ClearWebUI(); |
154 // Returns true if there is a WebUI active. | 154 // Returns true if there is a WebUI active. |
155 bool HasWebUI(); | 155 bool HasWebUI(); |
156 // Processes a message from a WebUI displayed at the given URL. | 156 // Processes a message from a WebUI displayed at the given URL. |
157 void ProcessWebUIMessage(const GURL& source_url, | 157 void ProcessWebUIMessage(const GURL& source_url, |
158 const std::string& message, | 158 const std::string& message, |
159 const base::ListValue& args); | 159 const base::ListValue& args); |
| 160 // Invokes page load for WebUI URL with HTML. URL must have an application |
| 161 // specific scheme. |
| 162 virtual void LoadWebUIHtml(const base::string16& html, const GURL& url); |
160 | 163 |
161 const base::string16& GetTitle() const; | 164 const base::string16& GetTitle() const; |
162 | 165 |
163 // Gets the HTTP response headers associated with the current page. | 166 // Gets the HTTP response headers associated with the current page. |
164 net::HttpResponseHeaders* GetHttpResponseHeaders() const; | 167 net::HttpResponseHeaders* GetHttpResponseHeaders() const; |
165 | 168 |
166 // Called when HTTP response headers are received. | 169 // Called when HTTP response headers are received. |
167 // |resource_url| is the URL associated with the headers. | 170 // |resource_url| is the URL associated with the headers. |
168 // This function has no visible effects until UpdateHttpResponseHeaders() is | 171 // This function has no visible effects until UpdateHttpResponseHeaders() is |
169 // called. | 172 // called. |
170 void OnHttpResponseHeadersReceived(net::HttpResponseHeaders* response_headers, | 173 void OnHttpResponseHeadersReceived(net::HttpResponseHeaders* response_headers, |
171 const GURL& resource_url); | 174 const GURL& resource_url); |
172 | 175 |
173 // Executes a JavaScript string on the page asynchronously. | 176 // Executes a JavaScript string on the page asynchronously. |
174 // TODO(shreyasv): Rename this to ExecuteJavaScript for consitency with | 177 // TODO(shreyasv): Rename this to ExecuteJavaScript for consitency with |
175 // upstream API. | 178 // upstream API. |
176 void ExecuteJavaScriptAsync(const base::string16& javascript); | 179 virtual void ExecuteJavaScriptAsync(const base::string16& script); |
177 | 180 |
178 // Request tracker management. For now, this exposes the RequestTracker for | 181 // Request tracker management. For now, this exposes the RequestTracker for |
179 // embedders to use. | 182 // embedders to use. |
180 // TODO(stuartmorgan): RequestTracker should become an internal detail of this | 183 // TODO(stuartmorgan): RequestTracker should become an internal detail of this |
181 // class. | 184 // class. |
182 | 185 |
183 // Create a new tracker using |delegate| as its delegate. | 186 // Create a new tracker using |delegate| as its delegate. |
184 void InitializeRequestTracker(id<CRWRequestTrackerDelegate> delegate); | 187 void InitializeRequestTracker(id<CRWRequestTrackerDelegate> delegate); |
185 | 188 |
186 // Close the request tracker and delete it. | 189 // Close the request tracker and delete it. |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 | 310 |
308 // Callbacks associated to command prefixes. | 311 // Callbacks associated to command prefixes. |
309 std::map<std::string, ScriptCommandCallback> script_command_callbacks_; | 312 std::map<std::string, ScriptCommandCallback> script_command_callbacks_; |
310 | 313 |
311 DISALLOW_COPY_AND_ASSIGN(WebStateImpl); | 314 DISALLOW_COPY_AND_ASSIGN(WebStateImpl); |
312 }; | 315 }; |
313 | 316 |
314 } // namespace web | 317 } // namespace web |
315 | 318 |
316 #endif // IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_ | 319 #endif // IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_ |
OLD | NEW |