Commit 06c54669 authored by Juliet Levesque's avatar Juliet Levesque Committed by Chromium LUCI CQ

[OS Settings] Migrate crostini page browser proxy to Polymer3.

Migrates the crostini_browser_proxy component under the crostini_page
to Polymer3.

Change-Id: Ic4f7ca3ccbacea64e84cf02a29460dabef774efc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2640757Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Juliet Levesque <julietlevesque@google.com>
Cr-Commit-Position: refs/heads/master@{#846375}
parent 34121d5e
...@@ -304,6 +304,7 @@ preprocess_if_expr("preprocess_gen_v3") { ...@@ -304,6 +304,7 @@ preprocess_if_expr("preprocess_gen_v3") {
"chromeos/bluetooth_page/bluetooth_device_list_item.m.js", "chromeos/bluetooth_page/bluetooth_device_list_item.m.js",
"chromeos/bluetooth_page/bluetooth_page.m.js", "chromeos/bluetooth_page/bluetooth_page.m.js",
"chromeos/bluetooth_page/bluetooth_subpage.m.js", "chromeos/bluetooth_page/bluetooth_subpage.m.js",
"chromeos/crostini_page/crostini_browser_proxy.m.js",
"chromeos/date_time_page/date_time_page.m.js", "chromeos/date_time_page/date_time_page.m.js",
"chromeos/date_time_page/date_time_types.m.js", "chromeos/date_time_page/date_time_types.m.js",
"chromeos/date_time_page/timezone_browser_proxy.m.js", "chromeos/date_time_page/timezone_browser_proxy.m.js",
...@@ -1136,8 +1137,7 @@ group("closure_compile_module") { ...@@ -1136,8 +1137,7 @@ group("closure_compile_module") {
#":closure_compile_local_module", #":closure_compile_local_module",
"ambient_mode_page:closure_compile_module", "ambient_mode_page:closure_compile_module",
"bluetooth_page:closure_compile_module", "bluetooth_page:closure_compile_module",
"crostini_page:closure_compile_module",
#"crostini_page:closure_compile_module",
"date_time_page:closure_compile_module", "date_time_page:closure_compile_module",
"guest_os:closure_compile_module", "guest_os:closure_compile_module",
......
...@@ -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("../os_settings.gni")
js_type_check("closure_compile") { js_type_check("closure_compile") {
deps = [ deps = [
...@@ -108,24 +109,25 @@ js_library("crostini_subpage") { ...@@ -108,24 +109,25 @@ js_library("crostini_subpage") {
} }
# TODO: Uncomment as the Polymer3 migration makes progress. # TODO: Uncomment as the Polymer3 migration makes progress.
#js_type_check("closure_compile_module") { js_type_check("closure_compile_module") {
# is_polymer3 = true is_polymer3 = true
# deps = [ deps = [
# ":crostini_arc_adb.m", # ":crostini_arc_adb.m",
# ":crostini_arc_adb_confirmation_dialog.m", # ":crostini_arc_adb_confirmation_dialog.m",
# ":crostini_browser_proxy.m", ":crostini_browser_proxy.m",
# ":crostini_disk_resize_dialog.m", # ":crostini_disk_resize_dialog.m",
# ":crostini_disk_resize_confirmation_dialog.m", # ":crostini_disk_resize_confirmation_dialog.m",
# ":crostini_export_import.m", # ":crostini_export_import.m",
# ":crostini_import_confirmation_dialog.m", # ":crostini_import_confirmation_dialog.m",
# ":crostini_mic_sharing_dialog.m", # ":crostini_mic_sharing_dialog.m",
# ":crostini_page.m", # ":crostini_page.m",
# ":crostini_port_forwarding.m", # ":crostini_port_forwarding.m",
# ":crostini_port_forwarding_add_port_dialog.m", # ":crostini_port_forwarding_add_port_dialog.m",
# ":crostini_shared_paths.m", # ":crostini_shared_paths.m",
# ":crostini_subpage.m" # ":crostini_shared_usb_devices.m",
# ] # ":crostini_subpage.m"
#} ]
}
js_library("crostini_arc_adb.m") { js_library("crostini_arc_adb.m") {
sources = [ "$root_gen_dir/chrome/browser/resources/settings/chromeos/crostini_page/crostini_arc_adb.m.js" ] sources = [ "$root_gen_dir/chrome/browser/resources/settings/chromeos/crostini_page/crostini_arc_adb.m.js" ]
...@@ -146,7 +148,7 @@ js_library("crostini_arc_adb_confirmation_dialog.m") { ...@@ -146,7 +148,7 @@ js_library("crostini_arc_adb_confirmation_dialog.m") {
js_library("crostini_browser_proxy.m") { js_library("crostini_browser_proxy.m") {
sources = [ "$root_gen_dir/chrome/browser/resources/settings/chromeos/crostini_page/crostini_browser_proxy.m.js" ] sources = [ "$root_gen_dir/chrome/browser/resources/settings/chromeos/crostini_page/crostini_browser_proxy.m.js" ]
deps = [ deps = [
# TODO: Fill those in. "//ui/webui/resources/js:cr.m",
] ]
extra_deps = [ ":modulize" ] extra_deps = [ ":modulize" ]
} }
...@@ -326,4 +328,5 @@ import("//ui/webui/resources/tools/js_modulizer.gni") ...@@ -326,4 +328,5 @@ import("//ui/webui/resources/tools/js_modulizer.gni")
js_modulizer("modulize") { js_modulizer("modulize") {
input_files = [ "crostini_browser_proxy.js" ] input_files = [ "crostini_browser_proxy.js" ]
namespace_rewrites = os_settings_namespace_rewrites
} }
...@@ -2,11 +2,12 @@ ...@@ -2,11 +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.
// #import {addSingletonGetter, sendWithPromise} from 'chrome://resources/js/cr.m.js';
// Identifiers for the default Crostini VM and container. // Identifiers for the default Crostini VM and container.
/** @type {string} */ const DEFAULT_CROSTINI_VM = 'termina'; /** @type {string} */ /* #export */ const DEFAULT_CROSTINI_VM = 'termina';
/** @type {string} */ const DEFAULT_CROSTINI_CONTAINER = 'penguin'; /** @type {string} */ /* #export */ const DEFAULT_CROSTINI_CONTAINER =
'penguin';
/** /**
...@@ -14,7 +15,7 @@ ...@@ -14,7 +15,7 @@
* (chrome/browser/chromeos/crostini/crostini_port_forwarder.h). * (chrome/browser/chromeos/crostini/crostini_port_forwarder.h).
* @enum {number} * @enum {number}
*/ */
const CrostiniPortProtocol = { /* #export */ const CrostiniPortProtocol = {
TCP: 0, TCP: 0,
UDP: 1, UDP: 1,
}; };
...@@ -23,7 +24,7 @@ const CrostiniPortProtocol = { ...@@ -23,7 +24,7 @@ const CrostiniPortProtocol = {
* @typedef {{path: string, * @typedef {{path: string,
* pathDisplayText: string}} * pathDisplayText: string}}
*/ */
let CrostiniSharedPath; /* #export */ let CrostiniSharedPath;
/** /**
* @typedef {{label: string, * @typedef {{label: string,
...@@ -31,14 +32,14 @@ let CrostiniSharedPath; ...@@ -31,14 +32,14 @@ let CrostiniSharedPath;
* shared: boolean, * shared: boolean,
* shareWillReassign: boolean}} * shareWillReassign: boolean}}
*/ */
let CrostiniSharedUsbDevice; /* #export */ let CrostiniSharedUsbDevice;
/** /**
* @typedef {{label: string, * @typedef {{label: string,
* port_number: number, * port_number: number,
* protocol_type: !CrostiniPortProtocol}} * protocol_type: !CrostiniPortProtocol}}
*/ */
let CrostiniPortSetting; /* #export */ let CrostiniPortSetting;
/** /**
* @typedef {{succeeded: boolean, * @typedef {{succeeded: boolean,
...@@ -48,21 +49,22 @@ let CrostiniPortSetting; ...@@ -48,21 +49,22 @@ let CrostiniPortSetting;
* defaultIndex: number, * defaultIndex: number,
* ticks: !Array}} * ticks: !Array}}
*/ */
let CrostiniDiskInfo; /* #export */ let CrostiniDiskInfo;
/** /**
* @typedef {{port_number: number, * @typedef {{port_number: number,
* protocol_type: !CrostiniPortProtocol}} * protocol_type: !CrostiniPortProtocol}}
*/ */
let CrostiniPortActiveSetting; /* #export */ let CrostiniPortActiveSetting;
/** /**
* @fileoverview A helper object used by the "Linux Apps" (Crostini) section * @fileoverview A helper object used by the "Linux Apps" (Crostini) section
* to install and uninstall Crostini. * to install and uninstall Crostini.
*/ */
cr.define('settings', function() { cr.define('settings', function() {
/** @interface */ /** @interface */
class CrostiniBrowserProxy { /* #export */ class CrostiniBrowserProxy {
/* Show crostini installer. */ /* Show crostini installer. */
requestCrostiniInstallerView() {} requestCrostiniInstallerView() {}
...@@ -75,7 +77,10 @@ cr.define('settings', function() { ...@@ -75,7 +77,10 @@ cr.define('settings', function() {
*/ */
getCrostiniSharedPathsDisplayText(paths) {} getCrostiniSharedPathsDisplayText(paths) {}
/** Called when page is ready. */ /**
* Called when page is ready.
* @return {!Promise<boolean>}
*/
notifyCrostiniSharedUsbDevicesPageReady() {} notifyCrostiniSharedUsbDevicesPageReady() {}
/** /**
...@@ -249,8 +254,10 @@ cr.define('settings', function() { ...@@ -249,8 +254,10 @@ cr.define('settings', function() {
getCrostiniMicSharingEnabled() {} getCrostiniMicSharingEnabled() {}
} }
/** @implements {settings.CrostiniBrowserProxy} */ /**
class CrostiniBrowserProxyImpl { * @implements {settings.CrostiniBrowserProxy}
*/
/* #export */ class CrostiniBrowserProxyImpl {
/** @override */ /** @override */
requestCrostiniInstallerView() { requestCrostiniInstallerView() {
chrome.send('requestCrostiniInstallerView'); chrome.send('requestCrostiniInstallerView');
......
...@@ -23,6 +23,7 @@ os_settings_namespace_rewrites = settings_namespace_rewrites + ...@@ -23,6 +23,7 @@ os_settings_namespace_rewrites = settings_namespace_rewrites +
"settings.browserChannelToI18nId|browserChannelToI18nId", "settings.browserChannelToI18nId|browserChannelToI18nId",
"settings.CellularSetupSettingsDelegate|CellularSetupSettingsDelegate", "settings.CellularSetupSettingsDelegate|CellularSetupSettingsDelegate",
"settings.ChangePictureBrowserProxy|ChangePictureBrowserProxy", "settings.ChangePictureBrowserProxy|ChangePictureBrowserProxy",
"settings.CrostiniBrowserProxy|CrostiniBrowserProxy",
"settings.CupsPrintersBrowserProxy|CupsPrintersBrowserProxy", "settings.CupsPrintersBrowserProxy|CupsPrintersBrowserProxy",
"settings.DefaultImage|DefaultImage", "settings.DefaultImage|DefaultImage",
"settings.FingerprintAttempt|FingerprintAttempt", "settings.FingerprintAttempt|FingerprintAttempt",
...@@ -95,6 +96,7 @@ os_settings_auto_imports = settings_auto_imports + ...@@ -95,6 +96,7 @@ os_settings_auto_imports = settings_auto_imports +
cr_elements_chromeos_auto_imports + [ cr_elements_chromeos_auto_imports + [
"chrome/browser/resources/settings/chromeos/ambient_mode_page/ambient_mode_browser_proxy.html|AmbientModeBrowserProxy,AmbientModeBrowserProxyImpl", "chrome/browser/resources/settings/chromeos/ambient_mode_page/ambient_mode_browser_proxy.html|AmbientModeBrowserProxy,AmbientModeBrowserProxyImpl",
"chrome/browser/resources/settings/chromeos/ambient_mode_page/constants.html|AmbientModeTopicSource,AmbientModeTemperatureUnit,AmbientModeAlbum,AmbientModeSettings,TopicSourceItem", "chrome/browser/resources/settings/chromeos/ambient_mode_page/constants.html|AmbientModeTopicSource,AmbientModeTemperatureUnit,AmbientModeAlbum,AmbientModeSettings,TopicSourceItem",
"chrome/browser/resources/settings/chromeos/crostini_page/crostini_browser_proxy.html|CrostiniBrowserProxy, CrostiniBrowserProxyImpl",
"chrome/browser/resources/settings/chromeos/internet_page/cellular_setup_settings_delegate.html|CellularSetupSettingsDelegate", "chrome/browser/resources/settings/chromeos/internet_page/cellular_setup_settings_delegate.html|CellularSetupSettingsDelegate",
"chrome/browser/resources/settings/chromeos/internet_page/internet_page_browser_proxy.html|InternetPageBrowserProxy,InternetPageBrowserProxyImpl", "chrome/browser/resources/settings/chromeos/internet_page/internet_page_browser_proxy.html|InternetPageBrowserProxy,InternetPageBrowserProxyImpl",
"chrome/browser/resources/settings/chromeos/deep_linking_behavior.html|DeepLinkingBehavior", "chrome/browser/resources/settings/chromeos/deep_linking_behavior.html|DeepLinkingBehavior",
......
...@@ -55,6 +55,7 @@ export {AmbientModeTemperatureUnit, AmbientModeTopicSource} from './ambient_mode ...@@ -55,6 +55,7 @@ export {AmbientModeTemperatureUnit, AmbientModeTopicSource} from './ambient_mode
export {bluetoothApis} from './bluetooth_page/bluetooth_page.m.js'; export {bluetoothApis} from './bluetooth_page/bluetooth_page.m.js';
export {GoogleAssistantBrowserProxyImpl} from './google_assistant_page/google_assistant_browser_proxy.m.js'; export {GoogleAssistantBrowserProxyImpl} from './google_assistant_page/google_assistant_browser_proxy.m.js';
export {ConsentStatus, DspHotwordState} from './google_assistant_page/google_assistant_page.m.js'; export {ConsentStatus, DspHotwordState} from './google_assistant_page/google_assistant_page.m.js';
export {CrostiniBrowserProxy, CrostiniBrowserProxyImpl} from './crostini_page/crostini_browser_proxy.m.js';
export {InternetPageBrowserProxy, InternetPageBrowserProxyImpl} from './internet_page/internet_page_browser_proxy.m.js'; export {InternetPageBrowserProxy, InternetPageBrowserProxyImpl} from './internet_page/internet_page_browser_proxy.m.js';
export {MultiDeviceBrowserProxy, MultiDeviceBrowserProxyImpl} from './multidevice_page/multidevice_browser_proxy.m.js'; export {MultiDeviceBrowserProxy, MultiDeviceBrowserProxyImpl} from './multidevice_page/multidevice_browser_proxy.m.js';
export {MultiDeviceFeature, MultiDeviceFeatureState, MultiDevicePageContentData, MultiDeviceSettingsMode, PhoneHubNotificationAccessStatus, SmartLockSignInEnabledState} from './multidevice_page/multidevice_constants.m.js'; export {MultiDeviceFeature, MultiDeviceFeatureState, MultiDevicePageContentData, MultiDeviceSettingsMode, PhoneHubNotificationAccessStatus, SmartLockSignInEnabledState} from './multidevice_page/multidevice_constants.m.js';
......
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