OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/pepper_plugin_registry.h" | 5 #include "chrome/common/pepper_plugin_registry.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/native_library.h" | 9 #include "base/native_library.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 #if defined(OS_WIN) | 109 #if defined(OS_WIN) |
110 // This means we can't provide plugins from non-ASCII paths, but | 110 // This means we can't provide plugins from non-ASCII paths, but |
111 // since this switch is only for development I don't think that's | 111 // since this switch is only for development I don't think that's |
112 // too awful. | 112 // too awful. |
113 plugin.path = FilePath(ASCIIToUTF16(name_parts[0])); | 113 plugin.path = FilePath(ASCIIToUTF16(name_parts[0])); |
114 #else | 114 #else |
115 plugin.path = FilePath(name_parts[0]); | 115 plugin.path = FilePath(name_parts[0]); |
116 #endif | 116 #endif |
117 if (name_parts.size() > 1) | 117 if (name_parts.size() > 1) |
118 plugin.name = name_parts[1]; | 118 plugin.name = name_parts[1]; |
119 if (name_parts.size() > 2) | 119 if (name_parts.size() > 2) { |
| 120 plugin.description = name_parts[2]; |
120 plugin.type_descriptions = name_parts[2]; | 121 plugin.type_descriptions = name_parts[2]; |
| 122 } |
121 for (size_t j = 1; j < parts.size(); ++j) | 123 for (size_t j = 1; j < parts.size(); ++j) |
122 plugin.mime_types.push_back(parts[j]); | 124 plugin.mime_types.push_back(parts[j]); |
123 | 125 |
124 plugins->push_back(plugin); | 126 plugins->push_back(plugin); |
125 } | 127 } |
126 } | 128 } |
127 | 129 |
128 // static | 130 // static |
129 void PepperPluginRegistry::GetExtraPlugins( | 131 void PepperPluginRegistry::GetExtraPlugins( |
130 std::vector<PepperPluginInfo>* plugins) { | 132 std::vector<PepperPluginInfo>* plugins) { |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 // destructor will call the corresponding Remove in the "continue" case. | 302 // destructor will call the corresponding Remove in the "continue" case. |
301 AddLiveModule(path, module); | 303 AddLiveModule(path, module); |
302 if (!module->InitAsLibrary(path)) { | 304 if (!module->InitAsLibrary(path)) { |
303 DLOG(ERROR) << "Failed to load pepper module: " << path.value(); | 305 DLOG(ERROR) << "Failed to load pepper module: " << path.value(); |
304 continue; | 306 continue; |
305 } | 307 } |
306 module->set_name(plugins[i].name); | 308 module->set_name(plugins[i].name); |
307 preloaded_modules_[path] = module; | 309 preloaded_modules_[path] = module; |
308 } | 310 } |
309 } | 311 } |
OLD | NEW |