| 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 "webkit/plugins/npapi/plugin_host.h" | 5 #include "webkit/plugins/npapi/plugin_host.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 return NULL; | 51 return NULL; |
| 52 } | 52 } |
| 53 return reinterpret_cast<PluginInstance*>(id->ndata); | 53 return reinterpret_cast<PluginInstance*>(id->ndata); |
| 54 } | 54 } |
| 55 | 55 |
| 56 #if defined(OS_MACOSX) | 56 #if defined(OS_MACOSX) |
| 57 // Returns true if Core Animation plugins are supported. This requires that the | 57 // Returns true if Core Animation plugins are supported. This requires that the |
| 58 // OS supports shared accelerated surfaces via IOSurface. This is true on Snow | 58 // OS supports shared accelerated surfaces via IOSurface. This is true on Snow |
| 59 // Leopard and higher. | 59 // Leopard and higher. |
| 60 static bool SupportsCoreAnimationPlugins() { | 60 static bool SupportsCoreAnimationPlugins() { |
| 61 if (base::mac::IsOSLeopardOrEarlier()) | |
| 62 return false; | |
| 63 if (CommandLine::ForCurrentProcess()->HasSwitch( | 61 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 64 switches::kDisableCoreAnimationPlugins)) | 62 switches::kDisableCoreAnimationPlugins)) |
| 65 return false; | 63 return false; |
| 66 // We also need to be running with desktop GL and not the software | 64 // We also need to be running with desktop GL and not the software |
| 67 // OSMesa renderer in order to share accelerated surfaces between | 65 // OSMesa renderer in order to share accelerated surfaces between |
| 68 // processes. | 66 // processes. |
| 69 gfx::GLImplementation implementation = gfx::GetGLImplementation(); | 67 gfx::GLImplementation implementation = gfx::GetGLImplementation(); |
| 70 if (implementation == gfx::kGLImplementationNone) { | 68 if (implementation == gfx::kGLImplementationNone) { |
| 71 // Not initialized yet. | 69 // Not initialized yet. |
| 72 if (!gfx::GLSurface::InitializeOneOff()) { | 70 if (!gfx::GLSurface::InitializeOneOff()) { |
| (...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1128 } | 1126 } |
| 1129 | 1127 |
| 1130 void NPN_URLRedirectResponse(NPP instance, void* notify_data, NPBool allow) { | 1128 void NPN_URLRedirectResponse(NPP instance, void* notify_data, NPBool allow) { |
| 1131 scoped_refptr<PluginInstance> plugin(FindInstance(instance)); | 1129 scoped_refptr<PluginInstance> plugin(FindInstance(instance)); |
| 1132 if (plugin.get()) { | 1130 if (plugin.get()) { |
| 1133 plugin->URLRedirectResponse(!!allow, notify_data); | 1131 plugin->URLRedirectResponse(!!allow, notify_data); |
| 1134 } | 1132 } |
| 1135 } | 1133 } |
| 1136 | 1134 |
| 1137 } // extern "C" | 1135 } // extern "C" |
| OLD | NEW |