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 | |
77 // Command-line plugins get full permissions. | 73 // Command-line plugins get full permissions. |
78 plugin.permissions = ppapi::PERMISSION_ALL_BITS; | 74 plugin.permissions = ppapi::PERMISSION_ALL_BITS; |
79 | 75 |
80 plugins->push_back(plugin); | 76 plugins->push_back(plugin); |
81 } | 77 } |
82 } | 78 } |
83 | 79 |
84 } // namespace | 80 } // namespace |
85 | 81 |
86 webkit::WebPluginInfo PepperPluginInfo::ToWebPluginInfo() const { | 82 webkit::WebPluginInfo PepperPluginInfo::ToWebPluginInfo() const { |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 if (!module->InitAsLibrary(current.path)) { | 236 if (!module->InitAsLibrary(current.path)) { |
241 DLOG(ERROR) << "Failed to load pepper module: " << current.path.value(); | 237 DLOG(ERROR) << "Failed to load pepper module: " << current.path.value(); |
242 continue; | 238 continue; |
243 } | 239 } |
244 } | 240 } |
245 preloaded_modules_[current.path] = module; | 241 preloaded_modules_[current.path] = module; |
246 } | 242 } |
247 } | 243 } |
248 | 244 |
249 } // namespace content | 245 } // namespace content |
OLD | NEW |