• Luciano Pacheco's avatar
    Files app: ES6 background importer.* · 35764892
    Luciano Pacheco authored
    Convert to ES6 classes the following files:
    - ui/file_manager/externs/background/media_import_handler.js
    - ui/file_manager/file_manager/background/js/media_import_handler.js
    - ui/file_manager/file_manager/background/js/media_import_handler_unittest.js
    - ui/file_manager/file_manager/background/js/task_queue.js
    - ui/file_manager/file_manager/background/js/task_queue_unittest.js
    - ui/file_manager/externs/background/import_runner.js
    
    Converting these to ES6 revealed a set of entangled dependencies between
    the Background (BG) and Foreground (FG) page implementations. We do not
    want FG and BG implementations depending on each other. For Closure type
    checking, externs can be used to declare their @interface, allowing the
    FG and BG implementations to only depend on their @interface.
    
    Fix BG progress_center.js depending on FG progress_center_panel.js by
    declaring a new extern progress_center_panel.js.
    
    media_import_handler.js extern was a cluster of its externs and its own
    dependencies. This CL splits parts of it into task_queue.js and
    duplicate_finder.js, so their implementations don't have to depend on
    the media_import_handler.js.
    
    Moved importer.TaskQueue.UpdateType enum to /common/ to be shared between
    FG and BG: enums can't be on externs because externs aren't loaded in our
    unittests or production code.
    
    Bug: 778674
    Change-Id: I05cb122df95581d1c966d64cb7388d1591c322fe
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1772792Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
    Commit-Queue: Noel Gordon <noel@chromium.org>
    Auto-Submit: Luciano Pacheco <lucmult@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#692326}
    35764892
media_scanner.js 3.59 KB