| Index: build/mac/tweak_info_plist.py
|
| diff --git a/build/mac/tweak_info_plist.py b/build/mac/tweak_info_plist.py
|
| index 3e87b107de3f7c2e100e03ca80bf21af2ba66558..4a6c475aa1ca350c0c8faa6be0b9712a99be14f3 100755
|
| --- a/build/mac/tweak_info_plist.py
|
| +++ b/build/mac/tweak_info_plist.py
|
| @@ -132,54 +132,6 @@ def _DoSCMKeys(plist, add_keys):
|
| return True
|
|
|
|
|
| -def _DoPDFKeys(plist, add_keys):
|
| - """Adds PDF support to the document types list. If add_keys is True, it will
|
| - add the type information dictionary. If it is False, it will remove it if
|
| - present."""
|
| -
|
| - PDF_FILE_EXTENSION = 'pdf'
|
| -
|
| - def __AddPDFKeys(sub_plist):
|
| - """Writes the keys into a sub-dictionary of the plist."""
|
| - sub_plist['CFBundleTypeExtensions'] = [PDF_FILE_EXTENSION]
|
| - sub_plist['CFBundleTypeIconFile'] = 'document.icns'
|
| - sub_plist['CFBundleTypeMIMETypes'] = 'application/pdf'
|
| - sub_plist['CFBundleTypeName'] = 'PDF Document'
|
| - sub_plist['CFBundleTypeRole'] = 'Viewer'
|
| -
|
| - DOCUMENT_TYPES_KEY = 'CFBundleDocumentTypes'
|
| -
|
| - # First get the list of document types, creating it if necessary.
|
| - try:
|
| - extensions = plist[DOCUMENT_TYPES_KEY]
|
| - except KeyError:
|
| - # If this plist doesn't have a type dictionary, create one if set to add the
|
| - # keys. If not, bail.
|
| - if not add_keys:
|
| - return
|
| - extensions = plist[DOCUMENT_TYPES_KEY] = []
|
| -
|
| - # Loop over each entry in the list, looking for one that handles PDF types.
|
| - for i, ext in enumerate(extensions):
|
| - # If an entry for .pdf files is found...
|
| - if 'CFBundleTypeExtensions' not in ext:
|
| - continue
|
| - if PDF_FILE_EXTENSION in ext['CFBundleTypeExtensions']:
|
| - if add_keys:
|
| - # Overwrite the existing keys with new ones.
|
| - __AddPDFKeys(ext)
|
| - else:
|
| - # Otherwise, delete the entry entirely.
|
| - del extensions[i]
|
| - return
|
| -
|
| - # No PDF entry exists. If one needs to be added, do so now.
|
| - if add_keys:
|
| - pdf_entry = {}
|
| - __AddPDFKeys(pdf_entry)
|
| - extensions.append(pdf_entry)
|
| -
|
| -
|
| def _AddBreakpadKeys(plist, branding):
|
| """Adds the Breakpad keys. This must be called AFTER _AddVersionKeys() and
|
| also requires the |branding| argument."""
|
| @@ -259,8 +211,6 @@ def Main(argv):
|
| type='int', default=False, help='Enable Keystone [1 or 0]')
|
| parser.add_option('--scm', dest='add_scm_info', action='store', type='int',
|
| default=True, help='Add SCM metadata [1 or 0]')
|
| - parser.add_option('--pdf', dest='add_pdf_support', action='store', type='int',
|
| - default=False, help='Add PDF file handler support [1 or 0]')
|
| parser.add_option('--branding', dest='branding', action='store',
|
| type='string', default=None, help='The branding of the binary')
|
| parser.add_option('--bundle_id', dest='bundle_identifier',
|
| @@ -314,9 +264,6 @@ def Main(argv):
|
| if not _DoSCMKeys(plist, options.add_scm_info):
|
| return 3
|
|
|
| - # Adds or removes the PDF file handler entry.
|
| - _DoPDFKeys(plist, options.add_pdf_support)
|
| -
|
| # Now that all keys have been mutated, rewrite the file.
|
| temp_info_plist = tempfile.NamedTemporaryFile()
|
| plistlib.writePlist(plist, temp_info_plist.name)
|
|
|