| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/glue/plugins/plugin_lib.h" | 7 #include "webkit/glue/plugins/plugin_lib.h" |
| 8 | 8 |
| 9 #include "base/native_library.h" | 9 #include "base/native_library.h" |
| 10 #include "base/scoped_cftyperef.h" | 10 #include "base/scoped_cftyperef.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 info->name = base::SysNSStringToWide(plugin_name); | 116 info->name = base::SysNSStringToWide(plugin_name); |
| 117 else | 117 else |
| 118 info->name = UTF8ToWide(filename.BaseName().value()); | 118 info->name = UTF8ToWide(filename.BaseName().value()); |
| 119 info->path = filename; | 119 info->path = filename; |
| 120 if (plugin_vers) | 120 if (plugin_vers) |
| 121 info->version = base::SysNSStringToWide(plugin_vers); | 121 info->version = base::SysNSStringToWide(plugin_vers); |
| 122 if (plugin_desc) | 122 if (plugin_desc) |
| 123 info->desc = base::SysNSStringToWide(plugin_desc); | 123 info->desc = base::SysNSStringToWide(plugin_desc); |
| 124 else | 124 else |
| 125 info->desc = UTF8ToWide(filename.BaseName().value()); | 125 info->desc = UTF8ToWide(filename.BaseName().value()); |
| 126 info->enabled = true; |
| 126 | 127 |
| 127 return true; | 128 return true; |
| 128 } | 129 } |
| 129 | 130 |
| 130 class ScopedBundleResourceFile { | 131 class ScopedBundleResourceFile { |
| 131 public: | 132 public: |
| 132 ScopedBundleResourceFile(CFBundleRef bundle) : bundle_(bundle) { | 133 ScopedBundleResourceFile(CFBundleRef bundle) : bundle_(bundle) { |
| 133 old_ref_num_ = CurResFile(); | 134 old_ref_num_ = CurResFile(); |
| 134 bundle_ref_num_ = CFBundleOpenBundleResourceMap(bundle); | 135 bundle_ref_num_ = CFBundleOpenBundleResourceMap(bundle); |
| 135 UseResFile(bundle_ref_num_); | 136 UseResFile(bundle_ref_num_); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 info->name = UTF8ToWide(plugin_descs[1]); | 214 info->name = UTF8ToWide(plugin_descs[1]); |
| 214 else | 215 else |
| 215 info->name = UTF8ToWide(filename.BaseName().value()); | 216 info->name = UTF8ToWide(filename.BaseName().value()); |
| 216 info->path = filename; | 217 info->path = filename; |
| 217 if (plugin_vers) | 218 if (plugin_vers) |
| 218 info->version = base::SysNSStringToWide(plugin_vers); | 219 info->version = base::SysNSStringToWide(plugin_vers); |
| 219 if (have_plugin_descs && plugin_descs.size() > 0) | 220 if (have_plugin_descs && plugin_descs.size() > 0) |
| 220 info->desc = UTF8ToWide(plugin_descs[0]); | 221 info->desc = UTF8ToWide(plugin_descs[0]); |
| 221 else | 222 else |
| 222 info->desc = UTF8ToWide(filename.BaseName().value()); | 223 info->desc = UTF8ToWide(filename.BaseName().value()); |
| 224 info->enabled = true; |
| 223 | 225 |
| 224 return true; | 226 return true; |
| 225 } | 227 } |
| 226 | 228 |
| 227 } // anonymous namespace | 229 } // anonymous namespace |
| 228 | 230 |
| 229 bool PluginLib::ReadWebPluginInfo(const FilePath &filename, | 231 bool PluginLib::ReadWebPluginInfo(const FilePath &filename, |
| 230 WebPluginInfo* info) { | 232 WebPluginInfo* info) { |
| 231 // There are two ways to get information about plugin capabilities. One is an | 233 // There are two ways to get information about plugin capabilities. One is an |
| 232 // Info.plist set of keys, documented at | 234 // Info.plist set of keys, documented at |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 | 338 |
| 337 if (ReadSTRPluginInfo(filename, bundle.get(), info)) | 339 if (ReadSTRPluginInfo(filename, bundle.get(), info)) |
| 338 return true; | 340 return true; |
| 339 | 341 |
| 340 // ... or not | 342 // ... or not |
| 341 | 343 |
| 342 return false; | 344 return false; |
| 343 } | 345 } |
| 344 | 346 |
| 345 } // namespace NPAPI | 347 } // namespace NPAPI |
| OLD | NEW |