| 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/renderer/pepper_plugin_delegate_impl.h" | 5 #include "content/renderer/pepper_plugin_delegate_impl.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <queue> | 8 #include <queue> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1292 pending_connect_tcps_.Remove(request_id); | 1292 pending_connect_tcps_.Remove(request_id); |
| 1293 | 1293 |
| 1294 connector->CompleteConnectTcp(socket, local_addr, remote_addr); | 1294 connector->CompleteConnectTcp(socket, local_addr, remote_addr); |
| 1295 } | 1295 } |
| 1296 | 1296 |
| 1297 int32_t PepperPluginDelegateImpl::ShowContextMenu( | 1297 int32_t PepperPluginDelegateImpl::ShowContextMenu( |
| 1298 webkit::ppapi::PluginInstance* instance, | 1298 webkit::ppapi::PluginInstance* instance, |
| 1299 webkit::ppapi::PPB_Flash_Menu_Impl* menu, | 1299 webkit::ppapi::PPB_Flash_Menu_Impl* menu, |
| 1300 const gfx::Point& position) { | 1300 const gfx::Point& position) { |
| 1301 int32 render_widget_id = render_view_->routing_id(); | 1301 int32 render_widget_id = render_view_->routing_id(); |
| 1302 if (instance->IsFullscreen(instance->pp_instance())) { | 1302 if (instance->IsFullscreen_Dev(instance->pp_instance())) { |
| 1303 webkit::ppapi::FullscreenContainer* container = | 1303 webkit::ppapi::FullscreenContainer* container = |
| 1304 instance->fullscreen_container(); | 1304 instance->fullscreen_container(); |
| 1305 DCHECK(container); | 1305 DCHECK(container); |
| 1306 render_widget_id = | 1306 render_widget_id = |
| 1307 static_cast<RenderWidgetFullscreenPepper*>(container)->routing_id(); | 1307 static_cast<RenderWidgetFullscreenPepper*>(container)->routing_id(); |
| 1308 } | 1308 } |
| 1309 | 1309 |
| 1310 int request_id = pending_context_menus_.Add( | 1310 int request_id = pending_context_menus_.Add( |
| 1311 new scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl>(menu)); | 1311 new scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl>(menu)); |
| 1312 | 1312 |
| 1313 ContextMenuParams params; | 1313 ContextMenuParams params; |
| 1314 params.x = position.x(); | 1314 params.x = position.x(); |
| 1315 params.y = position.y(); | 1315 params.y = position.y(); |
| 1316 params.custom_context.is_pepper_menu = true; | 1316 params.custom_context.is_pepper_menu = true; |
| 1317 params.custom_context.request_id = request_id; | 1317 params.custom_context.request_id = request_id; |
| 1318 params.custom_context.render_widget_id = render_widget_id; | 1318 params.custom_context.render_widget_id = render_widget_id; |
| 1319 params.custom_items = menu->menu_data(); | 1319 params.custom_items = menu->menu_data(); |
| 1320 | 1320 |
| 1321 // Transform the position to be in render view's coordinates. | 1321 // Transform the position to be in render view's coordinates. |
| 1322 if (instance->IsFullscreen(instance->pp_instance())) { | 1322 if (instance->IsFullscreen(instance->pp_instance()) || |
| 1323 instance->IsFullscreen_Dev(instance->pp_instance())) { |
| 1323 WebKit::WebRect rect = render_view_->windowRect(); | 1324 WebKit::WebRect rect = render_view_->windowRect(); |
| 1324 params.x -= rect.x; | 1325 params.x -= rect.x; |
| 1325 params.y -= rect.y; | 1326 params.y -= rect.y; |
| 1326 } else { | 1327 } else { |
| 1327 params.x += instance->position().x(); | 1328 params.x += instance->position().x(); |
| 1328 params.y += instance->position().y(); | 1329 params.y += instance->position().y(); |
| 1329 } | 1330 } |
| 1330 | 1331 |
| 1331 IPC::Message* msg = new ViewHostMsg_ContextMenu(render_view_->routing_id(), | 1332 IPC::Message* msg = new ViewHostMsg_ContextMenu(render_view_->routing_id(), |
| 1332 params); | 1333 params); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1476 | 1477 |
| 1477 int PepperPluginDelegateImpl::GetRoutingId() const { | 1478 int PepperPluginDelegateImpl::GetRoutingId() const { |
| 1478 return render_view_->routing_id(); | 1479 return render_view_->routing_id(); |
| 1479 } | 1480 } |
| 1480 | 1481 |
| 1481 void PepperPluginDelegateImpl::PublishInitialPolicy( | 1482 void PepperPluginDelegateImpl::PublishInitialPolicy( |
| 1482 scoped_refptr<webkit::ppapi::PluginInstance> instance, | 1483 scoped_refptr<webkit::ppapi::PluginInstance> instance, |
| 1483 const std::string& policy) { | 1484 const std::string& policy) { |
| 1484 instance->HandlePolicyUpdate(policy); | 1485 instance->HandlePolicyUpdate(policy); |
| 1485 } | 1486 } |
| OLD | NEW |