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 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1291 pending_connect_tcps_.Remove(request_id); | 1291 pending_connect_tcps_.Remove(request_id); |
1292 | 1292 |
1293 connector->CompleteConnectTcp(socket, local_addr, remote_addr); | 1293 connector->CompleteConnectTcp(socket, local_addr, remote_addr); |
1294 } | 1294 } |
1295 | 1295 |
1296 int32_t PepperPluginDelegateImpl::ShowContextMenu( | 1296 int32_t PepperPluginDelegateImpl::ShowContextMenu( |
1297 webkit::ppapi::PluginInstance* instance, | 1297 webkit::ppapi::PluginInstance* instance, |
1298 webkit::ppapi::PPB_Flash_Menu_Impl* menu, | 1298 webkit::ppapi::PPB_Flash_Menu_Impl* menu, |
1299 const gfx::Point& position) { | 1299 const gfx::Point& position) { |
1300 int32 render_widget_id = render_view_->routing_id(); | 1300 int32 render_widget_id = render_view_->routing_id(); |
1301 if (instance->IsFullscreen(instance->pp_instance())) { | |
1302 webkit::ppapi::FullscreenContainer* container = | |
1303 instance->fullscreen_container(); | |
1304 DCHECK(container); | |
1305 render_widget_id = | |
1306 static_cast<RenderWidgetFullscreenPepper*>(container)->routing_id(); | |
1307 } | |
1308 | 1301 |
1309 int request_id = pending_context_menus_.Add( | 1302 int request_id = pending_context_menus_.Add( |
1310 new scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl>(menu)); | 1303 new scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl>(menu)); |
1311 | 1304 |
1312 ContextMenuParams params; | 1305 ContextMenuParams params; |
1313 params.x = position.x(); | 1306 params.x = position.x(); |
1314 params.y = position.y(); | 1307 params.y = position.y(); |
1315 params.custom_context.is_pepper_menu = true; | 1308 params.custom_context.is_pepper_menu = true; |
1316 params.custom_context.request_id = request_id; | 1309 params.custom_context.request_id = request_id; |
1317 params.custom_context.render_widget_id = render_widget_id; | 1310 params.custom_context.render_widget_id = render_widget_id; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1361 | 1354 |
1362 void PepperPluginDelegateImpl::OnCustomContextMenuAction( | 1355 void PepperPluginDelegateImpl::OnCustomContextMenuAction( |
1363 const webkit_glue::CustomContextMenuContext& custom_context, | 1356 const webkit_glue::CustomContextMenuContext& custom_context, |
1364 unsigned action) { | 1357 unsigned action) { |
1365 // Just save the action. | 1358 // Just save the action. |
1366 DCHECK(!has_saved_context_menu_action_); | 1359 DCHECK(!has_saved_context_menu_action_); |
1367 has_saved_context_menu_action_ = true; | 1360 has_saved_context_menu_action_ = true; |
1368 saved_context_menu_action_ = action; | 1361 saved_context_menu_action_ = action; |
1369 } | 1362 } |
1370 | 1363 |
1371 webkit::ppapi::FullscreenContainer* | 1364 void PepperPluginDelegateImpl::SetFullscreen( |
brettw
2011/08/24 23:14:04
Do we even need this function anymore? The code in
jeremya
2011/08/24 23:40:45
Done. Good catch :)
| |
1372 PepperPluginDelegateImpl::CreateFullscreenContainer( | 1365 webkit::ppapi::PluginInstance* instance, |
1373 webkit::ppapi::PluginInstance* instance) { | 1366 bool fullscreen) { |
1374 return render_view_->CreatePepperFullscreenContainer(instance); | 1367 instance->container()->setFullscreen(fullscreen); |
1375 } | 1368 } |
1376 | 1369 |
1377 gfx::Size PepperPluginDelegateImpl::GetScreenSize() { | 1370 gfx::Size PepperPluginDelegateImpl::GetScreenSize() { |
1378 WebKit::WebScreenInfo info = render_view_->screenInfo(); | 1371 WebKit::WebScreenInfo info = render_view_->screenInfo(); |
1379 return gfx::Size(info.rect.width, info.rect.height); | 1372 return gfx::Size(info.rect.width, info.rect.height); |
1380 } | 1373 } |
1381 | 1374 |
1382 std::string PepperPluginDelegateImpl::GetDefaultEncoding() { | 1375 std::string PepperPluginDelegateImpl::GetDefaultEncoding() { |
1383 // TODO(brettw) bug 56615: Somehow get the preference for the default | 1376 // TODO(brettw) bug 56615: Somehow get the preference for the default |
1384 // encoding here rather than using the global default for the UI language. | 1377 // encoding here rather than using the global default for the UI language. |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1475 | 1468 |
1476 ppapi::Preferences PepperPluginDelegateImpl::GetPreferences() { | 1469 ppapi::Preferences PepperPluginDelegateImpl::GetPreferences() { |
1477 return ppapi::Preferences(render_view_->webkit_preferences()); | 1470 return ppapi::Preferences(render_view_->webkit_preferences()); |
1478 } | 1471 } |
1479 | 1472 |
1480 void PepperPluginDelegateImpl::PublishInitialPolicy( | 1473 void PepperPluginDelegateImpl::PublishInitialPolicy( |
1481 scoped_refptr<webkit::ppapi::PluginInstance> instance, | 1474 scoped_refptr<webkit::ppapi::PluginInstance> instance, |
1482 const std::string& policy) { | 1475 const std::string& policy) { |
1483 instance->HandlePolicyUpdate(policy); | 1476 instance->HandlePolicyUpdate(policy); |
1484 } | 1477 } |
OLD | NEW |