| 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/glue/plugins/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" |
| 11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
| 12 #include "base/string_split.h" | 12 #include "base/string_split.h" |
| 13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 14 #include "base/sys_string_conversions.h" | 14 #include "base/sys_string_conversions.h" |
| 15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 16 #include "webkit/glue/plugins/plugin_list.h" | 16 #include "webkit/plugins/npapi/plugin_list.h" |
| 17 | |
| 18 static const short kSTRTypeDefinitionResourceID = 128; | |
| 19 static const short kSTRTypeDescriptionResourceID = 127; | |
| 20 static const short kSTRPluginDescriptionResourceID = 126; | |
| 21 | 17 |
| 22 using base::mac::ScopedCFTypeRef; | 18 using base::mac::ScopedCFTypeRef; |
| 23 | 19 |
| 24 namespace NPAPI { | 20 namespace webkit { |
| 21 namespace npapi { |
| 25 | 22 |
| 26 namespace { | 23 namespace { |
| 27 | 24 |
| 25 const short kSTRTypeDefinitionResourceID = 128; |
| 26 const short kSTRTypeDescriptionResourceID = 127; |
| 27 const short kSTRPluginDescriptionResourceID = 126; |
| 28 |
| 28 NSDictionary* GetMIMETypes(CFBundleRef bundle) { | 29 NSDictionary* GetMIMETypes(CFBundleRef bundle) { |
| 29 NSString* mime_filename = | 30 NSString* mime_filename = |
| 30 (NSString*)CFBundleGetValueForInfoDictionaryKey(bundle, | 31 (NSString*)CFBundleGetValueForInfoDictionaryKey(bundle, |
| 31 CFSTR("WebPluginMIMETypesFilename")); | 32 CFSTR("WebPluginMIMETypesFilename")); |
| 32 | 33 |
| 33 if (mime_filename) { | 34 if (mime_filename) { |
| 34 | 35 |
| 35 // get the file | 36 // get the file |
| 36 | 37 |
| 37 NSString* mime_path = | 38 NSString* mime_path = |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 return true; | 339 return true; |
| 339 | 340 |
| 340 if (ReadSTRPluginInfo(filename, bundle.get(), info)) | 341 if (ReadSTRPluginInfo(filename, bundle.get(), info)) |
| 341 return true; | 342 return true; |
| 342 | 343 |
| 343 // ... or not | 344 // ... or not |
| 344 | 345 |
| 345 return false; | 346 return false; |
| 346 } | 347 } |
| 347 | 348 |
| 348 } // namespace NPAPI | 349 } // namespace npapi |
| 350 } // namespace webkit |
| OLD | NEW |