OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/command_line.h" |
| 6 #include "base/string_util.h" |
| 7 #include "chrome/common/chrome_switches.h" |
| 8 #include "chrome/common/gpu_plugin.h" |
| 9 #include "gpu/gpu_plugin/gpu_plugin.h" |
| 10 #include "webkit/glue/plugins/plugin_list.h" |
| 11 |
| 12 #if defined(ENABLE_GPU) |
| 13 #include "webkit/glue/plugins/plugin_constants_win.h" |
| 14 #endif |
| 15 |
| 16 namespace chrome { |
| 17 |
| 18 void RegisterInternalGPUPlugin() { |
| 19 #if defined(ENABLE_GPU) |
| 20 static const std::wstring kWideMimeType = ASCIIToWide(kGPUPluginMimeType); |
| 21 static const NPAPI::PluginVersionInfo kGPUPluginInfo = { |
| 22 FilePath(FILE_PATH_LITERAL("gpu-plugin")), |
| 23 L"GPU Plug-in", |
| 24 L"GPU Rendering Plug-in", |
| 25 L"1", |
| 26 kWideMimeType.c_str(), |
| 27 L"", |
| 28 L"", |
| 29 { |
| 30 #if !defined(OS_LINUX) |
| 31 gpu_plugin::NP_GetEntryPoints, |
| 32 #endif |
| 33 gpu_plugin::NP_Initialize, |
| 34 gpu_plugin::NP_Shutdown |
| 35 } |
| 36 }; |
| 37 |
| 38 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableGPUPlugin)) |
| 39 NPAPI::PluginList::Singleton()->RegisterInternalPlugin(kGPUPluginInfo); |
| 40 #endif // ENABLE_GPU |
| 41 } |
| 42 |
| 43 } // namespace chrome |
OLD | NEW |