OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/renderer/pepper/pepper_webplugin_impl.h" | 5 #include "content/renderer/pepper/pepper_webplugin_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/debug/crash_logging.h" | 11 #include "base/debug/crash_logging.h" |
12 #include "base/location.h" | 12 #include "base/location.h" |
13 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
14 #include "base/threading/thread_task_runner_handle.h" | 14 #include "base/threading/thread_task_runner_handle.h" |
15 #include "content/public/renderer/content_renderer_client.h" | 15 #include "content/public/renderer/content_renderer_client.h" |
16 #include "content/renderer/pepper/message_channel.h" | 16 #include "content/renderer/pepper/message_channel.h" |
17 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 17 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
18 #include "content/renderer/pepper/plugin_instance_throttler_impl.h" | 18 #include "content/renderer/pepper/plugin_instance_throttler_impl.h" |
19 #include "content/renderer/pepper/plugin_module.h" | 19 #include "content/renderer/pepper/plugin_module.h" |
20 #include "content/renderer/pepper/v8object_var.h" | 20 #include "content/renderer/pepper/v8object_var.h" |
21 #include "content/renderer/render_frame_impl.h" | 21 #include "content/renderer/render_frame_impl.h" |
22 #include "ppapi/shared_impl/ppapi_globals.h" | 22 #include "ppapi/shared_impl/ppapi_globals.h" |
23 #include "ppapi/shared_impl/var_tracker.h" | 23 #include "ppapi/shared_impl/var_tracker.h" |
24 #include "third_party/WebKit/public/platform/WebPoint.h" | 24 #include "third_party/WebKit/public/platform/WebPoint.h" |
25 #include "third_party/WebKit/public/platform/WebRect.h" | 25 #include "third_party/WebKit/public/platform/WebRect.h" |
26 #include "third_party/WebKit/public/platform/WebSize.h" | 26 #include "third_party/WebKit/public/platform/WebSize.h" |
27 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h" | 27 #include "third_party/WebKit/public/web/WebAssociatedURLLoaderClient.h" |
28 #include "third_party/WebKit/public/web/WebDocument.h" | 28 #include "third_party/WebKit/public/web/WebDocument.h" |
29 #include "third_party/WebKit/public/web/WebElement.h" | 29 #include "third_party/WebKit/public/web/WebElement.h" |
30 #include "third_party/WebKit/public/web/WebFrame.h" | 30 #include "third_party/WebKit/public/web/WebFrame.h" |
31 #include "third_party/WebKit/public/web/WebPluginContainer.h" | 31 #include "third_party/WebKit/public/web/WebPluginContainer.h" |
32 #include "third_party/WebKit/public/web/WebPluginParams.h" | 32 #include "third_party/WebKit/public/web/WebPluginParams.h" |
33 #include "third_party/WebKit/public/web/WebPrintParams.h" | 33 #include "third_party/WebKit/public/web/WebPrintParams.h" |
34 #include "third_party/WebKit/public/web/WebPrintPresetOptions.h" | 34 #include "third_party/WebKit/public/web/WebPrintPresetOptions.h" |
35 #include "third_party/WebKit/public/web/WebPrintScalingOption.h" | 35 #include "third_party/WebKit/public/web/WebPrintScalingOption.h" |
36 #include "url/gurl.h" | 36 #include "url/gurl.h" |
37 | 37 |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 : blink::WebInputEventResult::NotHandled; | 215 : blink::WebInputEventResult::NotHandled; |
216 } | 216 } |
217 | 217 |
218 void PepperWebPluginImpl::didReceiveResponse( | 218 void PepperWebPluginImpl::didReceiveResponse( |
219 const blink::WebURLResponse& response) { | 219 const blink::WebURLResponse& response) { |
220 DCHECK(!instance_->document_loader()); | 220 DCHECK(!instance_->document_loader()); |
221 instance_->HandleDocumentLoad(response); | 221 instance_->HandleDocumentLoad(response); |
222 } | 222 } |
223 | 223 |
224 void PepperWebPluginImpl::didReceiveData(const char* data, int data_length) { | 224 void PepperWebPluginImpl::didReceiveData(const char* data, int data_length) { |
225 blink::WebURLLoaderClient* document_loader = instance_->document_loader(); | 225 blink::WebAssociatedURLLoaderClient* document_loader = |
| 226 instance_->document_loader(); |
226 if (document_loader) | 227 if (document_loader) |
227 document_loader->didReceiveData(nullptr, data, data_length, 0, data_length); | 228 document_loader->didReceiveData(data, data_length); |
228 } | 229 } |
229 | 230 |
230 void PepperWebPluginImpl::didFinishLoading() { | 231 void PepperWebPluginImpl::didFinishLoading() { |
231 blink::WebURLLoaderClient* document_loader = instance_->document_loader(); | 232 blink::WebAssociatedURLLoaderClient* document_loader = |
| 233 instance_->document_loader(); |
232 if (document_loader) | 234 if (document_loader) |
233 document_loader->didFinishLoading( | 235 document_loader->didFinishLoading(0.0); |
234 nullptr, 0.0, blink::WebURLLoaderClient::kUnknownEncodedDataLength); | |
235 } | 236 } |
236 | 237 |
237 void PepperWebPluginImpl::didFailLoading(const blink::WebURLError& error) { | 238 void PepperWebPluginImpl::didFailLoading(const blink::WebURLError& error) { |
238 blink::WebURLLoaderClient* document_loader = instance_->document_loader(); | 239 blink::WebAssociatedURLLoaderClient* document_loader = |
| 240 instance_->document_loader(); |
239 if (document_loader) | 241 if (document_loader) |
240 document_loader->didFail(nullptr, error); | 242 document_loader->didFail(error); |
241 } | 243 } |
242 | 244 |
243 bool PepperWebPluginImpl::hasSelection() const { | 245 bool PepperWebPluginImpl::hasSelection() const { |
244 return !selectionAsText().isEmpty(); | 246 return !selectionAsText().isEmpty(); |
245 } | 247 } |
246 | 248 |
247 WebString PepperWebPluginImpl::selectionAsText() const { | 249 WebString PepperWebPluginImpl::selectionAsText() const { |
248 return instance_->GetSelectedText(false); | 250 return instance_->GetSelectedText(false); |
249 } | 251 } |
250 | 252 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 | 295 |
294 bool PepperWebPluginImpl::canRotateView() { return instance_->CanRotateView(); } | 296 bool PepperWebPluginImpl::canRotateView() { return instance_->CanRotateView(); } |
295 | 297 |
296 void PepperWebPluginImpl::rotateView(RotationType type) { | 298 void PepperWebPluginImpl::rotateView(RotationType type) { |
297 instance_->RotateView(type); | 299 instance_->RotateView(type); |
298 } | 300 } |
299 | 301 |
300 bool PepperWebPluginImpl::isPlaceholder() { return false; } | 302 bool PepperWebPluginImpl::isPlaceholder() { return false; } |
301 | 303 |
302 } // namespace content | 304 } // namespace content |
OLD | NEW |