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_plugin_instance_impl.h" | 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1630 | 1630 |
1631 bool PepperPluginInstanceImpl::PrintPage(int page_number, | 1631 bool PepperPluginInstanceImpl::PrintPage(int page_number, |
1632 blink::WebCanvas* canvas) { | 1632 blink::WebCanvas* canvas) { |
1633 #if defined(ENABLE_FULL_PRINTING) | 1633 #if defined(ENABLE_FULL_PRINTING) |
1634 DCHECK(plugin_print_interface_); | 1634 DCHECK(plugin_print_interface_); |
1635 PP_PrintPageNumberRange_Dev page_range; | 1635 PP_PrintPageNumberRange_Dev page_range; |
1636 page_range.first_page_number = page_range.last_page_number = page_number; | 1636 page_range.first_page_number = page_range.last_page_number = page_number; |
1637 // The canvas only has a metafile on it for print preview. | 1637 // The canvas only has a metafile on it for print preview. |
1638 bool save_for_later = | 1638 bool save_for_later = |
1639 (printing::MetafileSkiaWrapper::GetMetafileFromCanvas(*canvas) != NULL); | 1639 (printing::MetafileSkiaWrapper::GetMetafileFromCanvas(*canvas) != NULL); |
1640 #if defined(OS_MACOSX) || defined(OS_WIN) | 1640 #if defined(OS_MACOSX) || \ |
| 1641 (defined(OS_WIN) && !defined(WIN_PDF_METAFILE_FOR_PRINTING)) |
1641 save_for_later = save_for_later && skia::IsPreviewMetafile(*canvas); | 1642 save_for_later = save_for_later && skia::IsPreviewMetafile(*canvas); |
1642 #endif | 1643 #endif |
1643 if (save_for_later) { | 1644 if (save_for_later) { |
1644 ranges_.push_back(page_range); | 1645 ranges_.push_back(page_range); |
1645 canvas_ = skia::SharePtr(canvas); | 1646 canvas_ = skia::SharePtr(canvas); |
1646 return true; | 1647 return true; |
1647 } else { | 1648 } else { |
1648 return PrintPageHelper(&page_range, 1, canvas); | 1649 return PrintPageHelper(&page_range, 1, canvas); |
1649 } | 1650 } |
1650 #else // defined(ENABLED_PRINTING) | 1651 #else // defined(ENABLED_PRINTING) |
(...skipping 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3138 // Running out-of-process. Initiate an IPC call to notify the plugin | 3139 // Running out-of-process. Initiate an IPC call to notify the plugin |
3139 // process. | 3140 // process. |
3140 ppapi::proxy::HostDispatcher* dispatcher = | 3141 ppapi::proxy::HostDispatcher* dispatcher = |
3141 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); | 3142 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); |
3142 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( | 3143 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( |
3143 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); | 3144 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); |
3144 } | 3145 } |
3145 } | 3146 } |
3146 | 3147 |
3147 } // namespace content | 3148 } // namespace content |
OLD | NEW |