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 "webkit/plugins/ppapi/ppapi_webplugin_impl.h" | 5 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
11 #include "ppapi/shared_impl/ppapi_globals.h" | 11 #include "ppapi/shared_impl/ppapi_globals.h" |
12 #include "ppapi/shared_impl/var_tracker.h" | 12 #include "ppapi/shared_impl/var_tracker.h" |
13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" | 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" |
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" |
16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" |
18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h" | 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h" |
| 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPrintParams.h" |
| 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPrintScalingOption
.h" |
19 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPoint.h" | 21 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPoint.h" |
20 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" |
| 23 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" |
21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
22 #include "webkit/plugins/ppapi/message_channel.h" | 25 #include "webkit/plugins/ppapi/message_channel.h" |
23 #include "webkit/plugins/ppapi/npobject_var.h" | 26 #include "webkit/plugins/ppapi/npobject_var.h" |
24 #include "webkit/plugins/ppapi/plugin_module.h" | 27 #include "webkit/plugins/ppapi/plugin_module.h" |
25 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 28 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
26 #include "webkit/plugins/ppapi/ppb_url_loader_impl.h" | 29 #include "webkit/plugins/ppapi/ppb_url_loader_impl.h" |
27 | 30 |
28 using ppapi::NPObjectVar; | 31 using ppapi::NPObjectVar; |
29 using WebKit::WebCanvas; | 32 using WebKit::WebCanvas; |
30 using WebKit::WebPlugin; | 33 using WebKit::WebPlugin; |
31 using WebKit::WebPluginContainer; | 34 using WebKit::WebPluginContainer; |
32 using WebKit::WebPluginParams; | 35 using WebKit::WebPluginParams; |
33 using WebKit::WebPoint; | 36 using WebKit::WebPoint; |
| 37 using WebKit::WebPrintParams; |
34 using WebKit::WebRect; | 38 using WebKit::WebRect; |
| 39 using WebKit::WebSize; |
35 using WebKit::WebString; | 40 using WebKit::WebString; |
36 using WebKit::WebURL; | 41 using WebKit::WebURL; |
37 using WebKit::WebVector; | 42 using WebKit::WebVector; |
38 using WebKit::WebView; | 43 using WebKit::WebView; |
39 | 44 |
40 namespace webkit { | 45 namespace webkit { |
41 namespace ppapi { | 46 namespace ppapi { |
42 | 47 |
43 struct WebPluginImpl::InitData { | 48 struct WebPluginImpl::InitData { |
44 scoped_refptr<PluginModule> module; | 49 scoped_refptr<PluginModule> module; |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 } | 262 } |
258 | 263 |
259 bool WebPluginImpl::supportsPaginatedPrint() { | 264 bool WebPluginImpl::supportsPaginatedPrint() { |
260 return instance_->SupportsPrintInterface(); | 265 return instance_->SupportsPrintInterface(); |
261 } | 266 } |
262 | 267 |
263 bool WebPluginImpl::isPrintScalingDisabled() { | 268 bool WebPluginImpl::isPrintScalingDisabled() { |
264 return instance_->IsPrintScalingDisabled(); | 269 return instance_->IsPrintScalingDisabled(); |
265 } | 270 } |
266 | 271 |
267 int WebPluginImpl::printBegin(const WebKit::WebRect& printable_area, | 272 // TODO(kmadhusu): This is a temporary interface to avoid the compile errors. |
268 int printer_dpi) { | 273 // Remove this function after fixing crbug.com/85132. |
269 return instance_->PrintBegin(printable_area, printer_dpi); | 274 int WebPluginImpl::printBegin(const WebRect& content_area, int printer_dpi) { |
| 275 WebRect printable_area(content_area); |
| 276 WebSize paper_size(content_area.width, content_area.height); |
| 277 WebPrintParams print_params (content_area, printable_area, paper_size, |
| 278 printer_dpi, |
| 279 WebKit::WebPrintScalingOptionSourceSize); |
| 280 return printBegin(print_params); |
| 281 } |
| 282 |
| 283 int WebPluginImpl::printBegin(const WebPrintParams& print_params) { |
| 284 return instance_->PrintBegin(print_params); |
270 } | 285 } |
271 | 286 |
272 bool WebPluginImpl::printPage(int page_number, | 287 bool WebPluginImpl::printPage(int page_number, |
273 WebKit::WebCanvas* canvas) { | 288 WebKit::WebCanvas* canvas) { |
274 return instance_->PrintPage(page_number, canvas); | 289 return instance_->PrintPage(page_number, canvas); |
275 } | 290 } |
276 | 291 |
277 void WebPluginImpl::printEnd() { | 292 void WebPluginImpl::printEnd() { |
278 return instance_->PrintEnd(); | 293 return instance_->PrintEnd(); |
279 } | 294 } |
280 | 295 |
281 bool WebPluginImpl::canRotateView() { | 296 bool WebPluginImpl::canRotateView() { |
282 return instance_->CanRotateView(); | 297 return instance_->CanRotateView(); |
283 } | 298 } |
284 | 299 |
285 void WebPluginImpl::rotateView(RotationType type) { | 300 void WebPluginImpl::rotateView(RotationType type) { |
286 instance_->RotateView(type); | 301 instance_->RotateView(type); |
287 } | 302 } |
288 | 303 |
289 } // namespace ppapi | 304 } // namespace ppapi |
290 } // namespace webkit | 305 } // namespace webkit |
OLD | NEW |