Commit fcf8fdac authored by Jérémie Boulic's avatar Jérémie Boulic Committed by Chromium LUCI CQ

Generate more modules in //u/f/f/f/j/u

In //ui/file_manager/file_manager/foreground/js/ui/:
- drag_selector.js
- file_manager_dialog_base.js
- file_manager_dialog_base_unittest.m.js
- files_confirm_dialog.js
- files_menu.js
- suggest_apps_dialog.js

In //ui/file_manager/file_manager/foreground/js:
- launch_param.js
- providers_model.js
- providers_model_unittest.m.js
- web_store_utils.js

Bug: 1133186
Change-Id: I5bdd717c5643f5a0d0ae8fe3d23ab06623c9b62e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2620744
Commit-Queue: Jeremie Boulic <jboulic@chromium.org>
Commit-Queue: Luciano Pacheco <lucmult@chromium.org>
Reviewed-by: default avatarLuciano Pacheco <lucmult@chromium.org>
Auto-Submit: Jeremie Boulic <jboulic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842425}
parent 84526c51
...@@ -83,7 +83,7 @@ IN_PROC_BROWSER_TEST_F(FileManagerJsTest, FileManagerCommandsTest) { ...@@ -83,7 +83,7 @@ IN_PROC_BROWSER_TEST_F(FileManagerJsTest, FileManagerCommandsTest) {
} }
IN_PROC_BROWSER_TEST_F(FileManagerJsTest, FileManagerDialogBaseTest) { IN_PROC_BROWSER_TEST_F(FileManagerJsTest, FileManagerDialogBaseTest) {
RunTestURL("foreground/js/ui/file_manager_dialog_base_unittest_gen.html"); RunTestURL("foreground/js/ui/file_manager_dialog_base_unittest.m_gen.html");
} }
IN_PROC_BROWSER_TEST_F(FileManagerJsTest, FileOperationHandlerTest) { IN_PROC_BROWSER_TEST_F(FileManagerJsTest, FileOperationHandlerTest) {
...@@ -222,7 +222,7 @@ IN_PROC_BROWSER_TEST_F(FileManagerJsTest, NavigationListModelTest) { ...@@ -222,7 +222,7 @@ IN_PROC_BROWSER_TEST_F(FileManagerJsTest, NavigationListModelTest) {
} }
IN_PROC_BROWSER_TEST_F(FileManagerJsTest, ProvidersModel) { IN_PROC_BROWSER_TEST_F(FileManagerJsTest, ProvidersModel) {
RunTestURL("foreground/js/providers_model_unittest_gen.html"); RunTestURL("foreground/js/providers_model_unittest.m_gen.html");
} }
IN_PROC_BROWSER_TEST_F(FileManagerJsTest, SpinnerController) { IN_PROC_BROWSER_TEST_F(FileManagerJsTest, SpinnerController) {
......
...@@ -1020,7 +1020,10 @@ js_library("volume_info_impl.m") { ...@@ -1020,7 +1020,10 @@ js_library("volume_info_impl.m") {
"//ui/file_manager/file_manager/common/js:util.m", "//ui/file_manager/file_manager/common/js:util.m",
"//ui/webui/resources/js:assert.m", "//ui/webui/resources/js:assert.m",
] ]
visibility += [ "//ui/file_manager/file_manager/foreground/js:navigation_list_model_unittest.m" ] visibility += [
"//ui/file_manager/file_manager/foreground/js:navigation_list_model_unittest.m",
"//ui/file_manager/file_manager/foreground/js:providers_model_unittest.m",
]
extra_deps = [ ":modulize" ] extra_deps = [ ":modulize" ]
} }
......
...@@ -41,11 +41,14 @@ js_type_check("closure_compile_jsmodules") { ...@@ -41,11 +41,14 @@ js_type_check("closure_compile_jsmodules") {
":file_list_model.m", ":file_list_model.m",
":file_watcher.m", ":file_watcher.m",
":folder_shortcuts_data_model.m", ":folder_shortcuts_data_model.m",
":launch_param.m",
":mock_directory_model.m", ":mock_directory_model.m",
":mock_folder_shortcut_data_model.m", ":mock_folder_shortcut_data_model.m",
":mock_navigation_list_model.m", ":mock_navigation_list_model.m",
":navigation_list_model.m", ":navigation_list_model.m",
":providers_model.m",
":thumbnail_loader.m", ":thumbnail_loader.m",
":web_store_utils.m",
] ]
} }
...@@ -827,6 +830,16 @@ js_library("launch_param") { ...@@ -827,6 +830,16 @@ js_library("launch_param") {
] ]
} }
js_library("launch_param.m") {
sources = [ "$root_gen_dir/ui/file_manager/file_manager/foreground/js/launch_param.m.js" ]
deps = [
":dialog_type.m",
"//ui/file_manager/base/js:volume_manager_types.m",
]
extra_deps = [ ":modulize" ]
}
js_library("list_thumbnail_loader") { js_library("list_thumbnail_loader") {
deps = [ deps = [
":directory_model", ":directory_model",
...@@ -962,13 +975,28 @@ js_library("providers_model") { ...@@ -962,13 +975,28 @@ js_library("providers_model") {
deps = [ "//ui/webui/resources/js:assert" ] deps = [ "//ui/webui/resources/js:assert" ]
} }
js_unittest("providers_model_unittest") { js_library("providers_model.m") {
sources = [ "$root_gen_dir/ui/file_manager/file_manager/foreground/js/providers_model.m.js" ]
deps = [ deps = [
":providers_model", "//ui/file_manager/base/js:volume_manager_types.m",
"//ui/file_manager/base/js:mock_chrome", "//ui/file_manager/externs:volume_manager.m",
"//ui/file_manager/base/js:test_error_reporting", "//ui/webui/resources/js:assert.m",
"//ui/file_manager/file_manager/background/js:mock_volume_manager", ]
"//ui/webui/resources/js:load_time_data",
extra_deps = [ ":modulize" ]
}
js_unittest("providers_model_unittest.m") {
deps = [
":providers_model.m",
"//chrome/test/data/webui:chai_assert",
"//ui/file_manager/base/js:mock_chrome.m",
"//ui/file_manager/base/js:test_error_reporting.m",
"//ui/file_manager/base/js:volume_manager_types.m",
"//ui/file_manager/externs:volume_manager.m",
"//ui/file_manager/file_manager/background/js:mock_volume_manager.m",
"//ui/file_manager/file_manager/background/js:volume_info_impl.m",
"//ui/file_manager/file_manager/common/js:mock_entry.m",
] ]
} }
...@@ -1126,6 +1154,13 @@ js_library("web_store_utils") { ...@@ -1126,6 +1154,13 @@ js_library("web_store_utils") {
deps = [ ":constants" ] deps = [ ":constants" ]
} }
js_library("web_store_utils.m") {
sources = [ "$root_gen_dir/ui/file_manager/file_manager/foreground/js/web_store_utils.m.js" ]
deps = [ ":constants.m" ]
extra_deps = [ ":modulize" ]
}
js_library("webui_command_extender") { js_library("webui_command_extender") {
deps = [ deps = [
"//ui/webui/resources/js:cr", "//ui/webui/resources/js:cr",
...@@ -1138,6 +1173,7 @@ js_test_gen_html("js_test_gen_html_modules") { ...@@ -1138,6 +1173,7 @@ js_test_gen_html("js_test_gen_html_modules") {
":directory_contents_unittest.m", ":directory_contents_unittest.m",
":file_list_model_unittest.m", ":file_list_model_unittest.m",
":navigation_list_model_unittest.m", ":navigation_list_model_unittest.m",
":providers_model_unittest.m",
":thumbnail_loader_unittest.m", ":thumbnail_loader_unittest.m",
] ]
js_module = true js_module = true
...@@ -1160,7 +1196,6 @@ js_test_gen_html("js_test_gen_html") { ...@@ -1160,7 +1196,6 @@ js_test_gen_html("js_test_gen_html") {
":file_type_filters_controller_unittest", ":file_type_filters_controller_unittest",
":import_controller_unittest", ":import_controller_unittest",
":list_thumbnail_loader_unittest", ":list_thumbnail_loader_unittest",
":providers_model_unittest",
":spinner_controller_unittest", ":spinner_controller_unittest",
":task_controller_unittest", ":task_controller_unittest",
] ]
...@@ -1182,11 +1217,14 @@ js_modulizer("modulize") { ...@@ -1182,11 +1217,14 @@ js_modulizer("modulize") {
"file_list_model.js", "file_list_model.js",
"file_watcher.js", "file_watcher.js",
"folder_shortcuts_data_model.js", "folder_shortcuts_data_model.js",
"launch_param.js",
"mock_directory_model.js", "mock_directory_model.js",
"mock_folder_shortcut_data_model.js", "mock_folder_shortcut_data_model.js",
"mock_navigation_list_model.js", "mock_navigation_list_model.js",
"navigation_list_model.js", "navigation_list_model.js",
"providers_model.js",
"thumbnail_loader.js", "thumbnail_loader.js",
"web_store_utils.js",
] ]
namespace_rewrites = cr_namespace_rewrites namespace_rewrites = cr_namespace_rewrites
......
...@@ -2,15 +2,18 @@ ...@@ -2,15 +2,18 @@
// 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 {AllowedPaths} from '../../../base/js/volume_manager_types.m.js';
// #import {DialogType} from './dialog_type.m.js';
/** /**
* @typedef {{ * @typedef {{
* overrideCwsContainerUrlForTest: (string|undefined), * overrideCwsContainerUrlForTest: (string|undefined),
* overrideCwsContainerOriginForTest: (string|undefined) * overrideCwsContainerOriginForTest: (string|undefined)
* }} * }}
*/ */
let SuggestAppDialogState; /* #export */ let SuggestAppDialogState;
class LaunchParam { /* #export */ class LaunchParam {
/** /**
* @param {!Object} unformatted Unformatted option. * @param {!Object} unformatted Unformatted option.
*/ */
......
...@@ -2,6 +2,11 @@ ...@@ -2,6 +2,11 @@
// 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 {VolumeManagerCommon} from '../../../base/js/volume_manager_types.m.js';
// #import {assert} from 'chrome://resources/js/assert.m.js';
// #import {VolumeManager} from '../../../externs/volume_manager.m.js';
// clang-format on
/** /**
* An item in the model. Represents a single providing extension. * An item in the model. Represents a single providing extension.
...@@ -96,7 +101,7 @@ class ProvidersModelItem { ...@@ -96,7 +101,7 @@ class ProvidersModelItem {
* providing extensions as well as performing operations on them, such as * providing extensions as well as performing operations on them, such as
* requesting a new mount point. * requesting a new mount point.
*/ */
class ProvidersModel { /* #export */ class ProvidersModel {
/** /**
* @param {!VolumeManager} volumeManager * @param {!VolumeManager} volumeManager
*/ */
......
...@@ -2,6 +2,18 @@ ...@@ -2,6 +2,18 @@
// 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 {assertEquals} from 'chrome://test/chai_assert.js';
import {installMockChrome, MockCommandLinePrivate} from '../../../base/js/mock_chrome.m.js';
import {reportPromise} from '../../../base/js/test_error_reporting.m.js';
import {VolumeManagerCommon} from '../../../base/js/volume_manager_types.m.js';
import {VolumeManager} from '../../../externs/volume_manager.m.js';
import {MockVolumeManager} from '../../background/js/mock_volume_manager.m.js';
import {VolumeInfoImpl} from '../../background/js/volume_info_impl.m.js';
import {MockDirectoryEntry, MockFileSystem} from '../../common/js/mock_entry.m.js';
import {ProvidersModel} from './providers_model.m.js';
/** /**
* Providing extension which has a mounted file system and doesn't support * Providing extension which has a mounted file system and doesn't support
* multiple mounts. * multiple mounts.
...@@ -103,6 +115,9 @@ const NOT_MOUNTED_DEVICE_PROVIDING_EXTENSION = { ...@@ -103,6 +115,9 @@ const NOT_MOUNTED_DEVICE_PROVIDING_EXTENSION = {
multipleMounts: true, multipleMounts: true,
}; };
/** @type {!VolumeManager} */
let volumeManager;
function addProvidedVolume(volumeManager, providerId, volumeId) { function addProvidedVolume(volumeManager, providerId, volumeId) {
const fileSystem = new MockFileSystem(volumeId, 'filesystem:' + volumeId); const fileSystem = new MockFileSystem(volumeId, 'filesystem:' + volumeId);
fileSystem.entries['/'] = MockDirectoryEntry.create(fileSystem, ''); fileSystem.entries['/'] = MockDirectoryEntry.create(fileSystem, '');
...@@ -129,7 +144,7 @@ function addProvidedVolume(volumeManager, providerId, volumeId) { ...@@ -129,7 +144,7 @@ function addProvidedVolume(volumeManager, providerId, volumeId) {
volumeManager.volumeInfoList.add(volumeInfo); volumeManager.volumeInfoList.add(volumeInfo);
} }
function setUp() { export function setUp() {
window.loadTimeData.getString = id => id; window.loadTimeData.getString = id => id;
// Create and install a mock fileManagerPrivate API for fetching the list of // Create and install a mock fileManagerPrivate API for fetching the list of
...@@ -152,9 +167,8 @@ function setUp() { ...@@ -152,9 +167,8 @@ function setUp() {
installMockChrome(mockChrome); installMockChrome(mockChrome);
new MockCommandLinePrivate(); new MockCommandLinePrivate();
// Create and install a volume manager. // Install mock volume manager.
const volumeManager = new MockVolumeManager(); volumeManager = new MockVolumeManager();
MockVolumeManager.installMockSingleton(volumeManager);
// Add provided test volumes. // Add provided test volumes.
const single = MOUNTED_SINGLE_PROVIDING_EXTENSION.providerId; const single = MOUNTED_SINGLE_PROVIDING_EXTENSION.providerId;
...@@ -163,21 +177,16 @@ function setUp() { ...@@ -163,21 +177,16 @@ function setUp() {
addProvidedVolume(volumeManager, multiple, 'volume-2'); addProvidedVolume(volumeManager, multiple, 'volume-2');
} }
function testGetInstalledProviders(callback) { export function testGetInstalledProviders(callback) {
reportPromise(
volumeManagerFactory.getInstance()
.then(volumeManager => {
const model = new ProvidersModel(volumeManager); const model = new ProvidersModel(volumeManager);
return model.getInstalledProviders(); reportPromise(
}) model.getInstalledProviders().then(providers => {
.then(providers => {
assertEquals(5, providers.length); assertEquals(5, providers.length);
assertEquals( assertEquals(
MOUNTED_SINGLE_PROVIDING_EXTENSION.providerId, MOUNTED_SINGLE_PROVIDING_EXTENSION.providerId,
providers[0].providerId); providers[0].providerId);
assertEquals( assertEquals(
MOUNTED_SINGLE_PROVIDING_EXTENSION.iconSet, MOUNTED_SINGLE_PROVIDING_EXTENSION.iconSet, providers[0].iconSet);
providers[0].iconSet);
assertEquals( assertEquals(
MOUNTED_SINGLE_PROVIDING_EXTENSION.name, providers[0].name); MOUNTED_SINGLE_PROVIDING_EXTENSION.name, providers[0].name);
assertEquals( assertEquals(
...@@ -209,11 +218,9 @@ function testGetInstalledProviders(callback) { ...@@ -209,11 +218,9 @@ function testGetInstalledProviders(callback) {
NOT_MOUNTED_SINGLE_PROVIDING_EXTENSION.iconSet, NOT_MOUNTED_SINGLE_PROVIDING_EXTENSION.iconSet,
providers[1].iconSet); providers[1].iconSet);
assertEquals( assertEquals(
MOUNTED_MULTIPLE_PROVIDING_EXTENSION.iconSet, MOUNTED_MULTIPLE_PROVIDING_EXTENSION.iconSet, providers[2].iconSet);
providers[2].iconSet);
assertEquals( assertEquals(
NOT_MOUNTED_FILE_PROVIDING_EXTENSION.iconSet, NOT_MOUNTED_FILE_PROVIDING_EXTENSION.iconSet, providers[3].iconSet);
providers[3].iconSet);
assertEquals( assertEquals(
NOT_MOUNTED_DEVICE_PROVIDING_EXTENSION.iconSet, NOT_MOUNTED_DEVICE_PROVIDING_EXTENSION.iconSet,
providers[4].iconSet); providers[4].iconSet);
...@@ -221,14 +228,10 @@ function testGetInstalledProviders(callback) { ...@@ -221,14 +228,10 @@ function testGetInstalledProviders(callback) {
callback); callback);
} }
function testGetMountableProviders(callback) { export function testGetMountableProviders(callback) {
reportPromise(
volumeManagerFactory.getInstance()
.then(volumeManager => {
const model = new ProvidersModel(volumeManager); const model = new ProvidersModel(volumeManager);
return model.getMountableProviders(); reportPromise(
}) model.getMountableProviders().then(providers => {
.then(providers => {
assertEquals(2, providers.length); assertEquals(2, providers.length);
assertEquals( assertEquals(
NOT_MOUNTED_SINGLE_PROVIDING_EXTENSION.providerId, NOT_MOUNTED_SINGLE_PROVIDING_EXTENSION.providerId,
......
...@@ -25,11 +25,16 @@ js_type_check("closure_compile_jsmodules") { ...@@ -25,11 +25,16 @@ js_type_check("closure_compile_jsmodules") {
uses_js_modules = true uses_js_modules = true
deps = [ deps = [
":directory_tree.m", ":directory_tree.m",
":drag_selector.m",
":empty_folder.m", ":empty_folder.m",
":file_list_selection_model.m", ":file_list_selection_model.m",
":file_manager_dialog_base.m",
":files_alert_dialog.m", ":files_alert_dialog.m",
":files_confirm_dialog.m",
":files_menu.m",
":multi_menu.m", ":multi_menu.m",
":multi_menu_button.m", ":multi_menu_button.m",
":suggest_apps_dialog.m",
"table:table.m", "table:table.m",
"table:table_column.m", "table:table_column.m",
"table:table_column_model.m", "table:table_column_model.m",
...@@ -266,6 +271,14 @@ js_library("drag_selector") { ...@@ -266,6 +271,14 @@ js_library("drag_selector") {
externs_list = [ "//ui/file_manager/externs/drag_target.js" ] externs_list = [ "//ui/file_manager/externs/drag_target.js" ]
} }
js_library("drag_selector.m") {
sources = [ "$root_gen_dir/ui/file_manager/file_manager/foreground/js/ui/drag_selector.m.js" ]
deps = [ "//ui/webui/resources/js/cr/ui:list.m" ]
externs_list = [ "//ui/file_manager/externs/drag_target.js" ]
extra_deps = [ ":modulize" ]
}
js_library("empty_folder") { js_library("empty_folder") {
deps = [ "//ui/webui/resources/js:util" ] deps = [ "//ui/webui/resources/js:util" ]
} }
...@@ -326,11 +339,22 @@ js_library("file_manager_dialog_base") { ...@@ -326,11 +339,22 @@ js_library("file_manager_dialog_base") {
externs_list = [ "$externs_path/chrome_extensions.js" ] externs_list = [ "$externs_path/chrome_extensions.js" ]
} }
js_unittest("file_manager_dialog_base_unittest") { js_library("file_manager_dialog_base.m") {
sources = [ "$root_gen_dir/ui/file_manager/file_manager/foreground/js/ui/file_manager_dialog_base.m.js" ]
deps = [ deps = [
":file_manager_dialog_base", "//ui/file_manager/file_manager/common/js:util.m",
"//ui/file_manager/base/js:test_error_reporting", "//ui/webui/resources/js/cr/ui:dialogs.m",
"//ui/webui/resources/js:webui_resource_test", ]
extra_deps = [ ":modulize" ]
}
js_unittest("file_manager_dialog_base_unittest.m") {
deps = [
":file_manager_dialog_base.m",
"//chrome/test/data/webui:chai_assert",
"//ui/file_manager/base/js:test_error_reporting.m",
"//ui/webui/resources/js:assert.m",
] ]
} }
...@@ -467,6 +491,16 @@ js_library("files_confirm_dialog") { ...@@ -467,6 +491,16 @@ js_library("files_confirm_dialog") {
deps = [ "//ui/webui/resources/js/cr/ui:dialogs" ] deps = [ "//ui/webui/resources/js/cr/ui:dialogs" ]
} }
js_library("files_confirm_dialog.m") {
sources = [ "$root_gen_dir/ui/file_manager/file_manager/foreground/js/ui/files_confirm_dialog.m.js" ]
deps = [
"//ui/file_manager/file_manager/common/js:util.m",
"//ui/webui/resources/js/cr/ui:dialogs.m",
]
extra_deps = [ ":modulize" ]
}
js_library("files_menu") { js_library("files_menu") {
deps = [ deps = [
"//ui/webui/resources/js:assert", "//ui/webui/resources/js:assert",
...@@ -476,6 +510,18 @@ js_library("files_menu") { ...@@ -476,6 +510,18 @@ js_library("files_menu") {
externs_list = [ "//ui/file_manager/externs/paper_elements.js" ] externs_list = [ "//ui/file_manager/externs/paper_elements.js" ]
} }
js_library("files_menu.m") {
sources = [ "$root_gen_dir/ui/file_manager/file_manager/foreground/js/ui/files_menu.m.js" ]
deps = [
"//ui/webui/resources/js:assert.m",
"//ui/webui/resources/js/cr/ui:menu.m",
"//ui/webui/resources/js/cr/ui:menu_item.m",
]
externs_list = [ "//ui/file_manager/externs/paper_elements.js" ]
extra_deps = [ ":modulize" ]
}
js_library("gear_menu") { js_library("gear_menu") {
deps = [ "//ui/file_manager/file_manager/common/js:util" ] deps = [ "//ui/file_manager/file_manager/common/js:util" ]
} }
...@@ -650,10 +696,30 @@ js_library("suggest_apps_dialog") { ...@@ -650,10 +696,30 @@ js_library("suggest_apps_dialog") {
[ "//ui/file_manager/externs/chrome_webstore_widget_private.js" ] [ "//ui/file_manager/externs/chrome_webstore_widget_private.js" ]
} }
js_library("suggest_apps_dialog.m") {
sources = [ "$root_gen_dir/ui/file_manager/file_manager/foreground/js/ui/suggest_apps_dialog.m.js" ]
deps = [
":file_manager_dialog_base.m",
"//ui/file_manager/file_manager/common/js:metrics.m",
"//ui/file_manager/file_manager/common/js:util.m",
"//ui/file_manager/file_manager/cws_widget:cws_widget_container.m",
"//ui/file_manager/file_manager/cws_widget:cws_widget_container_platform_delegate.m",
"//ui/file_manager/file_manager/foreground/js:launch_param.m",
"//ui/file_manager/file_manager/foreground/js:providers_model.m",
"//ui/file_manager/file_manager/foreground/js:web_store_utils.m",
"//ui/webui/resources/js:assert.m",
]
externs_list =
[ "//ui/file_manager/externs/chrome_webstore_widget_private.js" ]
extra_deps = [ ":modulize" ]
}
js_test_gen_html("js_test_gen_html_modules") { js_test_gen_html("js_test_gen_html_modules") {
deps = [ deps = [
":directory_tree_unittest.m", ":directory_tree_unittest.m",
":file_list_selection_model_unittest.m", ":file_list_selection_model_unittest.m",
":file_manager_dialog_base_unittest.m",
":multi_menu_unittest.m", ":multi_menu_unittest.m",
] ]
js_module = true js_module = true
...@@ -672,7 +738,6 @@ js_test_gen_html("js_test_gen_html") { ...@@ -672,7 +738,6 @@ js_test_gen_html("js_test_gen_html") {
deps = [ deps = [
":actions_submenu_unittest", ":actions_submenu_unittest",
":breadcrumb_unittest", ":breadcrumb_unittest",
":file_manager_dialog_base_unittest",
":file_table_list_unittest", ":file_table_list_unittest",
":file_table_unittest", ":file_table_unittest",
":file_tap_handler_unittest", ":file_tap_handler_unittest",
...@@ -683,13 +748,21 @@ js_test_gen_html("js_test_gen_html") { ...@@ -683,13 +748,21 @@ js_test_gen_html("js_test_gen_html") {
js_modulizer("modulize") { js_modulizer("modulize") {
input_files = [ input_files = [
"directory_tree.js", "directory_tree.js",
"drag_selector.js",
"empty_folder.js", "empty_folder.js",
"file_list_selection_model.js", "file_list_selection_model.js",
"file_manager_dialog_base.js",
"files_alert_dialog.js", "files_alert_dialog.js",
"files_confirm_dialog.js",
"files_menu.js",
"multi_menu.js", "multi_menu.js",
"multi_menu_button.js", "multi_menu_button.js",
"suggest_apps_dialog.js",
] ]
namespace_rewrites = cr_namespace_rewrites namespace_rewrites = cr_namespace_rewrites
namespace_rewrites += [ "cr.ui.MultiMenu|MultiMenu" ] namespace_rewrites += [
"cr.ui.MultiMenu|MultiMenu",
"cr.ui.FilesMenuItem|FilesMenuItem",
]
} }
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
// 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.
class DragSelector { // #import {List} from 'chrome://resources/js/cr/ui/list.m.js';
/* #export */ class DragSelector {
/** /**
* Drag selector used on the file list or the grid table. * Drag selector used on the file list or the grid table.
*/ */
......
...@@ -2,10 +2,13 @@ ...@@ -2,10 +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 {util} from '../../../common/js/util.m.js';
// #import {BaseDialog} from 'chrome://resources/js/cr/ui/dialogs.m.js';
/** /**
* This class is an extended class, to manage the status of the dialogs. * This class is an extended class, to manage the status of the dialogs.
*/ */
class FileManagerDialogBase extends cr.ui.dialogs.BaseDialog { /* #export */ class FileManagerDialogBase extends cr.ui.dialogs.BaseDialog {
/** /**
* @param {HTMLElement} parentNode Parent node of the dialog. * @param {HTMLElement} parentNode Parent node of the dialog.
*/ */
......
...@@ -2,7 +2,12 @@ ...@@ -2,7 +2,12 @@
// 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.
function setUp() { import {assertInstanceof} from 'chrome://resources/js/assert.m.js';
import {assertFalse} from 'chrome://test/chai_assert.js';
import {waitUntil} from '../../../../base/js/test_error_reporting.m.js';
import {FileManagerDialogBase} from './file_manager_dialog_base.m.js';
export function setUp() {
// Polyfill chrome.app.window.current(). // Polyfill chrome.app.window.current().
/** @suppress {duplicate,checkTypes,const} */ /** @suppress {duplicate,checkTypes,const} */
chrome.app = {window: {current: () => null}}; chrome.app = {window: {current: () => null}};
...@@ -12,7 +17,7 @@ function setUp() { ...@@ -12,7 +17,7 @@ function setUp() {
}; };
} }
async function testShowDialogAfterHide(done) { export async function testShowDialogAfterHide(done) {
const container = const container =
assertInstanceof(document.createElement('div'), HTMLElement); assertInstanceof(document.createElement('div'), HTMLElement);
......
...@@ -2,10 +2,13 @@ ...@@ -2,10 +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 {util} from '../../../common/js/util.m.js';
// #import {ConfirmDialog} from 'chrome://resources/js/cr/ui/dialogs.m.js';
/** /**
* Confirm dialog. * Confirm dialog.
*/ */
class FilesConfirmDialog extends cr.ui.dialogs.ConfirmDialog { /* #export */ class FilesConfirmDialog extends cr.ui.dialogs.ConfirmDialog {
/** /**
* @param {!Element} parentElement * @param {!Element} parentElement
*/ */
......
...@@ -2,11 +2,15 @@ ...@@ -2,11 +2,15 @@
// 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 {Menu} from 'chrome://resources/js/cr/ui/menu.m.js';
// #import {assertInstanceof} from 'chrome://resources/js/assert.m.js';
// #import {MenuItem} from 'chrome://resources/js/cr/ui/menu_item.m.js';
cr.define('cr.ui', () => { cr.define('cr.ui', () => {
/** /**
* Menu item with ripple animation. * Menu item with ripple animation.
*/ */
class FilesMenuItem extends cr.ui.MenuItem { /* #export */ class FilesMenuItem extends cr.ui.MenuItem {
constructor() { constructor() {
super(); super();
...@@ -204,6 +208,7 @@ cr.define('cr.ui', () => { ...@@ -204,6 +208,7 @@ cr.define('cr.ui', () => {
} }
} }
// #cr_define_end
return { return {
FilesMenuItem: FilesMenuItem, FilesMenuItem: FilesMenuItem,
}; };
......
...@@ -3,16 +3,28 @@ ...@@ -3,16 +3,28 @@
// found in the LICENSE file. // found in the LICENSE file.
/** /**
* SuggestAppsDialog contains a list box to select an app to be opened the file * @fileoverview SuggestAppsDialog contains a list box to select an app to be
* with. This dialog should be used as action picker for file operations. * opened the file with. This dialog should be used as action picker for file
* operations.
*/ */
// clang-format off
// #import {SuggestAppDialogState} from '../launch_param.m.js';
// #import {ProvidersModel} from '../providers_model.m.js';
// #import {CWSWidgetContainerPlatformDelegate} from '../../../cws_widget/cws_widget_container_platform_delegate.m.js';
// #import {FileManagerDialogBase} from './file_manager_dialog_base.m.js';
// #import {CWSWidgetContainer} from '../../../cws_widget/cws_widget_container.m.js';
// #import {webStoreUtils} from '../web_store_utils.m.js';
// #import {str, util} from '../../../common/js/util.m.js';
// #import {metrics} from '../../common/js/metrics.m.js';
// #import {assert} from 'chrome://resources/js/assert.m.js';
// clang-format on
/** /**
* Creates dialog in DOM tree. * Creates dialog in DOM tree.
* *
*/ */
class SuggestAppsDialog extends FileManagerDialogBase { /* #export */ class SuggestAppsDialog extends FileManagerDialogBase {
/** /**
* @param {!ProvidersModel} providersModel Model for providers. * @param {!ProvidersModel} providersModel Model for providers.
* @param {!HTMLElement} parentNode Node to be parent for this dialog. * @param {!HTMLElement} parentNode Node to be parent for this dialog.
......
...@@ -2,6 +2,13 @@ ...@@ -2,6 +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.
/**
* @fileoverview
* @suppress {uselessCode} Temporary suppress because of the line exporting.
*/
// #import {constants} from './constants.m.js';
/** /**
* Namespace for web store utility functions. * Namespace for web store utility functions.
* @namespace * @namespace
...@@ -53,3 +60,6 @@ webStoreUtils.createWebStoreLink = (extension, mimeType) => { ...@@ -53,3 +60,6 @@ webStoreUtils.createWebStoreLink = (extension, mimeType) => {
} }
return url; return url;
}; };
// eslint-disable-next-line semi,no-extra-semi
/* #export */ {webStoreUtils};
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