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 "chrome/common/gpu_plugin.h" | |
6 | |
7 #include "base/command_line.h" | |
8 #include "base/string_util.h" | |
9 #include "base/utf_string_conversions.h" | |
10 #include "chrome/common/chrome_switches.h" | |
11 #include "gpu/gpu_plugin/gpu_plugin.h" | |
12 #include "webkit/plugins/npapi/plugin_list.h" | |
13 | |
14 namespace chrome { | |
15 | |
16 void RegisterInternalGPUPlugin() { | |
17 #if defined(ENABLE_GPU) | |
18 const webkit::npapi::PluginEntryPoints entry_points = { | |
19 #if !defined(OS_POSIX) || defined(OS_MACOSX) | |
20 gpu_plugin::NP_GetEntryPoints, | |
21 #endif | |
22 gpu_plugin::NP_Initialize, | |
23 gpu_plugin::NP_Shutdown | |
24 }; | |
25 | |
26 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableGPUPlugin)) | |
27 webkit::npapi::PluginList::Singleton()->RegisterInternalPlugin( | |
28 FilePath(FILE_PATH_LITERAL("gpu-plugin")), | |
29 "GPU Plug-in", | |
30 "GPU Rendering Plug-in", | |
31 "application/vnd.google.chrome.gpu-plugin", | |
32 entry_points); | |
33 #endif // ENABLE_GPU | |
34 } | |
35 | |
36 } // namespace chrome | |
OLD | NEW |