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

Files app: Generate more JS modules for foreground page

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

In //ui/file_manager/file_manager/foreground/js/ui/:
- search_box.js
- autocomplete_list.js

Bug: 1133186
Change-Id: Ie31eb3bb909b274636bd28400fc6b6add9c94d72
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2626699
Commit-Queue: Jeremie Boulic <jboulic@chromium.org>
Reviewed-by: default avatarLuciano Pacheco <lucmult@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842930}
parent 351a69fb
...@@ -55,6 +55,7 @@ js_type_check("closure_compile_jsmodules") { ...@@ -55,6 +55,7 @@ js_type_check("closure_compile_jsmodules") {
":mock_folder_shortcut_data_model.m", ":mock_folder_shortcut_data_model.m",
":mock_navigation_list_model.m", ":mock_navigation_list_model.m",
":mock_thumbnail_loader.m", ":mock_thumbnail_loader.m",
":naming_controller.m",
":navigation_list_model.m", ":navigation_list_model.m",
":navigation_uma.m", ":navigation_uma.m",
":path_component.m", ":path_component.m",
...@@ -1153,6 +1154,21 @@ js_library("naming_controller") { ...@@ -1153,6 +1154,21 @@ js_library("naming_controller") {
] ]
} }
js_library("naming_controller.m") {
sources = [ "$root_gen_dir/ui/file_manager/file_manager/foreground/js/naming_controller.m.js" ]
deps = [
":directory_contents.m",
":directory_model.m",
":file_selection.m",
"ui:list_container.m",
"//ui/file_manager/file_manager/common/js:util.m",
"//ui/webui/resources/js:assert.m",
"//ui/webui/resources/js/cr/ui:dialogs.m",
]
extra_deps = [ ":modulize" ]
}
js_library("navigation_list_model") { js_library("navigation_list_model") {
deps = [ deps = [
":android_app_list_model", ":android_app_list_model",
...@@ -1509,6 +1525,7 @@ js_modulizer("modulize") { ...@@ -1509,6 +1525,7 @@ js_modulizer("modulize") {
"mock_folder_shortcut_data_model.js", "mock_folder_shortcut_data_model.js",
"mock_navigation_list_model.js", "mock_navigation_list_model.js",
"mock_thumbnail_loader.js", "mock_thumbnail_loader.js",
"naming_controller.js",
"navigation_list_model.js", "navigation_list_model.js",
"navigation_uma.js", "navigation_uma.js",
"path_component.js", "path_component.js",
......
...@@ -2,10 +2,20 @@ ...@@ -2,10 +2,20 @@
// 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 {FileSelectionHandler} from './file_selection.m.js';
// #import {FileFilter} from './directory_contents.m.js';
// #import {DirectoryModel} from './directory_model.m.js';
// #import {AlertDialog, ConfirmDialog} from 'chrome://resources/js/cr/ui/dialogs.m.js';
// #import {ListContainer} from './ui/list_container.m.js';
// #import {util, strf} from '../../common/js/util.m.js';
// #import {assert} from 'chrome://resources/js/assert.m.js';
// clang-format off
/** /**
* Controller to handle naming. * Controller to handle naming.
*/ */
class NamingController { /* #export */ class NamingController {
/** /**
* @param {!ListContainer} listContainer * @param {!ListContainer} listContainer
* @param {!cr.ui.dialogs.AlertDialog} alertDialog * @param {!cr.ui.dialogs.AlertDialog} alertDialog
......
...@@ -26,6 +26,7 @@ js_type_check("closure_compile_jsmodules") { ...@@ -26,6 +26,7 @@ js_type_check("closure_compile_jsmodules") {
":a11y_announce.m", ":a11y_announce.m",
":action_model_ui.m", ":action_model_ui.m",
":actions_submenu.m", ":actions_submenu.m",
":autocomplete_list.m",
":banners.m", ":banners.m",
":breadcrumb.m", ":breadcrumb.m",
":combobutton.m", ":combobutton.m",
...@@ -53,6 +54,7 @@ js_type_check("closure_compile_jsmodules") { ...@@ -53,6 +54,7 @@ js_type_check("closure_compile_jsmodules") {
":multi_menu_button.m", ":multi_menu_button.m",
":progress_center_panel.m", ":progress_center_panel.m",
":providers_menu.m", ":providers_menu.m",
":search_box.m",
":suggest_apps_dialog.m", ":suggest_apps_dialog.m",
"table:table.m", "table:table.m",
"table:table_column.m", "table:table_column.m",
...@@ -999,6 +1001,25 @@ js_library("search_box") { ...@@ -999,6 +1001,25 @@ js_library("search_box") {
externs_list = [ "//ui/file_manager/externs/search_item.js" ] externs_list = [ "//ui/file_manager/externs/search_item.js" ]
} }
js_library("search_box.m") {
sources = [ "$root_gen_dir/ui/file_manager/file_manager/foreground/js/ui/search_box.m.js" ]
deps = [
":autocomplete_list.m",
"//ui/file_manager/file_manager/common/js:file_type.m",
"//ui/file_manager/file_manager/common/js:metrics.m",
"//ui/file_manager/file_manager/common/js:util.m",
"//ui/file_manager/file_manager/foreground/elements:files_toggle_ripple.m",
"//ui/webui/resources/js:assert.m",
"//ui/webui/resources/js:cr.m",
"//ui/webui/resources/js:util.m",
"//ui/webui/resources/js/cr:event_target.m",
"//ui/webui/resources/js/cr/ui:list_item.m",
]
externs_list = [ "//ui/file_manager/externs/search_item.js" ]
extra_deps = [ ":modulize" ]
}
js_library("autocomplete_list") { js_library("autocomplete_list") {
deps = [ deps = [
"//ui/webui/resources/js/cr/ui:list", "//ui/webui/resources/js/cr/ui:list",
...@@ -1007,6 +1028,20 @@ js_library("autocomplete_list") { ...@@ -1007,6 +1028,20 @@ js_library("autocomplete_list") {
] ]
} }
js_library("autocomplete_list.m") {
sources = [ "$root_gen_dir/ui/file_manager/file_manager/foreground/js/ui/autocomplete_list.m.js" ]
deps = [
"//ui/webui/resources/js:cr.m",
"//ui/webui/resources/js/cr/ui:array_data_model.m",
"//ui/webui/resources/js/cr/ui:list.m",
"//ui/webui/resources/js/cr/ui:list_item.m",
"//ui/webui/resources/js/cr/ui:list_single_selection_model.m",
"//ui/webui/resources/js/cr/ui:position_util.m",
]
extra_deps = [ ":modulize" ]
}
js_library("suggest_apps_dialog") { js_library("suggest_apps_dialog") {
deps = [ deps = [
":file_manager_dialog_base", ":file_manager_dialog_base",
...@@ -1072,6 +1107,7 @@ js_modulizer("modulize") { ...@@ -1072,6 +1107,7 @@ js_modulizer("modulize") {
"a11y_announce.js", "a11y_announce.js",
"action_model_ui.js", "action_model_ui.js",
"actions_submenu.js", "actions_submenu.js",
"autocomplete_list.js",
"banners.js", "banners.js",
"breadcrumb.js", "breadcrumb.js",
"combobutton.js", "combobutton.js",
...@@ -1099,6 +1135,7 @@ js_modulizer("modulize") { ...@@ -1099,6 +1135,7 @@ js_modulizer("modulize") {
"multi_menu_button.js", "multi_menu_button.js",
"progress_center_panel.js", "progress_center_panel.js",
"providers_menu.js", "providers_menu.js",
"search_box.js",
"suggest_apps_dialog.js", "suggest_apps_dialog.js",
] ]
...@@ -1108,5 +1145,6 @@ js_modulizer("modulize") { ...@@ -1108,5 +1145,6 @@ js_modulizer("modulize") {
"cr.ui.FilesMenuItem|FilesMenuItem", "cr.ui.FilesMenuItem|FilesMenuItem",
"cr.ui.MultiMenu|MultiMenu", "cr.ui.MultiMenu|MultiMenu",
"cr.ui.table.Table|Table", "cr.ui.table.Table|Table",
"cr.ui.AutocompleteList|AutocompleteList",
] ]
} }
...@@ -2,12 +2,22 @@ ...@@ -2,12 +2,22 @@
// 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 {positionPopupAroundElement, AnchorType} from 'chrome://resources/js/cr/ui/position_util.m.js';
// #import {ArrayDataModel} from 'chrome://resources/js/cr/ui/array_data_model.m.js';
// #import {ListItem} from 'chrome://resources/js/cr/ui/list_item.m.js';
// #import {ListSingleSelectionModel} from 'chrome://resources/js/cr/ui/list_single_selection_model.m.js';
// #import {List} from 'chrome://resources/js/cr/ui/list.m.js';
// #import {dispatchSimpleEvent} from 'chrome://resources/js/cr.m.js';
// clang-format on
cr.define('cr.ui', function() { cr.define('cr.ui', function() {
/** /**
* Creates a new autocomplete list popup. * Creates a new autocomplete list popup.
* @extends {cr.ui.List} * @extends {cr.ui.List}
*/ */
class AutocompleteList extends cr.ui.List { /* #export */ class AutocompleteList extends cr.ui.List {
constructor() { constructor() {
super(); super();
this.__proto__ = AutocompleteList.prototype; this.__proto__ = AutocompleteList.prototype;
...@@ -219,5 +229,6 @@ cr.define('cr.ui', function() { ...@@ -219,5 +229,6 @@ cr.define('cr.ui', function() {
} }
AutocompleteList.prototype.__proto__ = cr.ui.List.prototype; AutocompleteList.prototype.__proto__ = cr.ui.List.prototype;
// #cr_define_end
return {AutocompleteList: AutocompleteList}; return {AutocompleteList: AutocompleteList};
}); });
...@@ -2,10 +2,23 @@ ...@@ -2,10 +2,23 @@
// 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 {FileType} from '../../../common/js/file_type.m.js';
// #import {strf, util} from '../../../common/js/util.m.js';
// #import {ListItem} from 'chrome://resources/js/cr/ui/list_item.m.js';
// #import {queryRequiredElement} from 'chrome://resources/js/util.m.js';
// #import {NativeEventTarget as EventTarget} from 'chrome://resources/js/cr/event_target.m.js';
// #import {metrics} from '../../common/js/metrics.m.js';
// #import {dispatchSimpleEvent} from 'chrome://resources/js/cr.m.js';
// #import {AutocompleteList} from './autocomplete_list.m.js';
// #import {assert} from 'chrome://resources/js/assert.m.js';
// #import '../../elements/files_toggle_ripple.m.js';
// clang-format on
/** /**
* Search box. * Search box.
*/ */
class SearchBox extends cr.EventTarget { /* #export */ class SearchBox extends cr.EventTarget {
/** /**
* @param {!Element} element Root element of the search box. * @param {!Element} element Root element of the search box.
* @param {!Element} searchWrapper Wrapper element around the buttons and box. * @param {!Element} searchWrapper Wrapper element around the buttons and box.
...@@ -79,8 +92,9 @@ class SearchBox extends cr.EventTarget { ...@@ -79,8 +92,9 @@ class SearchBox extends cr.EventTarget {
'click', this.onSearchButtonClick_.bind(this)); 'click', this.onSearchButtonClick_.bind(this));
this.clearButton_.addEventListener( this.clearButton_.addEventListener(
'click', this.onClearButtonClick_.bind(this)); 'click', this.onClearButtonClick_.bind(this));
const dispatchItemSelect = const dispatchItemSelect = () => {
cr.dispatchSimpleEvent.bind(cr, this, SearchBox.EventType.ITEM_SELECT); cr.dispatchSimpleEvent(this, SearchBox.EventType.ITEM_SELECT);
};
this.autocompleteList.handleEnterKeydown = dispatchItemSelect; this.autocompleteList.handleEnterKeydown = dispatchItemSelect;
this.autocompleteList.addEventListener('mousedown', dispatchItemSelect); this.autocompleteList.addEventListener('mousedown', dispatchItemSelect);
...@@ -314,8 +328,7 @@ SearchBox.EventType = { ...@@ -314,8 +328,7 @@ SearchBox.EventType = {
/** /**
* Autocomplete list for search box. * Autocomplete list for search box.
*/ */
SearchBox.AutocompleteList = SearchBox.AutocompleteList = class extends cr.ui.AutocompleteList {
class AutocompleteList extends cr.ui.AutocompleteList {
/** /**
* @param {Document} document Document. * @param {Document} document Document.
*/ */
......
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