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