OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 28 matching lines...) Expand all Loading... |
39 #include "content/public/common/sandbox_init.h" | 39 #include "content/public/common/sandbox_init.h" |
40 #endif | 40 #endif |
41 | 41 |
42 using WebKit::WebBindings; | 42 using WebKit::WebBindings; |
43 | 43 |
44 using webkit::npapi::WebPluginResourceClient; | 44 using webkit::npapi::WebPluginResourceClient; |
45 #if defined(OS_MACOSX) | 45 #if defined(OS_MACOSX) |
46 using webkit::npapi::WebPluginAcceleratedSurface; | 46 using webkit::npapi::WebPluginAcceleratedSurface; |
47 #endif | 47 #endif |
48 | 48 |
| 49 namespace content { |
49 | 50 |
50 WebPluginProxy::SharedTransportDIB::SharedTransportDIB(TransportDIB* dib) | 51 WebPluginProxy::SharedTransportDIB::SharedTransportDIB(TransportDIB* dib) |
51 : dib_(dib) { | 52 : dib_(dib) { |
52 } | 53 } |
53 | 54 |
54 WebPluginProxy::SharedTransportDIB::~SharedTransportDIB() { | 55 WebPluginProxy::SharedTransportDIB::~SharedTransportDIB() { |
55 } | 56 } |
56 | 57 |
57 WebPluginProxy::WebPluginProxy( | 58 WebPluginProxy::WebPluginProxy( |
58 PluginChannel* channel, | 59 PluginChannel* channel, |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 #elif defined(USE_X11) | 135 #elif defined(USE_X11) |
135 // Nothing to do. | 136 // Nothing to do. |
136 #else | 137 #else |
137 NOTIMPLEMENTED(); | 138 NOTIMPLEMENTED(); |
138 #endif | 139 #endif |
139 } | 140 } |
140 | 141 |
141 #if defined(OS_WIN) | 142 #if defined(OS_WIN) |
142 void WebPluginProxy::SetWindowlessPumpEvent(HANDLE pump_messages_event) { | 143 void WebPluginProxy::SetWindowlessPumpEvent(HANDLE pump_messages_event) { |
143 HANDLE pump_messages_event_for_renderer = NULL; | 144 HANDLE pump_messages_event_for_renderer = NULL; |
144 content::BrokerDuplicateHandle(pump_messages_event, channel_->peer_pid(), | 145 BrokerDuplicateHandle(pump_messages_event, channel_->peer_pid(), |
145 &pump_messages_event_for_renderer, | 146 &pump_messages_event_for_renderer, |
146 SYNCHRONIZE | EVENT_MODIFY_STATE, 0); | 147 SYNCHRONIZE | EVENT_MODIFY_STATE, 0); |
147 DCHECK(pump_messages_event_for_renderer != NULL); | 148 DCHECK(pump_messages_event_for_renderer != NULL); |
148 Send(new PluginHostMsg_SetWindowlessPumpEvent( | 149 Send(new PluginHostMsg_SetWindowlessPumpEvent( |
149 route_id_, pump_messages_event_for_renderer)); | 150 route_id_, pump_messages_event_for_renderer)); |
150 } | 151 } |
151 #endif | 152 #endif |
152 | 153 |
153 void WebPluginProxy::CancelResource(unsigned long id) { | 154 void WebPluginProxy::CancelResource(unsigned long id) { |
154 Send(new PluginHostMsg_CancelResource(route_id_, id)); | 155 Send(new PluginHostMsg_CancelResource(route_id_, id)); |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 route_id_, width, height, surface_id)); | 740 route_id_, width, height, surface_id)); |
740 } | 741 } |
741 | 742 |
742 void WebPluginProxy::AcceleratedPluginSwappedIOSurface() { | 743 void WebPluginProxy::AcceleratedPluginSwappedIOSurface() { |
743 Send(new PluginHostMsg_AcceleratedPluginSwappedIOSurface( | 744 Send(new PluginHostMsg_AcceleratedPluginSwappedIOSurface( |
744 route_id_)); | 745 route_id_)); |
745 } | 746 } |
746 #endif | 747 #endif |
747 | 748 |
748 void WebPluginProxy::OnPaint(const gfx::Rect& damaged_rect) { | 749 void WebPluginProxy::OnPaint(const gfx::Rect& damaged_rect) { |
749 content::GetContentClient()->SetActiveURL(page_url_); | 750 GetContentClient()->SetActiveURL(page_url_); |
750 | 751 |
751 Paint(damaged_rect); | 752 Paint(damaged_rect); |
752 Send(new PluginHostMsg_InvalidateRect(route_id_, damaged_rect)); | 753 Send(new PluginHostMsg_InvalidateRect(route_id_, damaged_rect)); |
753 } | 754 } |
754 | 755 |
755 bool WebPluginProxy::IsOffTheRecord() { | 756 bool WebPluginProxy::IsOffTheRecord() { |
756 return channel_->incognito(); | 757 return channel_->incognito(); |
757 } | 758 } |
758 | 759 |
759 void WebPluginProxy::ResourceClientDeleted( | 760 void WebPluginProxy::ResourceClientDeleted( |
(...skipping 19 matching lines...) Expand all Loading... |
779 // Retrieve the IME status from a plug-in and send it to a renderer process | 780 // Retrieve the IME status from a plug-in and send it to a renderer process |
780 // when the plug-in has updated it. | 781 // when the plug-in has updated it. |
781 int input_type; | 782 int input_type; |
782 gfx::Rect caret_rect; | 783 gfx::Rect caret_rect; |
783 if (!delegate_->GetIMEStatus(&input_type, &caret_rect)) | 784 if (!delegate_->GetIMEStatus(&input_type, &caret_rect)) |
784 return; | 785 return; |
785 | 786 |
786 Send(new PluginHostMsg_NotifyIMEStatus(route_id_, input_type, caret_rect)); | 787 Send(new PluginHostMsg_NotifyIMEStatus(route_id_, input_type, caret_rect)); |
787 } | 788 } |
788 #endif | 789 #endif |
| 790 |
| 791 } // namespace content |
OLD | NEW |