| 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/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 namespace { | 44 namespace { |
| 45 | 45 |
| 46 #if defined(OS_LINUX) || defined(OS_OPENBSD) | 46 #if defined(OS_LINUX) || defined(OS_OPENBSD) |
| 47 class PrivateFontFile : public ppapi::Resource { | 47 class PrivateFontFile : public ppapi::Resource { |
| 48 public: | 48 public: |
| 49 PrivateFontFile(PP_Instance instance, int fd) | 49 PrivateFontFile(PP_Instance instance, int fd) |
| 50 : Resource(ppapi::OBJECT_IS_IMPL, instance), | 50 : Resource(ppapi::OBJECT_IS_IMPL, instance), |
| 51 fd_(fd) { | 51 fd_(fd) { |
| 52 } | 52 } |
| 53 virtual ~PrivateFontFile() { | |
| 54 } | |
| 55 | 53 |
| 56 bool GetFontTable(uint32_t table, | 54 bool GetFontTable(uint32_t table, |
| 57 void* output, | 55 void* output, |
| 58 uint32_t* output_length) { | 56 uint32_t* output_length) { |
| 59 size_t temp_size = static_cast<size_t>(*output_length); | 57 size_t temp_size = static_cast<size_t>(*output_length); |
| 60 bool rv = content::GetFontTable( | 58 bool rv = content::GetFontTable( |
| 61 fd_, table, static_cast<uint8_t*>(output), &temp_size); | 59 fd_, table, static_cast<uint8_t*>(output), &temp_size); |
| 62 *output_length = static_cast<uint32_t>(temp_size); | 60 *output_length = static_cast<uint32_t>(temp_size); |
| 63 return rv; | 61 return rv; |
| 64 } | 62 } |
| 65 | 63 |
| 64 protected: |
| 65 virtual ~PrivateFontFile() {} |
| 66 |
| 66 private: | 67 private: |
| 67 int fd_; | 68 int fd_; |
| 68 }; | 69 }; |
| 69 #endif | 70 #endif |
| 70 | 71 |
| 71 struct ResourceImageInfo { | 72 struct ResourceImageInfo { |
| 72 PP_ResourceImage pp_id; | 73 PP_ResourceImage pp_id; |
| 73 int res_id; | 74 int res_id; |
| 74 }; | 75 }; |
| 75 | 76 |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 return; | 377 return; |
| 377 | 378 |
| 378 WebKit::WebElement element = instance->container()->element(); | 379 WebKit::WebElement element = instance->container()->element(); |
| 379 WebKit::WebView* view = element.document().frame()->view(); | 380 WebKit::WebView* view = element.document().frame()->view(); |
| 380 content::RenderView* render_view = content::RenderView::FromWebView(view); | 381 content::RenderView* render_view = content::RenderView::FromWebView(view); |
| 381 | 382 |
| 382 PrintWebViewHelper* print_view_helper = PrintWebViewHelper::Get(render_view); | 383 PrintWebViewHelper* print_view_helper = PrintWebViewHelper::Get(render_view); |
| 383 if (print_view_helper) | 384 if (print_view_helper) |
| 384 print_view_helper->PrintNode(element); | 385 print_view_helper->PrintNode(element); |
| 385 } | 386 } |
| OLD | NEW |