| 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())) { |
| 1303 webkit::ppapi::FullscreenContainer* container = |
| 1304 instance->fullscreen_container(); |
| 1305 DCHECK(container); |
| 1306 render_widget_id = |
| 1307 static_cast<RenderWidgetFullscreenPepper*>(container)->routing_id(); |
| 1308 } |
| 1302 | 1309 |
| 1303 int request_id = pending_context_menus_.Add( | 1310 int request_id = pending_context_menus_.Add( |
| 1304 new scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl>(menu)); | 1311 new scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl>(menu)); |
| 1305 | 1312 |
| 1306 ContextMenuParams params; | 1313 ContextMenuParams params; |
| 1307 params.x = position.x(); | 1314 params.x = position.x(); |
| 1308 params.y = position.y(); | 1315 params.y = position.y(); |
| 1309 params.custom_context.is_pepper_menu = true; | 1316 params.custom_context.is_pepper_menu = true; |
| 1310 params.custom_context.request_id = request_id; | 1317 params.custom_context.request_id = request_id; |
| 1311 params.custom_context.render_widget_id = render_widget_id; | 1318 params.custom_context.render_widget_id = render_widget_id; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1355 | 1362 |
| 1356 void PepperPluginDelegateImpl::OnCustomContextMenuAction( | 1363 void PepperPluginDelegateImpl::OnCustomContextMenuAction( |
| 1357 const webkit_glue::CustomContextMenuContext& custom_context, | 1364 const webkit_glue::CustomContextMenuContext& custom_context, |
| 1358 unsigned action) { | 1365 unsigned action) { |
| 1359 // Just save the action. | 1366 // Just save the action. |
| 1360 DCHECK(!has_saved_context_menu_action_); | 1367 DCHECK(!has_saved_context_menu_action_); |
| 1361 has_saved_context_menu_action_ = true; | 1368 has_saved_context_menu_action_ = true; |
| 1362 saved_context_menu_action_ = action; | 1369 saved_context_menu_action_ = action; |
| 1363 } | 1370 } |
| 1364 | 1371 |
| 1372 webkit::ppapi::FullscreenContainer* |
| 1373 PepperPluginDelegateImpl::CreateFullscreenContainer( |
| 1374 webkit::ppapi::PluginInstance* instance) { |
| 1375 return render_view_->CreatePepperFullscreenContainer(instance); |
| 1376 } |
| 1377 |
| 1365 gfx::Size PepperPluginDelegateImpl::GetScreenSize() { | 1378 gfx::Size PepperPluginDelegateImpl::GetScreenSize() { |
| 1366 WebKit::WebScreenInfo info = render_view_->screenInfo(); | 1379 WebKit::WebScreenInfo info = render_view_->screenInfo(); |
| 1367 return gfx::Size(info.rect.width, info.rect.height); | 1380 return gfx::Size(info.rect.width, info.rect.height); |
| 1368 } | 1381 } |
| 1369 | 1382 |
| 1370 std::string PepperPluginDelegateImpl::GetDefaultEncoding() { | 1383 std::string PepperPluginDelegateImpl::GetDefaultEncoding() { |
| 1371 // TODO(brettw) bug 56615: Somehow get the preference for the default | 1384 // TODO(brettw) bug 56615: Somehow get the preference for the default |
| 1372 // encoding here rather than using the global default for the UI language. | 1385 // encoding here rather than using the global default for the UI language. |
| 1373 return content::GetContentClient()->renderer()->GetDefaultEncoding(); | 1386 return content::GetContentClient()->renderer()->GetDefaultEncoding(); |
| 1374 } | 1387 } |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1463 | 1476 |
| 1464 int PepperPluginDelegateImpl::GetRoutingId() const { | 1477 int PepperPluginDelegateImpl::GetRoutingId() const { |
| 1465 return render_view_->routing_id(); | 1478 return render_view_->routing_id(); |
| 1466 } | 1479 } |
| 1467 | 1480 |
| 1468 void PepperPluginDelegateImpl::PublishInitialPolicy( | 1481 void PepperPluginDelegateImpl::PublishInitialPolicy( |
| 1469 scoped_refptr<webkit::ppapi::PluginInstance> instance, | 1482 scoped_refptr<webkit::ppapi::PluginInstance> instance, |
| 1470 const std::string& policy) { | 1483 const std::string& policy) { |
| 1471 instance->HandlePolicyUpdate(policy); | 1484 instance->HandlePolicyUpdate(policy); |
| 1472 } | 1485 } |
| OLD | NEW |