| 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 "chrome/renderer/pepper/ppb_pdf_impl.h" | 5 #include "chrome/renderer/pepper/ppb_pdf_impl.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/safe_numerics.h" | 9 #include "base/safe_numerics.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
| 13 #include "chrome/common/render_messages.h" | 13 #include "chrome/common/render_messages.h" |
| 14 #include "chrome/renderer/printing/print_web_view_helper.h" | 14 #include "chrome/renderer/printing/print_web_view_helper.h" |
| 15 #include "content/public/common/child_process_sandbox_support_linux.h" | 15 #include "content/public/common/child_process_sandbox_support_linux.h" |
| 16 #include "content/public/common/referrer.h" | 16 #include "content/public/common/referrer.h" |
| 17 #include "content/public/renderer/ppapi_plugin_instance.h" |
| 17 #include "content/public/renderer/render_thread.h" | 18 #include "content/public/renderer/render_thread.h" |
| 18 #include "content/public/renderer/render_view.h" | 19 #include "content/public/renderer/render_view.h" |
| 19 #include "grit/webkit_resources.h" | 20 #include "grit/webkit_resources.h" |
| 20 #include "grit/webkit_strings.h" | 21 #include "grit/webkit_strings.h" |
| 21 #include "ppapi/c/pp_resource.h" | 22 #include "ppapi/c/pp_resource.h" |
| 22 #include "ppapi/c/private/ppb_pdf.h" | 23 #include "ppapi/c/private/ppb_pdf.h" |
| 23 #include "ppapi/c/trusted/ppb_browser_font_trusted.h" | 24 #include "ppapi/c/trusted/ppb_browser_font_trusted.h" |
| 24 #include "ppapi/shared_impl/ppapi_globals.h" | 25 #include "ppapi/shared_impl/ppapi_globals.h" |
| 25 #include "ppapi/shared_impl/resource.h" | 26 #include "ppapi/shared_impl/resource.h" |
| 26 #include "ppapi/shared_impl/resource_tracker.h" | 27 #include "ppapi/shared_impl/resource_tracker.h" |
| 27 #include "ppapi/shared_impl/var.h" | 28 #include "ppapi/shared_impl/var.h" |
| 28 #include "third_party/skia/include/core/SkBitmap.h" | 29 #include "third_party/skia/include/core/SkBitmap.h" |
| 29 #include "third_party/WebKit/public/web/WebDocument.h" | 30 #include "third_party/WebKit/public/web/WebDocument.h" |
| 30 #include "third_party/WebKit/public/web/WebElement.h" | 31 #include "third_party/WebKit/public/web/WebElement.h" |
| 31 #include "third_party/WebKit/public/web/WebFrame.h" | 32 #include "third_party/WebKit/public/web/WebFrame.h" |
| 32 #include "third_party/WebKit/public/web/WebPluginContainer.h" | 33 #include "third_party/WebKit/public/web/WebPluginContainer.h" |
| 33 #include "third_party/WebKit/public/web/WebView.h" | 34 #include "third_party/WebKit/public/web/WebView.h" |
| 34 #include "third_party/icu/source/i18n/unicode/usearch.h" | 35 #include "third_party/icu/source/i18n/unicode/usearch.h" |
| 35 #include "ui/base/l10n/l10n_util.h" | 36 #include "ui/base/l10n/l10n_util.h" |
| 36 #include "ui/base/layout.h" | 37 #include "ui/base/layout.h" |
| 37 #include "ui/base/resource/resource_bundle.h" | 38 #include "ui/base/resource/resource_bundle.h" |
| 38 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | |
| 39 | 39 |
| 40 using ppapi::PpapiGlobals; | 40 using ppapi::PpapiGlobals; |
| 41 using webkit::ppapi::PluginInstance; | 41 using webkit::ppapi::PluginInstance; |
| 42 using WebKit::WebElement; | 42 using WebKit::WebElement; |
| 43 using WebKit::WebView; | 43 using WebKit::WebView; |
| 44 using content::RenderThread; | 44 using content::RenderThread; |
| 45 | 45 |
| 46 namespace { | 46 namespace { |
| 47 | 47 |
| 48 #if defined(OS_LINUX) || defined(OS_OPENBSD) | 48 #if defined(OS_LINUX) || defined(OS_OPENBSD) |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 | 418 |
| 419 // static | 419 // static |
| 420 void PPB_PDF_Impl::InvokePrintingForInstance(PP_Instance instance_id) { | 420 void PPB_PDF_Impl::InvokePrintingForInstance(PP_Instance instance_id) { |
| 421 #if defined(ENABLE_PRINTING) | 421 #if defined(ENABLE_PRINTING) |
| 422 WebKit::WebElement element = GetWebElement(instance_id); | 422 WebKit::WebElement element = GetWebElement(instance_id); |
| 423 printing::PrintWebViewHelper* helper = GetPrintWebViewHelper(element); | 423 printing::PrintWebViewHelper* helper = GetPrintWebViewHelper(element); |
| 424 if (helper) | 424 if (helper) |
| 425 helper->PrintNode(element); | 425 helper->PrintNode(element); |
| 426 #endif // ENABLE_PRINTING | 426 #endif // ENABLE_PRINTING |
| 427 } | 427 } |
| OLD | NEW |