| OLD | NEW |
| 1 // Copyright (c) 2009 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_proxy.h" | 5 #include "chrome/plugin/webplugin_proxy.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/scoped_handle.h" | 10 #include "base/scoped_handle.h" |
| 11 #include "base/shared_memory.h" | 11 #include "base/shared_memory.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" | 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" |
| 24 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" | 24 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
| 25 | 25 |
| 26 #if defined(OS_MACOSX) | 26 #if defined(OS_MACOSX) |
| 27 #include "base/mac/mac_util.h" | 27 #include "base/mac/mac_util.h" |
| 28 #include "base/mac/scoped_cftyperef.h" | 28 #include "base/mac/scoped_cftyperef.h" |
| 29 #include "chrome/plugin/webplugin_accelerated_surface_proxy_mac.h" | 29 #include "chrome/plugin/webplugin_accelerated_surface_proxy_mac.h" |
| 30 #endif | 30 #endif |
| 31 | 31 |
| 32 #if defined(OS_WIN) | 32 #if defined(OS_WIN) |
| 33 #include "app/win/win_util.h" | 33 #include "chrome/common/section_util_win.h" |
| 34 #include "gfx/gdi_util.h" | 34 #include "gfx/gdi_util.h" |
| 35 #endif | 35 #endif |
| 36 | 36 |
| 37 #if defined(USE_X11) | 37 #if defined(USE_X11) |
| 38 #include "ui/base/x/x11_util_internal.h" | 38 #include "ui/base/x/x11_util_internal.h" |
| 39 #endif | 39 #endif |
| 40 | 40 |
| 41 using WebKit::WebBindings; | 41 using WebKit::WebBindings; |
| 42 | 42 |
| 43 using webkit::npapi::WebPluginResourceClient; | 43 using webkit::npapi::WebPluginResourceClient; |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 const TransportDIB::Handle& background_buffer, | 528 const TransportDIB::Handle& background_buffer, |
| 529 const gfx::Rect& window_rect) { | 529 const gfx::Rect& window_rect) { |
| 530 // Create a canvas that will reference the shared bits. We have to handle | 530 // Create a canvas that will reference the shared bits. We have to handle |
| 531 // errors here since we're mapping a large amount of memory that may not fit | 531 // errors here since we're mapping a large amount of memory that may not fit |
| 532 // in our address space, or go wrong in some other way. | 532 // in our address space, or go wrong in some other way. |
| 533 windowless_canvas_.reset(new skia::PlatformCanvas); | 533 windowless_canvas_.reset(new skia::PlatformCanvas); |
| 534 if (!windowless_canvas_->initialize( | 534 if (!windowless_canvas_->initialize( |
| 535 window_rect.width(), | 535 window_rect.width(), |
| 536 window_rect.height(), | 536 window_rect.height(), |
| 537 true, | 537 true, |
| 538 app::win::GetSectionFromProcess(windowless_buffer, | 538 chrome::GetSectionFromProcess(windowless_buffer, |
| 539 channel_->renderer_handle(), false))) { | 539 channel_->renderer_handle(), false))) { |
| 540 windowless_canvas_.reset(); | 540 windowless_canvas_.reset(); |
| 541 background_canvas_.reset(); | 541 background_canvas_.reset(); |
| 542 return; | 542 return; |
| 543 } | 543 } |
| 544 | 544 |
| 545 if (background_buffer) { | 545 if (background_buffer) { |
| 546 background_canvas_.reset(new skia::PlatformCanvas); | 546 background_canvas_.reset(new skia::PlatformCanvas); |
| 547 if (!background_canvas_->initialize( | 547 if (!background_canvas_->initialize( |
| 548 window_rect.width(), | 548 window_rect.width(), |
| 549 window_rect.height(), | 549 window_rect.height(), |
| 550 true, | 550 true, |
| 551 app::win::GetSectionFromProcess(background_buffer, | 551 chrome::GetSectionFromProcess(background_buffer, |
| 552 channel_->renderer_handle(), false))) { | 552 channel_->renderer_handle(), false))) { |
| 553 windowless_canvas_.reset(); | 553 windowless_canvas_.reset(); |
| 554 background_canvas_.reset(); | 554 background_canvas_.reset(); |
| 555 return; | 555 return; |
| 556 } | 556 } |
| 557 } | 557 } |
| 558 } | 558 } |
| 559 | 559 |
| 560 #elif defined(OS_MACOSX) | 560 #elif defined(OS_MACOSX) |
| 561 | 561 |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 } else { | 731 } else { |
| 732 index++; | 732 index++; |
| 733 } | 733 } |
| 734 } | 734 } |
| 735 } | 735 } |
| 736 | 736 |
| 737 void WebPluginProxy::URLRedirectResponse(bool allow, int resource_id) { | 737 void WebPluginProxy::URLRedirectResponse(bool allow, int resource_id) { |
| 738 Send(new PluginHostMsg_URLRedirectResponse(route_id_, allow, resource_id)); | 738 Send(new PluginHostMsg_URLRedirectResponse(route_id_, allow, resource_id)); |
| 739 } | 739 } |
| 740 | 740 |
| OLD | NEW |