| 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_GTK) | 7 #if defined(TOOLKIT_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 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 | 639 |
| 640 bool WebPluginDelegateProxy::CreateSharedBitmap( | 640 bool WebPluginDelegateProxy::CreateSharedBitmap( |
| 641 scoped_ptr<TransportDIB>* memory, | 641 scoped_ptr<TransportDIB>* memory, |
| 642 scoped_ptr<skia::PlatformCanvas>* canvas) { | 642 scoped_ptr<skia::PlatformCanvas>* canvas) { |
| 643 const size_t size = BitmapSizeForPluginRect(plugin_rect_); | 643 const size_t size = BitmapSizeForPluginRect(plugin_rect_); |
| 644 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 644 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 645 memory->reset(TransportDIB::Create(size, 0)); | 645 memory->reset(TransportDIB::Create(size, 0)); |
| 646 if (!memory->get()) | 646 if (!memory->get()) |
| 647 return false; | 647 return false; |
| 648 #endif | 648 #endif |
| 649 #if defined(OS_MACOSX) | 649 #if defined(OS_POSIX) && !defined(TOOLKIT_GTK) && !defined(OS_ANDROID) |
| 650 TransportDIB::Handle handle; | 650 TransportDIB::Handle handle; |
| 651 IPC::Message* msg = new ViewHostMsg_AllocTransportDIB(size, false, &handle); | 651 IPC::Message* msg = new ViewHostMsg_AllocTransportDIB(size, false, &handle); |
| 652 if (!RenderThreadImpl::current()->Send(msg)) | 652 if (!RenderThreadImpl::current()->Send(msg)) |
| 653 return false; | 653 return false; |
| 654 if (handle.fd < 0) | 654 if (handle.fd < 0) |
| 655 return false; | 655 return false; |
| 656 memory->reset(TransportDIB::Map(handle)); | 656 memory->reset(TransportDIB::Map(handle)); |
| 657 #else | 657 #else |
| 658 static uint32 sequence_number = 0; | 658 static uint32 sequence_number = 0; |
| 659 memory->reset(TransportDIB::Create(size, sequence_number++)); | 659 memory->reset(TransportDIB::Create(size, sequence_number++)); |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1201 | 1201 |
| 1202 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, | 1202 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, |
| 1203 int resource_id) { | 1203 int resource_id) { |
| 1204 if (!plugin_) | 1204 if (!plugin_) |
| 1205 return; | 1205 return; |
| 1206 | 1206 |
| 1207 plugin_->URLRedirectResponse(allow, resource_id); | 1207 plugin_->URLRedirectResponse(allow, resource_id); |
| 1208 } | 1208 } |
| 1209 | 1209 |
| 1210 } // namespace content | 1210 } // namespace content |
| OLD | NEW |