| 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 (NSString*)CFBundleGetValueForInfoDictionaryKey(bundle, | 212 (NSString*)CFBundleGetValueForInfoDictionaryKey(bundle, |
| 213 CFSTR("CFBundleShortVersionString")); | 213 CFSTR("CFBundleShortVersionString")); |
| 214 | 214 |
| 215 if (have_plugin_descs && plugin_descs.size() > 1) | 215 if (have_plugin_descs && plugin_descs.size() > 1) |
| 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.empty()) |
| 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 = WebPluginInfo::USER_ENABLED; | 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 |
| (...skipping 108 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 |