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