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