summaryrefslogtreecommitdiffstats
path: root/chrome/plugin
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-02 17:20:21 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-02 17:20:21 +0000
commit7756e5b1e7919fe530ff1ff27503d4893efcee13 (patch)
tree5b7ac359e22bf58e5ae72fbdc57a6b6c92efe285 /chrome/plugin
parentf3e9d6e12d38ea05e476899eb2620c57d351f74b (diff)
downloadchromium_src-7756e5b1e7919fe530ff1ff27503d4893efcee13.zip
chromium_src-7756e5b1e7919fe530ff1ff27503d4893efcee13.tar.gz
chromium_src-7756e5b1e7919fe530ff1ff27503d4893efcee13.tar.bz2
Revert 76553 - Applying factory pattern (through NativeMetafileFactory class). It is used to retrieve different printing contexts (based on the platform and user preferences).
BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/6544028 TBR=dpapad@chromium.org Review URL: http://codereview.chromium.org/6594121 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76555 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin')
-rw-r--r--chrome/plugin/webplugin_delegate_stub.cc22
1 files changed, 8 insertions, 14 deletions
diff --git a/chrome/plugin/webplugin_delegate_stub.cc b/chrome/plugin/webplugin_delegate_stub.cc
index 75a3dc8..6b0f39a 100644
--- a/chrome/plugin/webplugin_delegate_stub.cc
+++ b/chrome/plugin/webplugin_delegate_stub.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 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.
@@ -14,6 +14,7 @@
#include "chrome/plugin/plugin_channel.h"
#include "chrome/plugin/plugin_thread.h"
#include "chrome/plugin/webplugin_proxy.h"
+#include "printing/native_metafile.h"
#include "third_party/npapi/bindings/npapi.h"
#include "third_party/npapi/bindings/npruntime.h"
#include "skia/ext/platform_device.h"
@@ -22,12 +23,6 @@
#include "webkit/plugins/npapi/webplugin_delegate_impl.h"
#include "webkit/glue/webcursor.h"
-#if defined(OS_WIN)
-#include "base/scoped_ptr.h"
-#include "printing/native_metafile_factory.h"
-#include "printing/native_metafile.h"
-#endif // defined(OS_WIN)
-
#if defined(ENABLE_GPU)
#include "app/gfx/gl/gl_context.h"
#endif
@@ -286,27 +281,26 @@ void WebPluginDelegateStub::OnDidPaint() {
void WebPluginDelegateStub::OnPrint(base::SharedMemoryHandle* shared_memory,
uint32* size) {
#if defined(OS_WIN)
- scoped_ptr<printing::NativeMetafile> metafile(
- printing::NativeMetafileFactory::CreateMetafile());
- if (!metafile->CreateDc(NULL, NULL)) {
+ printing::NativeMetafile metafile;
+ if (!metafile.CreateDc(NULL, NULL)) {
NOTREACHED();
return;
}
- HDC hdc = metafile->hdc();
+ HDC hdc = metafile.hdc();
skia::PlatformDevice::InitializeDC(hdc);
delegate_->Print(hdc);
- if (!metafile->CloseDc()) {
+ if (!metafile.CloseDc()) {
NOTREACHED();
return;
}
- *size = metafile->GetDataSize();
+ *size = metafile.GetDataSize();
DCHECK(*size);
base::SharedMemory shared_buf;
CreateSharedBuffer(*size, &shared_buf, shared_memory);
// Retrieve a copy of the data.
- bool success = metafile->GetData(shared_buf.memory(), *size);
+ bool success = metafile.GetData(shared_buf.memory(), *size);
DCHECK(success);
#else
// TODO(port): plugin printing.