OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #import <Carbon/Carbon.h> | 5 #import <Carbon/Carbon.h> |
6 | 6 |
7 #include "webkit/plugins/npapi/plugin_lib.h" | 7 #include "webkit/plugins/npapi/plugin_lib.h" |
8 | 8 |
9 #include "base/mac/scoped_cftyperef.h" | 9 #include "base/mac/scoped_cftyperef.h" |
10 #include "base/native_library.h" | 10 #include "base/native_library.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 info->name = base::SysNSStringToUTF16(plugin_name); | 122 info->name = base::SysNSStringToUTF16(plugin_name); |
123 else | 123 else |
124 info->name = UTF8ToUTF16(filename.BaseName().value()); | 124 info->name = UTF8ToUTF16(filename.BaseName().value()); |
125 info->path = filename; | 125 info->path = filename; |
126 if (plugin_vers) | 126 if (plugin_vers) |
127 info->version = base::SysNSStringToUTF16(plugin_vers); | 127 info->version = base::SysNSStringToUTF16(plugin_vers); |
128 if (plugin_desc) | 128 if (plugin_desc) |
129 info->desc = base::SysNSStringToUTF16(plugin_desc); | 129 info->desc = base::SysNSStringToUTF16(plugin_desc); |
130 else | 130 else |
131 info->desc = UTF8ToUTF16(filename.BaseName().value()); | 131 info->desc = UTF8ToUTF16(filename.BaseName().value()); |
132 info->enabled = true; | 132 info->enabled = WebPluginInfo::USER_ENABLED; |
133 | 133 |
134 return true; | 134 return true; |
135 } | 135 } |
136 | 136 |
137 class ScopedBundleResourceFile { | 137 class ScopedBundleResourceFile { |
138 public: | 138 public: |
139 ScopedBundleResourceFile(CFBundleRef bundle) : bundle_(bundle) { | 139 ScopedBundleResourceFile(CFBundleRef bundle) : bundle_(bundle) { |
140 old_ref_num_ = CurResFile(); | 140 old_ref_num_ = CurResFile(); |
141 bundle_ref_num_ = CFBundleOpenBundleResourceMap(bundle); | 141 bundle_ref_num_ = CFBundleOpenBundleResourceMap(bundle); |
142 UseResFile(bundle_ref_num_); | 142 UseResFile(bundle_ref_num_); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 info->name = UTF8ToUTF16(plugin_descs[1]); | 216 info->name = UTF8ToUTF16(plugin_descs[1]); |
217 else | 217 else |
218 info->name = UTF8ToUTF16(filename.BaseName().value()); | 218 info->name = UTF8ToUTF16(filename.BaseName().value()); |
219 info->path = filename; | 219 info->path = filename; |
220 if (plugin_vers) | 220 if (plugin_vers) |
221 info->version = base::SysNSStringToUTF16(plugin_vers); | 221 info->version = base::SysNSStringToUTF16(plugin_vers); |
222 if (have_plugin_descs && plugin_descs.size() > 0) | 222 if (have_plugin_descs && plugin_descs.size() > 0) |
223 info->desc = UTF8ToUTF16(plugin_descs[0]); | 223 info->desc = UTF8ToUTF16(plugin_descs[0]); |
224 else | 224 else |
225 info->desc = UTF8ToUTF16(filename.BaseName().value()); | 225 info->desc = UTF8ToUTF16(filename.BaseName().value()); |
226 info->enabled = true; | 226 info->enabled = WebPluginInfo::USER_ENABLED; |
227 | 227 |
228 return true; | 228 return true; |
229 } | 229 } |
230 | 230 |
231 } // anonymous namespace | 231 } // anonymous namespace |
232 | 232 |
233 bool PluginLib::ReadWebPluginInfo(const FilePath &filename, | 233 bool PluginLib::ReadWebPluginInfo(const FilePath &filename, |
234 WebPluginInfo* info) { | 234 WebPluginInfo* info) { |
235 // There are two ways to get information about plugin capabilities. One is an | 235 // There are two ways to get information about plugin capabilities. One is an |
236 // Info.plist set of keys, documented at | 236 // Info.plist set of keys, documented at |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 if (ReadSTRPluginInfo(filename, bundle.get(), info)) | 341 if (ReadSTRPluginInfo(filename, bundle.get(), info)) |
342 return true; | 342 return true; |
343 | 343 |
344 // ... or not | 344 // ... or not |
345 | 345 |
346 return false; | 346 return false; |
347 } | 347 } |
348 | 348 |
349 } // namespace npapi | 349 } // namespace npapi |
350 } // namespace webkit | 350 } // namespace webkit |
OLD | NEW |