Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: content/renderer/pepper_plugin_delegate_impl.cc

Issue 7826017: Add PPB_Fullscreen;0.5. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | ppapi/api/dev/ppb_fullscreen_dev.idl » ('j') | ppapi/api/dev/ppb_fullscreen_dev.idl » ('J')

Powered by Google App Engine
This is Rietveld 408576698