Chromium Code Reviews| 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/platform/WebPoint.h" | 19 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPoint.h" |
| 20 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" | 20 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" |
| 21 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" | |
| 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 22 #include "webkit/plugins/ppapi/message_channel.h" | 23 #include "webkit/plugins/ppapi/message_channel.h" |
| 23 #include "webkit/plugins/ppapi/npobject_var.h" | 24 #include "webkit/plugins/ppapi/npobject_var.h" |
| 24 #include "webkit/plugins/ppapi/plugin_module.h" | 25 #include "webkit/plugins/ppapi/plugin_module.h" |
| 25 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 26 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
| 26 #include "webkit/plugins/ppapi/ppb_url_loader_impl.h" | 27 #include "webkit/plugins/ppapi/ppb_url_loader_impl.h" |
| 27 | 28 |
| 28 using ppapi::NPObjectVar; | 29 using ppapi::NPObjectVar; |
| 29 using WebKit::WebCanvas; | 30 using WebKit::WebCanvas; |
| 30 using WebKit::WebPluginContainer; | 31 using WebKit::WebPluginContainer; |
| 31 using WebKit::WebPluginParams; | 32 using WebKit::WebPluginParams; |
| 32 using WebKit::WebPoint; | 33 using WebKit::WebPoint; |
| 33 using WebKit::WebRect; | 34 using WebKit::WebRect; |
| 35 using WebKit::WebSize; | |
| 34 using WebKit::WebString; | 36 using WebKit::WebString; |
| 35 using WebKit::WebURL; | 37 using WebKit::WebURL; |
| 36 using WebKit::WebVector; | 38 using WebKit::WebVector; |
| 37 using WebKit::WebView; | 39 using WebKit::WebView; |
| 38 | 40 |
| 39 namespace webkit { | 41 namespace webkit { |
| 40 namespace ppapi { | 42 namespace ppapi { |
| 41 | 43 |
| 42 struct WebPluginImpl::InitData { | 44 struct WebPluginImpl::InitData { |
| 43 scoped_refptr<PluginModule> module; | 45 scoped_refptr<PluginModule> module; |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 242 } | 244 } |
| 243 | 245 |
| 244 bool WebPluginImpl::supportsPaginatedPrint() { | 246 bool WebPluginImpl::supportsPaginatedPrint() { |
| 245 return instance_->SupportsPrintInterface(); | 247 return instance_->SupportsPrintInterface(); |
| 246 } | 248 } |
| 247 | 249 |
| 248 bool WebPluginImpl::isPrintScalingDisabled() { | 250 bool WebPluginImpl::isPrintScalingDisabled() { |
| 249 return instance_->IsPrintScalingDisabled(); | 251 return instance_->IsPrintScalingDisabled(); |
| 250 } | 252 } |
| 251 | 253 |
| 252 int WebPluginImpl::printBegin(const WebKit::WebRect& printable_area, | 254 // TODO(kmadhusu): This is a temporary interface to avoid the compile errors. |
| 255 // Remove this function after fixing crbug.com/85132. | |
| 256 int WebPluginImpl::printBegin(const WebKit::WebRect& content_area, | |
| 253 int printer_dpi) { | 257 int printer_dpi) { |
| 254 return instance_->PrintBegin(printable_area, printer_dpi); | 258 WebKit::WebRect printable_area(content_area); |
| 259 WebKit::WebSize paper_size(content_area.width, content_area.height); | |
| 260 return instance_->PrintBegin(content_area, printable_area, paper_size, | |
| 261 2, printer_dpi); | |
|
kmadhusu
2012/04/20 22:29:57
dmichael: Can I include ppapi/c/dev/ppp_printing_d
dmichael (off chromium)
2012/04/20 23:01:45
You could, but shouldn't it be the WebKit value at
kmadhusu
2012/04/23 16:39:30
Yeah it is a WebKit value. Since I had 'int' data
| |
| 262 } | |
| 263 | |
| 264 int WebPluginImpl::printBegin(const WebKit::WebRect& content_area, | |
| 265 const WebKit::WebRect& printable_area, | |
| 266 const WebKit::WebSize& paper_size, | |
| 267 int print_scaling_option, | |
|
dmichael (off chromium)
2012/04/20 23:01:45
Is this the typical way of making these 2-sided ch
kmadhusu
2012/04/23 16:39:30
If we are going to create a new function and the
dmichael (off chromium)
2012/04/23 17:02:40
Right... I think you could land the WebKit side f
| |
| 268 int printer_dpi) { | |
| 269 return instance_->PrintBegin(content_area, printable_area, paper_size, | |
| 270 print_scaling_option, printer_dpi); | |
| 255 } | 271 } |
| 256 | 272 |
| 257 bool WebPluginImpl::printPage(int page_number, | 273 bool WebPluginImpl::printPage(int page_number, |
| 258 WebKit::WebCanvas* canvas) { | 274 WebKit::WebCanvas* canvas) { |
| 259 return instance_->PrintPage(page_number, canvas); | 275 return instance_->PrintPage(page_number, canvas); |
| 260 } | 276 } |
| 261 | 277 |
| 262 void WebPluginImpl::printEnd() { | 278 void WebPluginImpl::printEnd() { |
| 263 return instance_->PrintEnd(); | 279 return instance_->PrintEnd(); |
| 264 } | 280 } |
| 265 | 281 |
| 266 bool WebPluginImpl::canRotateView() { | 282 bool WebPluginImpl::canRotateView() { |
| 267 return instance_->CanRotateView(); | 283 return instance_->CanRotateView(); |
| 268 } | 284 } |
| 269 | 285 |
| 270 void WebPluginImpl::rotateView(RotationType type) { | 286 void WebPluginImpl::rotateView(RotationType type) { |
| 271 instance_->RotateView(type); | 287 instance_->RotateView(type); |
| 272 } | 288 } |
| 273 | 289 |
| 274 } // namespace ppapi | 290 } // namespace ppapi |
| 275 } // namespace webkit | 291 } // namespace webkit |
| OLD | NEW |