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