OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/renderer/webplugin_delegate_proxy.h" | 5 #include "chrome/renderer/webplugin_delegate_proxy.h" |
6 | 6 |
7 #include <atlbase.h> | 7 #include <atlbase.h> |
8 | 8 |
9 #include "generated_resources.h" | 9 #include "generated_resources.h" |
10 | 10 |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 void WebPluginDelegateProxy::ResetWindowlessBitmaps() { | 390 void WebPluginDelegateProxy::ResetWindowlessBitmaps() { |
391 backing_store_.reset(); | 391 backing_store_.reset(); |
392 transport_store_.reset(); | 392 transport_store_.reset(); |
393 backing_store_canvas_.reset(); | 393 backing_store_canvas_.reset(); |
394 transport_store_canvas_.reset(); | 394 transport_store_canvas_.reset(); |
395 background_store_.reset(); | 395 background_store_.reset(); |
396 background_store_canvas_.release(); | 396 background_store_canvas_.release(); |
397 } | 397 } |
398 | 398 |
399 bool WebPluginDelegateProxy::CreateBitmap( | 399 bool WebPluginDelegateProxy::CreateBitmap( |
400 scoped_ptr<SharedMemory>* memory, | 400 scoped_ptr<base::SharedMemory>* memory, |
401 scoped_ptr<gfx::PlatformCanvasWin>* canvas) { | 401 scoped_ptr<gfx::PlatformCanvasWin>* canvas) { |
402 size_t size = GetPaintBufSize(plugin_rect_); | 402 size_t size = GetPaintBufSize(plugin_rect_); |
403 scoped_ptr<SharedMemory> new_shared_memory(new SharedMemory()); | 403 scoped_ptr<base::SharedMemory> new_shared_memory(new base::SharedMemory()); |
404 if (!new_shared_memory->Create(L"", false, true, size)) | 404 if (!new_shared_memory->Create(L"", false, true, size)) |
405 return false; | 405 return false; |
406 | 406 |
407 scoped_ptr<gfx::PlatformCanvasWin> new_canvas(new gfx::PlatformCanvasWin); | 407 scoped_ptr<gfx::PlatformCanvasWin> new_canvas(new gfx::PlatformCanvasWin); |
408 if (!new_canvas->initialize(plugin_rect_.width(), plugin_rect_.height(), | 408 if (!new_canvas->initialize(plugin_rect_.width(), plugin_rect_.height(), |
409 true, new_shared_memory->handle())) { | 409 true, new_shared_memory->handle())) { |
410 return false; | 410 return false; |
411 } | 411 } |
412 | 412 |
413 memory->swap(new_shared_memory); | 413 memory->swap(new_shared_memory); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 return true; | 508 return true; |
509 } | 509 } |
510 | 510 |
511 return false; | 511 return false; |
512 } | 512 } |
513 | 513 |
514 void WebPluginDelegateProxy::Print(HDC hdc) { | 514 void WebPluginDelegateProxy::Print(HDC hdc) { |
515 PluginMsg_PrintResponse_Params params = { 0 }; | 515 PluginMsg_PrintResponse_Params params = { 0 }; |
516 Send(new PluginMsg_Print(instance_id_, ¶ms)); | 516 Send(new PluginMsg_Print(instance_id_, ¶ms)); |
517 | 517 |
518 SharedMemory memory(params.shared_memory, true); | 518 base::SharedMemory memory(params.shared_memory, true); |
519 if (!memory.Map(params.size)) { | 519 if (!memory.Map(params.size)) { |
520 NOTREACHED(); | 520 NOTREACHED(); |
521 return; | 521 return; |
522 } | 522 } |
523 | 523 |
524 gfx::Emf emf; | 524 gfx::Emf emf; |
525 if (!emf.CreateFromData(memory.memory(), params.size)) { | 525 if (!emf.CreateFromData(memory.memory(), params.size)) { |
526 NOTREACHED(); | 526 NOTREACHED(); |
527 return; | 527 return; |
528 } | 528 } |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 plugin_->CancelDocumentLoad(); | 745 plugin_->CancelDocumentLoad(); |
746 } | 746 } |
747 | 747 |
748 void WebPluginDelegateProxy::OnInitiateHTTPRangeRequest( | 748 void WebPluginDelegateProxy::OnInitiateHTTPRangeRequest( |
749 const std::string& url, const std::string& range_info, | 749 const std::string& url, const std::string& range_info, |
750 HANDLE existing_stream, bool notify_needed, HANDLE notify_data) { | 750 HANDLE existing_stream, bool notify_needed, HANDLE notify_data) { |
751 plugin_->InitiateHTTPRangeRequest(url.c_str(), range_info.c_str(), | 751 plugin_->InitiateHTTPRangeRequest(url.c_str(), range_info.c_str(), |
752 existing_stream, notify_needed, | 752 existing_stream, notify_needed, |
753 notify_data); | 753 notify_data); |
754 } | 754 } |
OLD | NEW |