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

Side by Side Diff: chrome/plugin/webplugin_delegate_stub.cc

Issue 6611032: Unifying NativeMetafile class interface (as much as possible) for Linux, Mac, Win (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed win unittests, style changes, cleaned up StartPage parameters for cairo. Created 9 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/plugin/webplugin_delegate_stub.h" 5 #include "chrome/plugin/webplugin_delegate_stub.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "chrome/common/child_process_logging.h" 10 #include "chrome/common/child_process_logging.h"
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 270
271 void WebPluginDelegateStub::OnPrint(base::SharedMemoryHandle* shared_memory, 271 void WebPluginDelegateStub::OnPrint(base::SharedMemoryHandle* shared_memory,
272 uint32* size) { 272 uint32* size) {
273 #if defined(OS_WIN) 273 #if defined(OS_WIN)
274 scoped_ptr<printing::NativeMetafile> metafile( 274 scoped_ptr<printing::NativeMetafile> metafile(
275 printing::NativeMetafileFactory::CreateMetafile()); 275 printing::NativeMetafileFactory::CreateMetafile());
276 if (!metafile->CreateDc(NULL, NULL)) { 276 if (!metafile->CreateDc(NULL, NULL)) {
277 NOTREACHED(); 277 NOTREACHED();
278 return; 278 return;
279 } 279 }
280 HDC hdc = metafile->hdc(); 280 HDC hdc = metafile->context();
281 skia::PlatformDevice::InitializeDC(hdc); 281 skia::PlatformDevice::InitializeDC(hdc);
282 delegate_->Print(hdc); 282 delegate_->Print(hdc);
283 if (!metafile->CloseDc()) { 283 if (!metafile->Close()) {
284 NOTREACHED(); 284 NOTREACHED();
285 return; 285 return;
286 } 286 }
287 287
288 *size = metafile->GetDataSize(); 288 *size = metafile->GetDataSize();
289 DCHECK(*size); 289 DCHECK(*size);
290 base::SharedMemory shared_buf; 290 base::SharedMemory shared_buf;
291 CreateSharedBuffer(*size, &shared_buf, shared_memory); 291 CreateSharedBuffer(*size, &shared_buf, shared_memory);
292 292
293 // Retrieve a copy of the data. 293 // Retrieve a copy of the data.
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 webplugin_->OnResourceCreated(resource_id, resource_client); 442 webplugin_->OnResourceCreated(resource_id, resource_client);
443 } 443 }
444 444
445 #if defined(OS_MACOSX) 445 #if defined(OS_MACOSX)
446 void WebPluginDelegateStub::OnSetFakeAcceleratedSurfaceWindowHandle( 446 void WebPluginDelegateStub::OnSetFakeAcceleratedSurfaceWindowHandle(
447 gfx::PluginWindowHandle window) { 447 gfx::PluginWindowHandle window) {
448 delegate_->set_windowed_handle(window); 448 delegate_->set_windowed_handle(window);
449 } 449 }
450 #endif 450 #endif
451 451
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698