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

Files app: Generate JS modules for foreground page

In //ui/file_manager/file_manager/foreground/js/:
- selection_menu_controller.js
- sort_menu_controller.js
- webui_command_extender.js

In ui/file_manager/file_manager/foreground/js/ui/:
- dialog_footer.js

Bug: 1133186
Change-Id: Ia143482ddc25ab56cbd5bb10f3704b3c2764c5d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2626990
Commit-Queue: Jeremie Boulic <jboulic@chromium.org>
Reviewed-by: default avatarLuciano Pacheco <lucmult@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843030}
parent d9b5ddf0
...@@ -26,7 +26,7 @@ group("closure_compile") { ...@@ -26,7 +26,7 @@ group("closure_compile") {
} }
js_type_check("closure_compile_jsmodules") { js_type_check("closure_compile_jsmodules") {
uses_js_modules = true is_polymer3 = true
deps = [ deps = [
":actions_model.m", ":actions_model.m",
":android_app_list_model.m", ":android_app_list_model.m",
...@@ -61,10 +61,13 @@ js_type_check("closure_compile_jsmodules") { ...@@ -61,10 +61,13 @@ js_type_check("closure_compile_jsmodules") {
":path_component.m", ":path_component.m",
":providers_model.m", ":providers_model.m",
":quick_view_model.m", ":quick_view_model.m",
":selection_menu_controller.m",
":sort_menu_controller.m",
":spinner_controller.m", ":spinner_controller.m",
":task_history.m", ":task_history.m",
":thumbnail_loader.m", ":thumbnail_loader.m",
":web_store_utils.m", ":web_store_utils.m",
":webui_command_extender.m",
] ]
} }
...@@ -1331,6 +1334,19 @@ js_library("selection_menu_controller") { ...@@ -1331,6 +1334,19 @@ js_library("selection_menu_controller") {
] ]
} }
js_library("selection_menu_controller.m") {
sources = [ "$root_gen_dir/ui/file_manager/file_manager/foreground/js/selection_menu_controller.m.js" ]
deps = [
"ui:multi_menu_button.m",
"//ui/file_manager/file_manager/foreground/elements:files_toggle_ripple.m",
"//ui/file_manager/file_manager/foreground/elements:files_tooltip.m",
"//ui/webui/resources/js:util.m",
"//ui/webui/resources/js/cr/ui:menu.m",
]
extra_deps = [ ":modulize" ]
}
js_library("sort_menu_controller") { js_library("sort_menu_controller") {
deps = [ deps = [
":file_list_model", ":file_list_model",
...@@ -1338,6 +1354,18 @@ js_library("sort_menu_controller") { ...@@ -1338,6 +1354,18 @@ js_library("sort_menu_controller") {
] ]
} }
js_library("sort_menu_controller.m") {
sources = [ "$root_gen_dir/ui/file_manager/file_manager/foreground/js/sort_menu_controller.m.js" ]
deps = [
":file_list_model.m",
"ui:multi_menu_button.m",
"//ui/file_manager/file_manager/foreground/elements:files_toggle_ripple.m",
"//ui/webui/resources/js:util.m",
]
extra_deps = [ ":modulize" ]
}
js_library("spinner_controller") { js_library("spinner_controller") {
} }
...@@ -1459,6 +1487,16 @@ js_library("webui_command_extender") { ...@@ -1459,6 +1487,16 @@ js_library("webui_command_extender") {
] ]
} }
js_library("webui_command_extender.m") {
sources = [ "$root_gen_dir/ui/file_manager/file_manager/foreground/js/webui_command_extender.m.js" ]
deps = [
"//ui/webui/resources/js:cr.m",
"//ui/webui/resources/js/cr/ui:command.m",
]
extra_deps = [ ":modulize" ]
}
js_test_gen_html("js_test_gen_html_modules") { js_test_gen_html("js_test_gen_html_modules") {
deps = [ deps = [
":actions_model_unittest.m", ":actions_model_unittest.m",
...@@ -1481,6 +1519,7 @@ js_test_gen_html("js_test_gen_html_modules") { ...@@ -1481,6 +1519,7 @@ js_test_gen_html("js_test_gen_html_modules") {
"jscomp_off=duplicate", "jscomp_off=duplicate",
"browser_resolver_prefix_replacements=\"chrome://test/=./\"", "browser_resolver_prefix_replacements=\"chrome://test/=./\"",
"hide_warnings_for=third_party/", "hide_warnings_for=third_party/",
"hide_warnings_for=third_party/",
] ]
} }
...@@ -1535,8 +1574,13 @@ js_modulizer("modulize") { ...@@ -1535,8 +1574,13 @@ js_modulizer("modulize") {
"task_history.js", "task_history.js",
"thumbnail_loader.js", "thumbnail_loader.js",
"web_store_utils.js", "web_store_utils.js",
"webui_command_extender.js",
"sort_menu_controller.js",
"selection_menu_controller.js",
] ]
namespace_rewrites = namespace_rewrites = cr_namespace_rewrites + [
cr_namespace_rewrites + [ "cr.ui.FilesMenuItem|FilesMenuItem" ] "cr.ui.FilesMenuItem|FilesMenuItem",
"cr.ui.MultiMenu|MultiMenu",
]
} }
...@@ -2,7 +2,13 @@ ...@@ -2,7 +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.
class SelectionMenuController { // #import {Menu} from 'chrome://resources/js/cr/ui/menu.m.js';
// #import {MultiMenuButton} from './ui/multi_menu_button.m.js';
// #import {queryRequiredElement} from 'chrome://resources/js/util.m.js';
// #import {FilesTooltip} from '../elements/files_tooltip.m.js';
// #import '../elements/files_toggle_ripple.m.js';
/* #export */ class SelectionMenuController {
/** /**
* @param {!cr.ui.MultiMenuButton} selectionMenuButton * @param {!cr.ui.MultiMenuButton} selectionMenuButton
* @param {!cr.ui.Menu} menu * @param {!cr.ui.Menu} menu
...@@ -36,7 +42,8 @@ class SelectionMenuController { ...@@ -36,7 +42,8 @@ class SelectionMenuController {
this.menu_.classList.toggle('toolbar-menu', true); this.menu_.classList.toggle('toolbar-menu', true);
this.toggleRipple_.activated = true; this.toggleRipple_.activated = true;
// crbug.com 752035 focus still on button, get rid of the tooltip // crbug.com 752035 focus still on button, get rid of the tooltip
document.querySelector('files-tooltip').hideTooltip(); /** @type {!FilesTooltip} */ (document.querySelector('files-tooltip'))
.hideTooltip();
} }
/** /**
......
...@@ -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.
class SortMenuController { // #import {FileListModel} from './file_list_model.m.js';
// #import {queryRequiredElement} from 'chrome://resources/js/util.m.js';
// #import {MultiMenuButton} from './ui/multi_menu_button.m.js';
// #import '../elements/files_toggle_ripple.m.js';
/* #export */ class SortMenuController {
/** /**
* @param {!cr.ui.MultiMenuButton} sortButton * @param {!cr.ui.MultiMenuButton} sortButton
* @param {!FilesToggleRippleElement} toggleRipple * @param {!FilesToggleRippleElement} toggleRipple
......
...@@ -32,6 +32,7 @@ js_type_check("closure_compile_jsmodules") { ...@@ -32,6 +32,7 @@ js_type_check("closure_compile_jsmodules") {
":combobutton.m", ":combobutton.m",
":commandbutton.m", ":commandbutton.m",
":default_task_dialog.m", ":default_task_dialog.m",
":dialog_footer.m",
":directory_tree.m", ":directory_tree.m",
":drag_selector.m", ":drag_selector.m",
":empty_folder.m", ":empty_folder.m",
...@@ -323,6 +324,20 @@ js_library("dialog_footer") { ...@@ -323,6 +324,20 @@ js_library("dialog_footer") {
] ]
} }
js_library("dialog_footer.m") {
sources = [ "$root_gen_dir/ui/file_manager/file_manager/foreground/js/ui/dialog_footer.m.js" ]
deps = [
"//ui/file_manager/file_manager/common/js:file_type.m",
"//ui/file_manager/file_manager/common/js:util.m",
"//ui/file_manager/file_manager/foreground/js:dialog_type.m",
"//ui/file_manager/file_manager/foreground/js:file_list_model.m",
"//ui/webui/resources/cr_elements/cr_input:cr_input.m",
"//ui/webui/resources/js:util.m",
]
extra_deps = [ ":modulize" ]
}
js_library("directory_tree") { js_library("directory_tree") {
deps = [ deps = [
"//ui/file_manager/base/js:volume_manager_types", "//ui/file_manager/base/js:volume_manager_types",
...@@ -1113,6 +1128,7 @@ js_modulizer("modulize") { ...@@ -1113,6 +1128,7 @@ js_modulizer("modulize") {
"combobutton.js", "combobutton.js",
"commandbutton.js", "commandbutton.js",
"default_task_dialog.js", "default_task_dialog.js",
"dialog_footer.js",
"directory_tree.js", "directory_tree.js",
"drag_selector.js", "drag_selector.js",
"empty_folder.js", "empty_folder.js",
......
...@@ -2,10 +2,17 @@ ...@@ -2,10 +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.
// #import 'chrome://resources/cr_elements/cr_input/cr_input.m.js';
// #import {FileType} from '../../../common/js/file_type.m.js';
// #import {FileListModel} from '../file_list_model.m.js';
// #import {DialogType} from '../dialog_type.m.js';
// #import {queryRequiredElement} from 'chrome://resources/js/util.m.js';
// #import {util, str} from '../../../common/js/util.m.js';
/** /**
* Footer shown when the Files app is opened as a file/folder selecting dialog. * Footer shown when the Files app is opened as a file/folder selecting dialog.
*/ */
class DialogFooter { /* #export */ class DialogFooter {
/** /**
* @param {DialogType} dialogType Dialog type. * @param {DialogType} dialogType Dialog type.
* @param {!Element} container Container of the dialog footer. * @param {!Element} container Container of the dialog footer.
......
...@@ -2,6 +2,9 @@ ...@@ -2,6 +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.
// #import {Command} from 'chrome://resources/js/cr/ui/command.m.js';
// #import {dispatchPropertyChange} from 'chrome://resources/js/cr.m.js';
/** /**
* Sets 'hidden' property of a cr.ui.Command instance and dispatches * Sets 'hidden' property of a cr.ui.Command instance and dispatches
* 'hiddenChange' event manually so that associated cr.ui.MenuItem can handle * 'hiddenChange' event manually so that associated cr.ui.MenuItem can handle
......
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