OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/webplugin_delegate_proxy.h" | 5 #include "content/renderer/webplugin_delegate_proxy.h" |
6 | 6 |
7 #if defined(TOOLKIT_USES_GTK) | 7 #if defined(TOOLKIT_USES_GTK) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #elif defined(USE_X11) | 9 #elif defined(USE_X11) |
10 #include <cairo/cairo.h> | 10 #include <cairo/cairo.h> |
(...skipping 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1310 void WebPluginDelegateProxy::OnBindFakePluginWindowHandle(bool opaque) { | 1310 void WebPluginDelegateProxy::OnBindFakePluginWindowHandle(bool opaque) { |
1311 BindFakePluginWindowHandle(opaque); | 1311 BindFakePluginWindowHandle(opaque); |
1312 } | 1312 } |
1313 | 1313 |
1314 // Synthesize a fake window handle for the plug-in to identify the instance | 1314 // Synthesize a fake window handle for the plug-in to identify the instance |
1315 // to the browser, allowing mapping to a surface for hardware acceleration | 1315 // to the browser, allowing mapping to a surface for hardware acceleration |
1316 // of plug-in content. The browser generates the handle which is then set on | 1316 // of plug-in content. The browser generates the handle which is then set on |
1317 // the plug-in. Returns true if it successfully sets the window handle on the | 1317 // the plug-in. Returns true if it successfully sets the window handle on the |
1318 // plug-in. | 1318 // plug-in. |
1319 bool WebPluginDelegateProxy::BindFakePluginWindowHandle(bool opaque) { | 1319 bool WebPluginDelegateProxy::BindFakePluginWindowHandle(bool opaque) { |
1320 gfx::PluginWindowHandle fake_window = NULL; | 1320 gfx::PluginWindowHandle fake_window = gfx::kNullPluginWindow; |
1321 if (render_view_) | 1321 if (render_view_) |
1322 fake_window = render_view_->AllocateFakePluginWindowHandle(opaque, false); | 1322 fake_window = render_view_->AllocateFakePluginWindowHandle(opaque, false); |
1323 // If we aren't running on 10.6, this allocation will fail. | 1323 // If we aren't running on 10.6, this allocation will fail. |
1324 if (!fake_window) | 1324 if (!fake_window) |
1325 return false; | 1325 return false; |
1326 OnSetWindow(fake_window); | 1326 OnSetWindow(fake_window); |
1327 if (!Send(new PluginMsg_SetFakeAcceleratedSurfaceWindowHandle(instance_id_, | 1327 if (!Send(new PluginMsg_SetFakeAcceleratedSurfaceWindowHandle(instance_id_, |
1328 fake_window))) { | 1328 fake_window))) { |
1329 return false; | 1329 return false; |
1330 } | 1330 } |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1408 } | 1408 } |
1409 | 1409 |
1410 void WebPluginDelegateProxy::OnAcceleratedSurfaceBuffersSwapped( | 1410 void WebPluginDelegateProxy::OnAcceleratedSurfaceBuffersSwapped( |
1411 gfx::PluginWindowHandle window, uint64 surface_handle) { | 1411 gfx::PluginWindowHandle window, uint64 surface_handle) { |
1412 if (render_view_) | 1412 if (render_view_) |
1413 render_view_->AcceleratedSurfaceBuffersSwapped(window, surface_handle); | 1413 render_view_->AcceleratedSurfaceBuffersSwapped(window, surface_handle); |
1414 } | 1414 } |
1415 | 1415 |
1416 void WebPluginDelegateProxy::OnAcceleratedPluginEnabledRendering() { | 1416 void WebPluginDelegateProxy::OnAcceleratedPluginEnabledRendering() { |
1417 uses_compositor_ = true; | 1417 uses_compositor_ = true; |
1418 OnSetWindow(NULL); | 1418 OnSetWindow(gfx::kNullPluginWindow); |
1419 } | 1419 } |
1420 | 1420 |
1421 void WebPluginDelegateProxy::OnAcceleratedPluginAllocatedIOSurface( | 1421 void WebPluginDelegateProxy::OnAcceleratedPluginAllocatedIOSurface( |
1422 int32 width, | 1422 int32 width, |
1423 int32 height, | 1423 int32 height, |
1424 uint32 surface_id) { | 1424 uint32 surface_id) { |
1425 if (plugin_) | 1425 if (plugin_) |
1426 plugin_->AcceleratedPluginAllocatedIOSurface(width, height, surface_id); | 1426 plugin_->AcceleratedPluginAllocatedIOSurface(width, height, surface_id); |
1427 } | 1427 } |
1428 | 1428 |
(...skipping 27 matching lines...) Expand all Loading... |
1456 } | 1456 } |
1457 #endif | 1457 #endif |
1458 | 1458 |
1459 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, | 1459 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, |
1460 int resource_id) { | 1460 int resource_id) { |
1461 if (!plugin_) | 1461 if (!plugin_) |
1462 return; | 1462 return; |
1463 | 1463 |
1464 plugin_->URLRedirectResponse(allow, resource_id); | 1464 plugin_->URLRedirectResponse(allow, resource_id); |
1465 } | 1465 } |
OLD | NEW |