Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Side by Side Diff: content/renderer/pepper/pepper_plugin_instance_impl.cc

Issue 516833002: Removed NativeMetafile and PreviewMetafile typedef as it's always PdfMetafileSkia. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@no_pdf
Patch Set: Thu Aug 28 17:07:38 PDT 2014 Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/renderer/printing/print_web_view_helper_pdf_win.cc ('k') | printing/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 #include "ui/gfx/image/image_skia_rep.h" 125 #include "ui/gfx/image/image_skia_rep.h"
126 #include "ui/gfx/range/range.h" 126 #include "ui/gfx/range/range.h"
127 #include "ui/gfx/rect_conversions.h" 127 #include "ui/gfx/rect_conversions.h"
128 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" 128 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
129 #include "v8/include/v8.h" 129 #include "v8/include/v8.h"
130 130
131 #if defined(OS_CHROMEOS) 131 #if defined(OS_CHROMEOS)
132 #include "ui/events/keycodes/keyboard_codes_posix.h" 132 #include "ui/events/keycodes/keyboard_codes_posix.h"
133 #endif 133 #endif
134 134
135 #if defined(OS_MACOSX)
136 #include "printing/metafile_impl.h"
137 #endif // defined(OS_MACOSX)
138
139 #if defined(OS_WIN) 135 #if defined(OS_WIN)
140 #include "base/metrics/histogram.h" 136 #include "base/metrics/histogram.h"
141 #include "base/win/windows_version.h" 137 #include "base/win/windows_version.h"
142 #include "skia/ext/platform_canvas.h" 138 #include "skia/ext/platform_canvas.h"
143 #include "ui/gfx/codec/jpeg_codec.h" 139 #include "ui/gfx/codec/jpeg_codec.h"
144 #include "ui/gfx/gdi_util.h" 140 #include "ui/gfx/gdi_util.h"
145 #endif 141 #endif
146 142
147 using base::StringPrintf; 143 using base::StringPrintf;
148 using ppapi::InputEventData; 144 using ppapi::InputEventData;
(...skipping 1794 matching lines...) Expand 10 before | Expand all | Expand 10 after
1943 if (!pdf_module) 1939 if (!pdf_module)
1944 return false; 1940 return false;
1945 RenderPDFPageToDCProc render_proc = reinterpret_cast<RenderPDFPageToDCProc>( 1941 RenderPDFPageToDCProc render_proc = reinterpret_cast<RenderPDFPageToDCProc>(
1946 GetProcAddress(pdf_module, "RenderPDFPageToDC")); 1942 GetProcAddress(pdf_module, "RenderPDFPageToDC"));
1947 if (!render_proc) 1943 if (!render_proc)
1948 return false; 1944 return false;
1949 #endif // defined(OS_WIN) 1945 #endif // defined(OS_WIN)
1950 1946
1951 bool ret = false; 1947 bool ret = false;
1952 #if defined(OS_POSIX) && !defined(OS_ANDROID) 1948 #if defined(OS_POSIX) && !defined(OS_ANDROID)
1953 // On Linux we just set the final bits in the native metafile
1954 // (NativeMetafile and PreviewMetafile must have compatible formats,
1955 // i.e. both PDF for this to work).
1956 printing::Metafile* metafile = 1949 printing::Metafile* metafile =
1957 printing::MetafileSkiaWrapper::GetMetafileFromCanvas(*canvas); 1950 printing::MetafileSkiaWrapper::GetMetafileFromCanvas(*canvas);
1958 DCHECK(metafile != NULL); 1951 DCHECK(metafile != NULL);
1959 if (metafile) 1952 if (metafile)
1960 ret = metafile->InitFromData(mapper.data(), mapper.size()); 1953 ret = metafile->InitFromData(mapper.data(), mapper.size());
1961 #elif defined(OS_WIN) 1954 #elif defined(OS_WIN)
1962 printing::Metafile* metafile = 1955 printing::Metafile* metafile =
1963 printing::MetafileSkiaWrapper::GetMetafileFromCanvas(*canvas); 1956 printing::MetafileSkiaWrapper::GetMetafileFromCanvas(*canvas);
1964 if (metafile) { 1957 if (metafile) {
1965 // We only have a metafile when doing print preview, so we just want to 1958 // We only have a metafile when doing print preview, so we just want to
(...skipping 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after
3318 // Running out-of-process. Initiate an IPC call to notify the plugin 3311 // Running out-of-process. Initiate an IPC call to notify the plugin
3319 // process. 3312 // process.
3320 ppapi::proxy::HostDispatcher* dispatcher = 3313 ppapi::proxy::HostDispatcher* dispatcher =
3321 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); 3314 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance());
3322 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( 3315 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad(
3323 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); 3316 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data));
3324 } 3317 }
3325 } 3318 }
3326 3319
3327 } // namespace content 3320 } // namespace content
OLDNEW
« no previous file with comments | « chrome/renderer/printing/print_web_view_helper_pdf_win.cc ('k') | printing/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698