| 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_proxy.h" | 5 #include "content/plugin/webplugin_proxy.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 Send(msg); | 667 Send(msg); |
| 668 } | 668 } |
| 669 | 669 |
| 670 void WebPluginProxy::BindFakePluginWindowHandle(bool opaque) { | 670 void WebPluginProxy::BindFakePluginWindowHandle(bool opaque) { |
| 671 Send(new PluginHostMsg_BindFakePluginWindowHandle(route_id_, opaque)); | 671 Send(new PluginHostMsg_BindFakePluginWindowHandle(route_id_, opaque)); |
| 672 } | 672 } |
| 673 | 673 |
| 674 WebPluginAcceleratedSurface* WebPluginProxy::GetAcceleratedSurface( | 674 WebPluginAcceleratedSurface* WebPluginProxy::GetAcceleratedSurface( |
| 675 gfx::GpuPreference gpu_preference) { | 675 gfx::GpuPreference gpu_preference) { |
| 676 if (!accelerated_surface_.get()) | 676 if (!accelerated_surface_.get()) |
| 677 accelerated_surface_.reset(new WebPluginAcceleratedSurfaceProxy( | 677 accelerated_surface_.reset( |
| 678 this, gpu_preference)); | 678 WebPluginAcceleratedSurfaceProxy::Create(this, gpu_preference)); |
| 679 return accelerated_surface_.get(); | 679 return accelerated_surface_.get(); |
| 680 } | 680 } |
| 681 | 681 |
| 682 void WebPluginProxy::AcceleratedFrameBuffersDidSwap( | 682 void WebPluginProxy::AcceleratedFrameBuffersDidSwap( |
| 683 gfx::PluginWindowHandle window, uint64 surface_id) { | 683 gfx::PluginWindowHandle window, uint64 surface_id) { |
| 684 Send(new PluginHostMsg_AcceleratedSurfaceBuffersSwapped( | 684 Send(new PluginHostMsg_AcceleratedSurfaceBuffersSwapped( |
| 685 route_id_, window, surface_id)); | 685 route_id_, window, surface_id)); |
| 686 } | 686 } |
| 687 | 687 |
| 688 void WebPluginProxy::SetAcceleratedSurface( | 688 void WebPluginProxy::SetAcceleratedSurface( |
| (...skipping 14 matching lines...) Expand all Loading... |
| 703 } | 703 } |
| 704 | 704 |
| 705 void WebPluginProxy::AllocSurfaceDIB(const size_t size, | 705 void WebPluginProxy::AllocSurfaceDIB(const size_t size, |
| 706 TransportDIB::Handle* dib_handle) { | 706 TransportDIB::Handle* dib_handle) { |
| 707 Send(new PluginHostMsg_AllocTransportDIB(route_id_, size, dib_handle)); | 707 Send(new PluginHostMsg_AllocTransportDIB(route_id_, size, dib_handle)); |
| 708 } | 708 } |
| 709 | 709 |
| 710 void WebPluginProxy::FreeSurfaceDIB(TransportDIB::Id dib_id) { | 710 void WebPluginProxy::FreeSurfaceDIB(TransportDIB::Id dib_id) { |
| 711 Send(new PluginHostMsg_FreeTransportDIB(route_id_, dib_id)); | 711 Send(new PluginHostMsg_FreeTransportDIB(route_id_, dib_id)); |
| 712 } | 712 } |
| 713 |
| 714 void WebPluginProxy::AcceleratedPluginEnabledRendering() { |
| 715 Send(new PluginHostMsg_AcceleratedPluginEnabledRendering(route_id_)); |
| 716 } |
| 717 |
| 718 void WebPluginProxy::AcceleratedPluginAllocatedIOSurface(int32 width, |
| 719 int32 height, |
| 720 uint32 surface_id) { |
| 721 Send(new PluginHostMsg_AcceleratedPluginAllocatedIOSurface( |
| 722 route_id_, width, height, surface_id)); |
| 723 } |
| 724 |
| 725 void WebPluginProxy::AcceleratedPluginSwappedIOSurface() { |
| 726 Send(new PluginHostMsg_AcceleratedPluginSwappedIOSurface( |
| 727 route_id_)); |
| 728 } |
| 713 #endif | 729 #endif |
| 714 | 730 |
| 715 void WebPluginProxy::OnPaint(const gfx::Rect& damaged_rect) { | 731 void WebPluginProxy::OnPaint(const gfx::Rect& damaged_rect) { |
| 716 content::GetContentClient()->SetActiveURL(page_url_); | 732 content::GetContentClient()->SetActiveURL(page_url_); |
| 717 | 733 |
| 718 Paint(damaged_rect); | 734 Paint(damaged_rect); |
| 719 bool allow_buffer_flipping; | 735 bool allow_buffer_flipping; |
| 720 #if defined(OS_MACOSX) | 736 #if defined(OS_MACOSX) |
| 721 allow_buffer_flipping = delegate_->AllowBufferFlipping(); | 737 allow_buffer_flipping = delegate_->AllowBufferFlipping(); |
| 722 #else | 738 #else |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 // Retrieve the IME status from a plug-in and send it to a renderer process | 770 // Retrieve the IME status from a plug-in and send it to a renderer process |
| 755 // when the plug-in has updated it. | 771 // when the plug-in has updated it. |
| 756 int input_type; | 772 int input_type; |
| 757 gfx::Rect caret_rect; | 773 gfx::Rect caret_rect; |
| 758 if (!delegate_->GetIMEStatus(&input_type, &caret_rect)) | 774 if (!delegate_->GetIMEStatus(&input_type, &caret_rect)) |
| 759 return; | 775 return; |
| 760 | 776 |
| 761 Send(new PluginHostMsg_NotifyIMEStatus(route_id_, input_type, caret_rect)); | 777 Send(new PluginHostMsg_NotifyIMEStatus(route_id_, input_type, caret_rect)); |
| 762 } | 778 } |
| 763 #endif | 779 #endif |
| OLD | NEW |