Commit 6cadf573 authored by Luciano Pacheco's avatar Luciano Pacheco Committed by Commit Bot

Files app: Generate JS modules for some externs/

This is a preparation for follow up CLs migrating to JS modules which
will use those modules in externs as JS modules instead of using as
externs. This is due to limitations on Closure compiler working with
JS modules and externs.

BUG=chromium:1133186, b/172300267

Change-Id: Ic983ba08b050f161c6b6e2e9b287f19584409982
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2517350
Commit-Queue: Luciano Pacheco <lucmult@chromium.org>
Reviewed-by: default avatarJeremie Boulic <jboulic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#823917}
parent 841de257
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# found in the LICENSE file. # found in the LICENSE file.
import("//third_party/closure_compiler/compile_js.gni") import("//third_party/closure_compiler/compile_js.gni")
import("//ui/webui/resources/tools/js_modulizer.gni")
js_library("file_manager_private") { js_library("file_manager_private") {
sources = [] sources = []
...@@ -17,6 +18,27 @@ js_library("file_manager_private") { ...@@ -17,6 +18,27 @@ js_library("file_manager_private") {
] ]
} }
js_library("entry_location.m") {
sources = [ "$root_gen_dir/ui/file_manager/externs/entry_location.m.js" ]
deps = [
":volume_info.m",
"//ui/file_manager/base/js:volume_manager_types.m",
]
extra_deps = [ ":modulize" ]
}
js_library("files_app_entry_interfaces.m") {
sources = [
"$root_gen_dir/ui/file_manager/externs/files_app_entry_interfaces.m.js",
]
deps = [ "//ui/file_manager/base/js:volume_manager_types.m" ]
extra_deps = [ ":modulize" ]
}
js_library("volume_manager") { js_library("volume_manager") {
sources = [] sources = []
...@@ -30,3 +52,46 @@ js_library("volume_manager") { ...@@ -30,3 +52,46 @@ js_library("volume_manager") {
"volume_manager.js", "volume_manager.js",
] ]
} }
js_library("volume_manager.m") {
sources = [ "$root_gen_dir/ui/file_manager/externs/volume_manager.m.js" ]
deps = [
":entry_location.m",
":files_app_entry_interfaces.m",
":volume_info.m",
":volume_info_list.m",
"//ui/file_manager/base/js:volume_manager_types.m",
]
extra_deps = [ ":modulize" ]
}
js_library("volume_info.m") {
sources = [ "$root_gen_dir/ui/file_manager/externs/volume_info.m.js" ]
deps = [
":files_app_entry_interfaces.m",
"//ui/file_manager/base/js:volume_manager_types.m",
]
extra_deps = [ ":modulize" ]
}
js_library("volume_info_list.m") {
sources = [ "$root_gen_dir/ui/file_manager/externs/volume_info_list.m.js" ]
deps = [ ":volume_info.m" ]
extra_deps = [ ":modulize" ]
}
js_modulizer("modulize") {
input_files = [
"entry_location.js",
"files_app_entry_interfaces.js",
"volume_info.js",
"volume_info_list.js",
"volume_manager.js",
]
}
...@@ -2,12 +2,17 @@ ...@@ -2,12 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// clang-format off
// #import * as wrappedVolumeManagerCommon from '../base/js/volume_manager_types.m.js'; const {VolumeManagerCommon} = wrappedVolumeManagerCommon;
// #import {VolumeInfo} from './volume_info.m.js';
// clang-format on
/** /**
* Location information which shows where the path points in FileManager's * Location information which shows where the path points in FileManager's
* file system. * file system.
* @interface * @interface
*/ */
class EntryLocation { /* #export */ class EntryLocation {
constructor() { constructor() {
/** /**
* Volume information. * Volume information.
......
...@@ -2,12 +2,17 @@ ...@@ -2,12 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// clang-format off
// #import * as wrappedVolumeManagerCommon from '../base/js/volume_manager_types.m.js'; const {VolumeManagerCommon} = wrappedVolumeManagerCommon;
// #import {FilesAppEntry, FakeEntry} from './files_app_entry_interfaces.m.js';
// clang-format on
/** /**
* Represents each volume, such as "drive", "download directory", each "USB * Represents each volume, such as "drive", "download directory", each "USB
* flush storage", or "mounted zip archive" etc. * flush storage", or "mounted zip archive" etc.
* @interface * @interface
*/ */
class VolumeInfo { /* #export */ class VolumeInfo {
constructor() { constructor() {
/** @type {VolumeManagerCommon.VolumeType} */ /** @type {VolumeManagerCommon.VolumeType} */
this.volumeType; this.volumeType;
......
...@@ -2,11 +2,13 @@ ...@@ -2,11 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// #import {VolumeInfo} from './volume_info.m.js';
/** /**
* The container of the VolumeInfo for each mounted volume. * The container of the VolumeInfo for each mounted volume.
* @interface * @interface
*/ */
class VolumeInfoList { /* #export */ class VolumeInfoList {
constructor() { constructor() {
/** @const {number} */ /** @const {number} */
this.length; this.length;
......
...@@ -2,11 +2,19 @@ ...@@ -2,11 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// clang-format off
// #import {EntryLocation} from './entry_location.m.js';
// #import {VolumeInfo} from './volume_info.m.js';
// #import {VolumeInfoList} from './volume_info_list.m.js';
// #import {FilesAppEntry, FilesAppDirEntry} from './files_app_entry_interfaces.m.js';
// #import * as wrappedVolumeManagerCommon from '../base/js/volume_manager_types.m.js'; const {VolumeManagerCommon} = wrappedVolumeManagerCommon;
// clang-format on
/** /**
* VolumeManager is responsible for tracking list of mounted volumes. * VolumeManager is responsible for tracking list of mounted volumes.
* @interface * @interface
*/ */
class VolumeManager { /* #export */ class VolumeManager {
constructor() { constructor() {
/** /**
* The list of VolumeInfo instances for each mounted volume. * The list of VolumeInfo instances for each mounted volume.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment