OLD | NEW |
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 "content/plugin/webplugin_delegate_stub.h" | 5 #include "content/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 "content/common/content_client.h" | 10 #include "content/common/content_client.h" |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 | 266 |
267 void WebPluginDelegateStub::OnDidPaint() { | 267 void WebPluginDelegateStub::OnDidPaint() { |
268 webplugin_->DidPaint(); | 268 webplugin_->DidPaint(); |
269 } | 269 } |
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::Create()); | 275 printing::NativeMetafileFactory::Create()); |
276 if (!metafile->CreateDc(NULL, NULL)) { | 276 if (!metafile->Init()) { |
277 NOTREACHED(); | 277 NOTREACHED(); |
278 return; | 278 return; |
279 } | 279 } |
280 HDC hdc = metafile->context(); | 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->FinishDocument()) { | 283 if (!metafile->FinishDocument()) { |
284 NOTREACHED(); | 284 NOTREACHED(); |
285 return; | 285 return; |
286 } | 286 } |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 delegate_->CreateSeekableResourceClient(resource_id, range_request_id); | 441 delegate_->CreateSeekableResourceClient(resource_id, range_request_id); |
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 |
OLD | NEW |