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 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1743 | 1743 |
1744 bool PepperPluginInstanceImpl::PrintPage(int page_number, | 1744 bool PepperPluginInstanceImpl::PrintPage(int page_number, |
1745 blink::WebCanvas* canvas) { | 1745 blink::WebCanvas* canvas) { |
1746 #if defined(ENABLE_FULL_PRINTING) | 1746 #if defined(ENABLE_FULL_PRINTING) |
1747 DCHECK(plugin_print_interface_); | 1747 DCHECK(plugin_print_interface_); |
1748 PP_PrintPageNumberRange_Dev page_range; | 1748 PP_PrintPageNumberRange_Dev page_range; |
1749 page_range.first_page_number = page_range.last_page_number = page_number; | 1749 page_range.first_page_number = page_range.last_page_number = page_number; |
1750 // The canvas only has a metafile on it for print preview. | 1750 // The canvas only has a metafile on it for print preview. |
1751 bool save_for_later = | 1751 bool save_for_later = |
1752 (printing::MetafileSkiaWrapper::GetMetafileFromCanvas(*canvas) != NULL); | 1752 (printing::MetafileSkiaWrapper::GetMetafileFromCanvas(*canvas) != NULL); |
1753 #if defined(OS_MACOSX) || \ | 1753 #if defined(OS_MACOSX) |
1754 (defined(OS_WIN) && !defined(WIN_PDF_METAFILE_FOR_PRINTING)) | |
1755 save_for_later = save_for_later && skia::IsPreviewMetafile(*canvas); | 1754 save_for_later = save_for_later && skia::IsPreviewMetafile(*canvas); |
1756 #endif | 1755 #endif // defined(OS_MACOSX) |
1757 if (save_for_later) { | 1756 if (save_for_later) { |
1758 ranges_.push_back(page_range); | 1757 ranges_.push_back(page_range); |
1759 canvas_ = skia::SharePtr(canvas); | 1758 canvas_ = skia::SharePtr(canvas); |
1760 return true; | 1759 return true; |
1761 } else { | 1760 } else { |
1762 return PrintPageHelper(&page_range, 1, canvas); | 1761 return PrintPageHelper(&page_range, 1, canvas); |
1763 } | 1762 } |
1764 #else // defined(ENABLED_PRINTING) | 1763 #else // defined(ENABLED_PRINTING) |
1765 return false; | 1764 return false; |
1766 #endif | 1765 #endif |
(...skipping 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3319 // Running out-of-process. Initiate an IPC call to notify the plugin | 3318 // Running out-of-process. Initiate an IPC call to notify the plugin |
3320 // process. | 3319 // process. |
3321 ppapi::proxy::HostDispatcher* dispatcher = | 3320 ppapi::proxy::HostDispatcher* dispatcher = |
3322 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); | 3321 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); |
3323 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( | 3322 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( |
3324 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); | 3323 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); |
3325 } | 3324 } |
3326 } | 3325 } |
3327 | 3326 |
3328 } // namespace content | 3327 } // namespace content |
OLD | NEW |