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

Unified Diff: chrome/renderer/webplugin_delegate_proxy.cc

Issue 6544028: Create a Factory for NativeMetafile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ARM compile failure fix Created 9 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/webplugin_delegate_pepper.cc ('k') | chrome/service/service_utility_process_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/webplugin_delegate_proxy.cc
diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc
index 0c988713caf0f116f76a449c08e267e44cc6be5d..bc6584336eb23950f9e84eed78d251fb1959d083 100644
--- a/chrome/renderer/webplugin_delegate_proxy.cc
+++ b/chrome/renderer/webplugin_delegate_proxy.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -15,6 +15,7 @@
#include "base/file_util.h"
#include "base/logging.h"
#include "base/ref_counted.h"
+#include "base/scoped_ptr.h"
#include "base/string_split.h"
#include "base/string_util.h"
#include "base/sys_info.h"
@@ -33,7 +34,6 @@
#include "grit/renderer_resources.h"
#include "ipc/ipc_channel_handle.h"
#include "net/base/mime_util.h"
-#include "printing/native_metafile.h"
#include "skia/ext/platform_canvas.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h"
@@ -54,6 +54,11 @@
#include "ipc/ipc_channel_posix.h"
#endif
+#if defined(OS_WIN)
+#include "printing/native_metafile_factory.h"
+#include "printing/native_metafile.h"
+#endif
+
using WebKit::WebBindings;
using WebKit::WebCursorInfo;
using WebKit::WebDragData;
@@ -926,13 +931,14 @@ void WebPluginDelegateProxy::Print(gfx::NativeDrawingContext context) {
}
#if defined(OS_WIN)
- printing::NativeMetafile metafile;
- if (!metafile.Init(memory.memory(), size)) {
+ scoped_ptr<printing::NativeMetafile> metafile(
+ printing::NativeMetafileFactory::CreateMetafile());
+ if (!metafile->Init(memory.memory(), size)) {
NOTREACHED();
return;
}
// Playback the buffer.
- metafile.Playback(context, NULL);
+ metafile->Playback(context, NULL);
#else
// TODO(port): plugin printing.
NOTIMPLEMENTED();
« no previous file with comments | « chrome/renderer/webplugin_delegate_pepper.cc ('k') | chrome/service/service_utility_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698