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