OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/common/pepper_plugin_registry.h" | 5 #include "content/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/string_split.h" | 10 #include "base/string_split.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 plugin.description = name_parts[2]; | 63 plugin.description = name_parts[2]; |
64 if (name_parts.size() > 3) | 64 if (name_parts.size() > 3) |
65 plugin.version = name_parts[3]; | 65 plugin.version = name_parts[3]; |
66 for (size_t j = 1; j < parts.size(); ++j) { | 66 for (size_t j = 1; j < parts.size(); ++j) { |
67 webkit::WebPluginMimeType mime_type(parts[j], | 67 webkit::WebPluginMimeType mime_type(parts[j], |
68 std::string(), | 68 std::string(), |
69 plugin.description); | 69 plugin.description); |
70 plugin.mime_types.push_back(mime_type); | 70 plugin.mime_types.push_back(mime_type); |
71 } | 71 } |
72 | 72 |
| 73 // If the plugin name is empty, use the filename. |
| 74 if (plugin.name.empty()) |
| 75 plugin.name = UTF16ToUTF8(plugin.path.BaseName().LossyDisplayName()); |
| 76 |
73 // Command-line plugins get full permissions. | 77 // Command-line plugins get full permissions. |
74 plugin.permissions = ppapi::PERMISSION_ALL_BITS; | 78 plugin.permissions = ppapi::PERMISSION_ALL_BITS; |
75 | 79 |
76 plugins->push_back(plugin); | 80 plugins->push_back(plugin); |
77 } | 81 } |
78 } | 82 } |
79 | 83 |
80 } // namespace | 84 } // namespace |
81 | 85 |
82 webkit::WebPluginInfo PepperPluginInfo::ToWebPluginInfo() const { | 86 webkit::WebPluginInfo PepperPluginInfo::ToWebPluginInfo() const { |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 if (!module->InitAsLibrary(current.path)) { | 240 if (!module->InitAsLibrary(current.path)) { |
237 DLOG(ERROR) << "Failed to load pepper module: " << current.path.value(); | 241 DLOG(ERROR) << "Failed to load pepper module: " << current.path.value(); |
238 continue; | 242 continue; |
239 } | 243 } |
240 } | 244 } |
241 preloaded_modules_[current.path] = module; | 245 preloaded_modules_[current.path] = module; |
242 } | 246 } |
243 } | 247 } |
244 | 248 |
245 } // namespace content | 249 } // namespace content |
OLD | NEW |