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/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 1707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1718 if (!pdf_module) | 1718 if (!pdf_module) |
1719 return false; | 1719 return false; |
1720 RenderPDFPageToDCProc render_proc = | 1720 RenderPDFPageToDCProc render_proc = |
1721 reinterpret_cast<RenderPDFPageToDCProc>( | 1721 reinterpret_cast<RenderPDFPageToDCProc>( |
1722 GetProcAddress(pdf_module, "RenderPDFPageToDC")); | 1722 GetProcAddress(pdf_module, "RenderPDFPageToDC")); |
1723 if (!render_proc) | 1723 if (!render_proc) |
1724 return false; | 1724 return false; |
1725 #endif // defined(OS_WIN) | 1725 #endif // defined(OS_WIN) |
1726 | 1726 |
1727 bool ret = false; | 1727 bool ret = false; |
1728 #if defined(OS_LINUX) || defined(OS_MACOSX) | 1728 #if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_NACL) |
1729 // On Linux we just set the final bits in the native metafile | 1729 // On Linux we just set the final bits in the native metafile |
1730 // (NativeMetafile and PreviewMetafile must have compatible formats, | 1730 // (NativeMetafile and PreviewMetafile must have compatible formats, |
1731 // i.e. both PDF for this to work). | 1731 // i.e. both PDF for this to work). |
1732 printing::Metafile* metafile = | 1732 printing::Metafile* metafile = |
1733 printing::MetafileSkiaWrapper::GetMetafileFromCanvas(*canvas); | 1733 printing::MetafileSkiaWrapper::GetMetafileFromCanvas(*canvas); |
1734 DCHECK(metafile != NULL); | 1734 DCHECK(metafile != NULL); |
1735 if (metafile) | 1735 if (metafile) |
1736 ret = metafile->InitFromData(mapper.data(), mapper.size()); | 1736 ret = metafile->InitFromData(mapper.data(), mapper.size()); |
1737 #elif defined(OS_WIN) | 1737 #elif defined(OS_WIN) |
1738 printing::Metafile* metafile = | 1738 printing::Metafile* metafile = |
(...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2903 // Running out-of-process. Initiate an IPC call to notify the plugin | 2903 // Running out-of-process. Initiate an IPC call to notify the plugin |
2904 // process. | 2904 // process. |
2905 ppapi::proxy::HostDispatcher* dispatcher = | 2905 ppapi::proxy::HostDispatcher* dispatcher = |
2906 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); | 2906 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); |
2907 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( | 2907 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( |
2908 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); | 2908 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); |
2909 } | 2909 } |
2910 } | 2910 } |
2911 | 2911 |
2912 } // namespace content | 2912 } // namespace content |
OLD | NEW |