function getAllFiles(filter, includeWorkingSet, sort) {
        var viewFiles, deferred;

        // The filter and includeWorkingSet params are both optional.
        // Handle the case where filter is omitted but includeWorkingSet is
        // specified.
        if (includeWorkingSet === undefined && typeof (filter) !== "function") {
            includeWorkingSet = filter;
            filter = null;
        }

        if (includeWorkingSet) {
            viewFiles = MainViewManager.getWorkingSet(MainViewManager.ALL_PANES);
        }

        deferred = new $.Deferred();
        model.getAllFiles(filter, viewFiles, sort)
            .done(function (fileList) {
                deferred.resolve(fileList);
            })
            .fail(function (err) {
                if (err === FileSystemError.TOO_MANY_ENTRIES && !_projectWarnedForTooManyFiles) {
                    _showErrorDialog(ERR_TYPE_MAX_FILES);
                    _projectWarnedForTooManyFiles = true;
                }
                // resolve with empty list
                deferred.resolve([]);
            });
        return deferred.promise();
    }
Returns an Array of all files for this project, optionally including
files in the working set that are *not* under the project root. Files are
filtered first by ProjectModel.shouldShow(), then by the custom filter
argument (if one was provided).

@param {function (File, number):boolean=} filter Optional function to filter
         the file list (does not filter directory traversal). API matches Array.filter().
@param {boolean=} includeWorkingSet If true, include files in the working set
         that are not under the project root (*except* for untitled documents).
@param {boolean=} sort If true, The files will be sorted by their paths

@return {$.Promise} Promise that is resolved with an Array of File objects.