Bug 935273 - Force nocrop property in FilePicker for b2g. r=fabrice

This commit is contained in:
Andrea Marchesini 2013-12-02 22:37:03 -05:00
parent b4e4f41a8a
commit d0a040b7e7

View File

@ -47,6 +47,7 @@ FilePicker.prototype = {
/* members */
mParent: undefined,
mExtraProps: {},
mFilterTypes: [],
mFileEnumerator: undefined,
mFilePickerShownCallback: undefined,
@ -85,6 +86,8 @@ FilePicker.prototype = {
if (filterMask & Ci.nsIFilePicker.filterImages) {
this.mFilterTypes = this.mFilterTypes.concat(IMAGE_FILTERS);
// This property is needed for the gallery app pick activity.
this.mExtraProps['nocrop'] = true;
}
// Ci.nsIFilePicker.filterXML is not supported
@ -117,6 +120,12 @@ FilePicker.prototype = {
detail.type = this.mFilterTypes;
}
for (let prop in this.mExtraProps) {
if (!(prop in detail)) {
detail[prop] = this.mExtraProps[prop];
}
}
cpmm.sendAsyncMessage('file-picker', detail);
},