summaryrefslogtreecommitdiffstats
path: root/chromium/chrome/browser/resources/settings
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/chrome/browser/resources/settings')
-rw-r--r--chromium/chrome/browser/resources/settings/BUILD.gn1
-rw-r--r--chromium/chrome/browser/resources/settings/OWNERS3
-rw-r--r--chromium/chrome/browser/resources/settings/a11y_page/BUILD.gn2
-rw-r--r--chromium/chrome/browser/resources/settings/a11y_page/a11y_page.html75
-rw-r--r--chromium/chrome/browser/resources/settings/a11y_page/a11y_page.js20
-rw-r--r--chromium/chrome/browser/resources/settings/a11y_page/captions_subpage.html163
-rw-r--r--chromium/chrome/browser/resources/settings/a11y_page/captions_subpage.js119
-rw-r--r--chromium/chrome/browser/resources/settings/a11y_page/manage_a11y_page.html5
-rw-r--r--chromium/chrome/browser/resources/settings/a11y_page/manage_a11y_page.js27
-rw-r--r--chromium/chrome/browser/resources/settings/a11y_page/switch_access_subpage.html19
-rw-r--r--chromium/chrome/browser/resources/settings/a11y_page/switch_access_subpage.js51
-rw-r--r--chromium/chrome/browser/resources/settings/about_page/about_page.html20
-rw-r--r--chromium/chrome/browser/resources/settings/about_page/about_page.js16
-rw-r--r--chromium/chrome/browser/resources/settings/app_management_page/app_management_page.html14
-rw-r--r--chromium/chrome/browser/resources/settings/app_management_page/app_management_page.js19
-rw-r--r--chromium/chrome/browser/resources/settings/appearance_page/BUILD.gn12
-rw-r--r--chromium/chrome/browser/resources/settings/appearance_page/appearance_browser_proxy.js34
-rw-r--r--chromium/chrome/browser/resources/settings/appearance_page/appearance_page.html4
-rw-r--r--chromium/chrome/browser/resources/settings/appearance_page/appearance_page.js31
-rw-r--r--chromium/chrome/browser/resources/settings/appearance_page/wallpaper_browser_proxy.html2
-rw-r--r--chromium/chrome/browser/resources/settings/appearance_page/wallpaper_browser_proxy.js48
-rw-r--r--chromium/chrome/browser/resources/settings/autofill_page/BUILD.gn4
-rw-r--r--chromium/chrome/browser/resources/settings/autofill_page/passwords_section.html27
-rw-r--r--chromium/chrome/browser/resources/settings/autofill_page/passwords_section.js130
-rw-r--r--chromium/chrome/browser/resources/settings/basic_page/BUILD.gn1
-rw-r--r--chromium/chrome/browser/resources/settings/basic_page/basic_page.html55
-rw-r--r--chromium/chrome/browser/resources/settings/basic_page/basic_page.js100
-rw-r--r--chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.html1
-rw-r--r--chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.js14
-rw-r--r--chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.html2
-rw-r--r--chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js2
-rw-r--r--chromium/chrome/browser/resources/settings/chromeos/BUILD.gn8
-rw-r--r--chromium/chrome/browser/resources/settings/chromeos/os_apps_page/BUILD.gn (renamed from chromium/chrome/browser/resources/settings/app_management_page/BUILD.gn)9
-rw-r--r--chromium/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/BUILD.gn230
-rw-r--r--chromium/chrome/browser/resources/settings/chromeos/os_files_page/BUILD.gn1
-rw-r--r--chromium/chrome/browser/resources/settings/chromeos/os_reset_page/BUILD.gn7
-rw-r--r--chromium/chrome/browser/resources/settings/chromeos/os_settings_menu/BUILD.gn1
-rw-r--r--chromium/chrome/browser/resources/settings/chromeos/os_settings_page/BUILD.gn1
-rw-r--r--chromium/chrome/browser/resources/settings/chromeos/os_settings_ui/BUILD.gn2
-rw-r--r--chromium/chrome/browser/resources/settings/chromeos/os_toolbar/BUILD.gn18
-rw-r--r--chromium/chrome/browser/resources/settings/chromeos/personalization_page/BUILD.gn10
-rw-r--r--chromium/chrome/browser/resources/settings/controls/password_prompt_dialog.html9
-rw-r--r--chromium/chrome/browser/resources/settings/controls/pref_control_behavior.js4
-rw-r--r--chromium/chrome/browser/resources/settings/crostini_page/BUILD.gn1
-rw-r--r--chromium/chrome/browser/resources/settings/crostini_page/crostini_browser_proxy.js25
-rw-r--r--chromium/chrome/browser/resources/settings/crostini_page/crostini_export_import.html13
-rw-r--r--chromium/chrome/browser/resources/settings/crostini_page/crostini_export_import.js21
-rw-r--r--chromium/chrome/browser/resources/settings/crostini_page/crostini_page.html2
-rw-r--r--chromium/chrome/browser/resources/settings/crostini_page/crostini_page.js23
-rw-r--r--chromium/chrome/browser/resources/settings/crostini_page/crostini_subpage.html14
-rw-r--r--chromium/chrome/browser/resources/settings/crostini_page/crostini_subpage.js11
-rw-r--r--chromium/chrome/browser/resources/settings/date_time_page/date_time_page.html6
-rw-r--r--chromium/chrome/browser/resources/settings/date_time_page/date_time_page.js11
-rw-r--r--chromium/chrome/browser/resources/settings/date_time_page/timezone_subpage.html2
-rw-r--r--chromium/chrome/browser/resources/settings/date_time_page/timezone_subpage.js20
-rw-r--r--chromium/chrome/browser/resources/settings/device_page/device_page.html2
-rw-r--r--chromium/chrome/browser/resources/settings/device_page/device_page_browser_proxy.js28
-rw-r--r--chromium/chrome/browser/resources/settings/device_page/display_overscan_dialog.html4
-rw-r--r--chromium/chrome/browser/resources/settings/device_page/pointers.html16
-rw-r--r--chromium/chrome/browser/resources/settings/device_page/pointers.js11
-rw-r--r--chromium/chrome/browser/resources/settings/device_page/storage.html2
-rw-r--r--chromium/chrome/browser/resources/settings/device_page/storage.js4
-rw-r--r--chromium/chrome/browser/resources/settings/device_page/storage_external.html21
-rw-r--r--chromium/chrome/browser/resources/settings/device_page/storage_external.js46
-rw-r--r--chromium/chrome/browser/resources/settings/device_page/storage_external_entry.html25
-rw-r--r--chromium/chrome/browser/resources/settings/device_page/storage_external_entry.js72
-rw-r--r--chromium/chrome/browser/resources/settings/google_assistant_page/google_assistant_page.js2
-rw-r--r--chromium/chrome/browser/resources/settings/icons.html78
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/BUILD.gn16
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/internet_detail_page.html169
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/internet_detail_page.js1159
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/internet_known_networks_page.html12
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/internet_known_networks_page.js49
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/internet_page.html16
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/internet_page.js259
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/internet_page_browser_proxy.js43
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/internet_subpage.html32
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/internet_subpage.js259
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/network_proxy_section.html21
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/network_proxy_section.js28
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/network_summary.html1
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/network_summary.js23
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/network_summary_item.html11
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/network_summary_item.js30
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/tether_connection_dialog.html20
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/tether_connection_dialog.js72
-rw-r--r--chromium/chrome/browser/resources/settings/languages_page/languages_page.js18
-rw-r--r--chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_behavior.html2
-rw-r--r--chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_behavior.js6
-rw-r--r--chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_item.js7
-rw-r--r--chromium/chrome/browser/resources/settings/multidevice_page/multidevice_tether_item.js15
-rw-r--r--chromium/chrome/browser/resources/settings/os_settings_resources.grd195
-rw-r--r--chromium/chrome/browser/resources/settings/page_visibility.js10
-rw-r--r--chromium/chrome/browser/resources/settings/parental_controls_page/parental_controls_page.html12
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/BUILD.gn3
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/account_manager.html15
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/account_manager.js3
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/account_manager_browser_proxy.js10
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/fingerprint_list.js7
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/kerberos_accounts.html6
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/kerberos_accounts.js23
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/kerberos_add_account_dialog.html31
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/kerberos_add_account_dialog.js24
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/lock_screen.html6
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/lock_screen.js13
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/people_page.html90
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/people_page.js158
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/setup_fingerprint_dialog.html33
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/setup_fingerprint_dialog.js25
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/sync_browser_proxy.js15
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/sync_controls.html16
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/users_page.html24
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/users_page.js14
-rw-r--r--chromium/chrome/browser/resources/settings/printing_page/BUILD.gn1
-rw-r--r--chromium/chrome/browser/resources/settings/printing_page/OWNERS2
-rw-r--r--chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.html6
-rw-r--r--chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js13
-rw-r--r--chromium/chrome/browser/resources/settings/printing_page/cups_edit_printer_dialog.html91
-rw-r--r--chromium/chrome/browser/resources/settings/printing_page/cups_edit_printer_dialog.js36
-rw-r--r--chromium/chrome/browser/resources/settings/printing_page/cups_nearby_printers.html12
-rw-r--r--chromium/chrome/browser/resources/settings/printing_page/cups_nearby_printers.js28
-rw-r--r--chromium/chrome/browser/resources/settings/printing_page/cups_printer_types.js2
-rw-r--r--chromium/chrome/browser/resources/settings/printing_page/cups_printers.html117
-rw-r--r--chromium/chrome/browser/resources/settings/printing_page/cups_printers.js96
-rw-r--r--chromium/chrome/browser/resources/settings/printing_page/cups_printers_entry.html12
-rw-r--r--chromium/chrome/browser/resources/settings/printing_page/cups_printers_entry_list.html10
-rw-r--r--chromium/chrome/browser/resources/settings/printing_page/cups_printers_entry_list.js40
-rw-r--r--chromium/chrome/browser/resources/settings/printing_page/cups_saved_printers.html2
-rw-r--r--chromium/chrome/browser/resources/settings/printing_page/cups_saved_printers.js44
-rw-r--r--chromium/chrome/browser/resources/settings/privacy_page/BUILD.gn12
-rw-r--r--chromium/chrome/browser/resources/settings/privacy_page/privacy_page.html51
-rw-r--r--chromium/chrome/browser/resources/settings/privacy_page/privacy_page.js18
-rw-r--r--chromium/chrome/browser/resources/settings/privacy_page/security_keys_bio_enroll_dialog.html118
-rw-r--r--chromium/chrome/browser/resources/settings/privacy_page/security_keys_bio_enroll_dialog.js273
-rw-r--r--chromium/chrome/browser/resources/settings/privacy_page/security_keys_browser_proxy.js138
-rw-r--r--chromium/chrome/browser/resources/settings/privacy_page/security_keys_credential_management_dialog.html1
-rw-r--r--chromium/chrome/browser/resources/settings/privacy_page/security_keys_credential_management_dialog.js2
-rw-r--r--chromium/chrome/browser/resources/settings/privacy_page/security_keys_set_pin_dialog.html1
-rw-r--r--chromium/chrome/browser/resources/settings/privacy_page/security_keys_set_pin_dialog.js8
-rw-r--r--chromium/chrome/browser/resources/settings/privacy_page/security_keys_subpage.html15
-rw-r--r--chromium/chrome/browser/resources/settings/privacy_page/security_keys_subpage.js27
-rw-r--r--chromium/chrome/browser/resources/settings/route.js364
-rw-r--r--chromium/chrome/browser/resources/settings/search_engines_page/omnibox_extension_entry.html2
-rw-r--r--chromium/chrome/browser/resources/settings/search_engines_page/search_engine_entry.html2
-rw-r--r--chromium/chrome/browser/resources/settings/search_settings.js2
-rw-r--r--chromium/chrome/browser/resources/settings/settings_main/settings_main.html1
-rw-r--r--chromium/chrome/browser/resources/settings/settings_menu/settings_menu.html23
-rw-r--r--chromium/chrome/browser/resources/settings/settings_page/settings_subpage.html10
-rw-r--r--chromium/chrome/browser/resources/settings/settings_page/settings_subpage.js2
-rw-r--r--chromium/chrome/browser/resources/settings/settings_resources.grd34
-rw-r--r--chromium/chrome/browser/resources/settings/settings_shared_css.html7
-rw-r--r--chromium/chrome/browser/resources/settings/settings_ui/settings_ui.html3
-rw-r--r--chromium/chrome/browser/resources/settings/settings_ui/settings_ui.js6
-rw-r--r--chromium/chrome/browser/resources/settings/site_favicon.html6
-rw-r--r--chromium/chrome/browser/resources/settings/site_favicon.js22
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/category_default_setting.js1
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/category_setting_exceptions.html6
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/category_setting_exceptions.js36
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/constants.js1
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/cookie_info.js4
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/local_data_browser_proxy.js13
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/site_data.html25
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/site_data.js41
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/site_data_details_subpage.js1
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/site_details.html7
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/site_details.js9
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/site_details_permission.js9
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/site_list.html2
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/site_list.js24
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/site_settings_behavior.js5
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings_page/site_settings_page.html29
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings_page/site_settings_page.js24
172 files changed, 4367 insertions, 2312 deletions
diff --git a/chromium/chrome/browser/resources/settings/BUILD.gn b/chromium/chrome/browser/resources/settings/BUILD.gn
index 90c81d10457..4ba0dd05e72 100644
--- a/chromium/chrome/browser/resources/settings/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/BUILD.gn
@@ -106,7 +106,6 @@ group("closure_compile") {
if (is_chromeos) {
deps += [
"android_apps_page:closure_compile",
- "app_management_page:closure_compile",
"bluetooth_page:closure_compile",
"chromeos:closure_compile",
"crostini_page:closure_compile",
diff --git a/chromium/chrome/browser/resources/settings/OWNERS b/chromium/chrome/browser/resources/settings/OWNERS
index a34bf8b5f11..de56e9e6644 100644
--- a/chromium/chrome/browser/resources/settings/OWNERS
+++ b/chromium/chrome/browser/resources/settings/OWNERS
@@ -6,4 +6,7 @@ michaelpg@chromium.org
stevenjb@chromium.org
tommycli@chromium.org
+# Chrome OS Settings
+per-file *os_settings*=file://chrome/browser/resources/settings/chromeos/OWNERS
+
# COMPONENT: UI>Settings
diff --git a/chromium/chrome/browser/resources/settings/a11y_page/BUILD.gn b/chromium/chrome/browser/resources/settings/a11y_page/BUILD.gn
index cb0f25da20a..81f68e46981 100644
--- a/chromium/chrome/browser/resources/settings/a11y_page/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/a11y_page/BUILD.gn
@@ -52,10 +52,12 @@ js_library("manage_a11y_page") {
js_library("switch_access_subpage") {
deps = [
"..:route",
+ "../prefs:prefs_behavior",
"//ui/webui/resources/js:i18n_behavior",
"//ui/webui/resources/js:load_time_data",
"//ui/webui/resources/js:web_ui_listener_behavior",
]
+ externs_list = [ "$externs_path/settings_private.js" ]
}
js_library("tts_subpage") {
diff --git a/chromium/chrome/browser/resources/settings/a11y_page/a11y_page.html b/chromium/chrome/browser/resources/settings/a11y_page/a11y_page.html
index 74d602e6f8e..078fc8f2161 100644
--- a/chromium/chrome/browser/resources/settings/a11y_page/a11y_page.html
+++ b/chromium/chrome/browser/resources/settings/a11y_page/a11y_page.html
@@ -19,43 +19,24 @@
<dom-module id="settings-a11y-page">
<template>
<style include="settings-shared"></style>
- <template is="dom-if" if="[[showCaptionSettings_]]">
- <cr-link-row class="hr" id="captions" label="$i18n{captionsTitle}"
- on-click="onCaptionsClick_">
- </cr-link-row>
- </template>
<settings-animated-pages id="pages" current-route="{{currentRoute}}"
section="a11y" focus-config="[[focusConfig_]]">
-<if expr="not chromeos">
<div route-path="default">
- <settings-toggle-button
- id="a11yImageLabels"
- hidden$="[[!showAccessibilityLabelsSetting_]]"
- pref="{{prefs.settings.a11y.enable_accessibility_image_labels}}"
- on-change="onToggleAccessibilityImageLabels_"
- label="$i18n{accessibleImageLabelsTitle}"
- sub-label="$i18n{accessibleImageLabelsSubtitle}">
- </settings-toggle-button>
- <cr-link-row class="hr" label="$i18n{moreFeaturesLink}"
- on-click="onMoreFeaturesLinkClick_" sub-label="$i18n{a11yWebStore}"
- external>
- </cr-link-row>
- </div>
-</if>
-<if expr="chromeos or is_linux or is_win">
- <template is="dom-if" if="[[showCaptionSettings_]]">
- <template is="dom-if" route-path="/captions">
- <settings-subpage
- associated-control="[[$$('#captions')]]"
- page-title="$i18n{captionsTitle}">
- <settings-captions prefs="{{prefs}}"></settings-captions>
- </settings-subpage>
- </template>
- </template>
+ <cr-link-row class="hr" id="captions" label="$i18n{captionsTitle}"
+ on-click="onCaptionsClick_" external$="[[captionSettingsOpensExternally_]]">
+ </cr-link-row>
+<if expr="not chromeos">
+ <settings-toggle-button
+ id="a11yImageLabels"
+ hidden$="[[!showAccessibilityLabelsSetting_]]"
+ pref="{{prefs.settings.a11y.enable_accessibility_image_labels}}"
+ on-change="onToggleAccessibilityImageLabels_"
+ label="$i18n{accessibleImageLabelsTitle}"
+ sub-label="$i18n{accessibleImageLabelsSubtitle}">
+ </settings-toggle-button>
</if>
<if expr="chromeos">
- <template is="dom-if" if="[[pageVisibility.webstoreLink]]">
- <div route-path="default">
+ <template is="dom-if" if="[[pageVisibility.webstoreLink]]">
<settings-toggle-button
id="a11yImageLabels"
hidden$="[[!showAccessibilityLabelsSetting_]]"
@@ -73,7 +54,26 @@
on-click="onManageAccessibilityFeaturesTap_"
sub-label="$i18n{moreFeaturesLinkDescription}">
</cr-link-row>
- </div>
+ </template>
+</if>
+ <cr-link-row class="hr" label="$i18n{moreFeaturesLink}"
+ on-click="onMoreFeaturesLinkClick_" sub-label="$i18n{a11yWebStore}"
+ hidden="[[pageVisibility.webstoreLink]]" external>
+ </cr-link-row>
+ </div>
+<if expr="not is_macosx">
+ <template is="dom-if" if="[[showCaptionSettings_]]">
+ <template is="dom-if" route-path="/captions">
+ <settings-subpage
+ associated-control="[[$$('#captions')]]"
+ page-title="$i18n{captionsTitle}">
+ <settings-captions prefs="{{prefs}}"></settings-captions>
+ </settings-subpage>
+ </template>
+ </template>
+</if>
+<if expr="chromeos">
+ <template is="dom-if" if="[[pageVisibility.webstoreLink]]">
<template is="dom-if" route-path="/manageAccessibility">
<settings-subpage
associated-control="[[$$('#subpage-trigger')]]"
@@ -86,8 +86,7 @@
<settings-subpage
associated-control="[[$$('#subpage-trigger')]]"
page-title="$i18n{manageTtsSettings}">
- <settings-tts-subpage prefs="{{prefs}}">
- </settings-tts-subpage>
+ <settings-tts-subpage prefs="{{prefs}}"></settings-tts-subpage>
</settings-subpage>
</template>
<template is="dom-if" route-path="/manageAccessibility/switchAccess">
@@ -100,12 +99,6 @@
</template>
</if>
</settings-animated-pages>
-<if expr="chromeos">
- <cr-link-row class="hr" label="$i18n{moreFeaturesLink}"
- on-click="onMoreFeaturesLinkClick_" sub-label="$i18n{a11yWebStore}"
- hidden="[[pageVisibility.webstoreLink]]" external>
- </cr-link-row>
-</if>
</template>
<script src="a11y_page.js"></script>
</dom-module>
diff --git a/chromium/chrome/browser/resources/settings/a11y_page/a11y_page.js b/chromium/chrome/browser/resources/settings/a11y_page/a11y_page.js
index 6629ff75429..31045680975 100644
--- a/chromium/chrome/browser/resources/settings/a11y_page/a11y_page.js
+++ b/chromium/chrome/browser/resources/settings/a11y_page/a11y_page.js
@@ -67,6 +67,26 @@ Polymer({
},
},
+ /**
+ * Whether the caption settings link opens externally.
+ * @private {boolean}
+ */
+ captionSettingsOpensExternally_: {
+ type: Boolean,
+ value: function() {
+ let opensExternally = false;
+ // <if expr="is_macosx">
+ opensExternally = true;
+ // </if>
+
+ // <if expr="is_win">
+ opensExternally = loadTimeData.getBoolean('isWindows10OrNewer');
+ // </if>
+
+ return opensExternally;
+ },
+ },
+
// <if expr="chromeos">
/**
* Whether to show experimental accessibility features.
diff --git a/chromium/chrome/browser/resources/settings/a11y_page/captions_subpage.html b/chromium/chrome/browser/resources/settings/a11y_page/captions_subpage.html
index d3d305b9c42..a894a919576 100644
--- a/chromium/chrome/browser/resources/settings/a11y_page/captions_subpage.html
+++ b/chromium/chrome/browser/resources/settings/a11y_page/captions_subpage.html
@@ -7,83 +7,102 @@
<dom-module id="settings-captions">
<template>
- <style include="settings-shared"></style>
- <div class="settings-box">
- <div class="start settings-box-text">$i18n{captionsTextSize}</div>
- <settings-dropdown-menu id="captionsTextSize"
- label="$i18n{captionsTextSize}"
- pref="{{prefs.accessibility.captions.text_size}}"
- menu-options="[[textSizeOptions_]]">
- </settings-dropdown-menu>
+ <style include="settings-shared">
+ .preview-box {
+ align-items: center;
+ background-image:
+ url(chrome://theme/IDR_ACCESSIBILITY_CAPTIONS_PREVIEW_BACKGROUND);
+ background-position: center;
+ background-size: cover;
+ display: flex;
+ height: 112px;
+ justify-content: center;
+ margin: 0 var(--cr-section-padding) var(--cr-section-padding);
+ text-align: center;
+ }
+ </style>
+ <div class="settings-box first">
+ <h2 class="start">$i18n{captionsPreview}</h2>
</div>
- <div class="settings-box">
- <div class="start settings-box-text">$i18n{captionsTextFont}</div>
- <settings-dropdown-menu id="captionsTextFont"
- label="$i18n{captionsTextFont}"
- pref="{{prefs.accessibility.captions.text_font}}"
- menu-options="[[textFontOptions_]]">
- </settings-dropdown-menu>
+ <div class="preview-box">
+ <span style="
+ font-size:[[prefs.accessibility.captions.text_size.value]];
+ font-family:[[prefs.accessibility.captions.text_font.value]];
+ background-color: [[computeBackgroundColor_(
+ prefs.accessibility.captions.background_opacity.value,
+ prefs.accessibility.captions.background_color.value)]];
+ color: [[computeTextColor_(
+ prefs.accessibility.captions.text_opacity.value,
+ prefs.accessibility.captions.text_color.value)]];
+ text-shadow: [[prefs.accessibility.captions.text_shadow.value]];
+ padding: [[computePadding_(
+ prefs.accessibility.captions.text_size.value)]]">
+ $i18n{quickBrownFox}
+ </span>
</div>
- <div class="settings-box">
- <div class="start settings-box-text">$i18n{captionsTextColor}</div>
- <settings-dropdown-menu id="captionsTextColor"
- label="$i18n{captionsTextColor}"
- pref="{{prefs.accessibility.captions.text_color}}"
- menu-options="[[colorOptions_]]">
- </settings-dropdown-menu>
- </div>
- <div class="settings-box">
- <div class="start settings-box-text">$i18n{captionsTextOpacity}</div>
- <settings-slider id="captionsTextOpacity"
- ticks="[[textOpacityRange_]]"
- label-min="$i18n{captionsOpacityMin}"
- label-max="$i18n{captionsOpacityMax}"
- pref="{{prefs.accessibility.captions.text_opacity}}">
- </settings-slider>
- </div>
- <div class="settings-box">
- <div class="start settings-box-text">$i18n{captionsTextShadow}</div>
- <settings-dropdown-menu id="captionsTextShadow"
- label="$i18n{captionsTextShadow}"
- pref="{{prefs.accessibility.captions.text_shadow}}"
- menu-options="[[textShadowOptions_]]">
- </settings-dropdown-menu>
- </div>
- <div class="settings-box">
- <div class="start settings-box-text">$i18n{captionsBackgroundColor}</div>
- <settings-dropdown-menu id="captionsBackgroundColor"
- label="$i18n{captionsBackgroundColor}"
- pref="{{prefs.accessibility.captions.background_color}}"
- menu-options="[[colorOptions_]]">
- </settings-dropdown-menu>
- </div>
- <div class="settings-box">
- <div class="start settings-box-text">
- $i18n{captionsBackgroundOpacity}
- </div>
- <settings-slider id="captionsBackgroundOpacity"
- ticks="[[textOpacityRange_]]"
- label-min="$i18n{captionsOpacityMin}"
- label-max="$i18n{captionsOpacityMax}"
- pref="{{prefs.accessibility.captions.background_opacity}}">
- </settings-slider>
+ <div class="settings-box continuation">
+ <h2 class="start">$i18n{captionsSettings}</h2>
</div>
<div class="list-frame">
+ <div class="list-item underbar first">
+ <div class="start settings-box-text">$i18n{captionsTextSize}</div>
+ <settings-dropdown-menu id="captionsTextSize"
+ label="$i18n{captionsTextSize}"
+ pref="{{prefs.accessibility.captions.text_size}}"
+ menu-options="[[textSizeOptions_]]">
+ </settings-dropdown-menu>
+ </div>
+ <div class="list-item underbar">
+ <div class="start settings-box-text">$i18n{captionsTextFont}</div>
+ <settings-dropdown-menu id="captionsTextFont"
+ label="$i18n{captionsTextFont}"
+ pref="{{prefs.accessibility.captions.text_font}}"
+ menu-options="[[textFontOptions_]]">
+ </settings-dropdown-menu>
+ </div>
+ <div class="list-item underbar">
+ <div class="start settings-box-text">$i18n{captionsTextColor}</div>
+ <settings-dropdown-menu id="captionsTextColor"
+ label="$i18n{captionsTextColor}"
+ pref="{{prefs.accessibility.captions.text_color}}"
+ menu-options="[[colorOptions_]]">
+ </settings-dropdown-menu>
+ </div>
+ <div class="list-item underbar">
+ <div class="start settings-box-text">$i18n{captionsTextOpacity}</div>
+ <settings-dropdown-menu id="captionsTextOpacity"
+ label="$i18n{captionsTextOpacity}"
+ pref="{{prefs.accessibility.captions.text_opacity}}"
+ menu-options="[[textOpacityOptions_]]">
+ </settings-dropdown-menu>
+ </div>
+ <div class="list-item underbar">
+ <div class="start settings-box-text">$i18n{captionsTextShadow}</div>
+ <settings-dropdown-menu id="captionsTextShadow"
+ label="$i18n{captionsTextShadow}"
+ pref="{{prefs.accessibility.captions.text_shadow}}"
+ menu-options="[[textShadowOptions_]]">
+ </settings-dropdown-menu>
+ </div>
+ <div class="list-item underbar">
+ <div class="start settings-box-text">
+ $i18n{captionsBackgroundColor}
+ </div>
+ <settings-dropdown-menu id="captionsBackgroundColor"
+ label="$i18n{captionsBackgroundColor}"
+ pref="{{prefs.accessibility.captions.background_color}}"
+ menu-options="[[colorOptions_]]">
+ </settings-dropdown-menu>
+ </div>
<div class="list-item">
- <span style="
- font-size:[[prefs.accessibility.captions.text_size.value]];
- font-family:[[prefs.accessibility.captions.text_font.value]];
- background-color: [[computeBackgroundColor_(
- prefs.accessibility.captions.background_opacity.value,
- prefs.accessibility.captions.background_color.value)]];
- color: [[computeTextColor_(
- prefs.accessibility.captions.text_opacity.value,
- prefs.accessibility.captions.text_color.value)]];
- text-shadow: [[prefs.accessibility.captions.text_shadow.value]];
- padding: [[computePadding_(
- prefs.accessibility.captions.text_size.value)]]">
- $i18n{quickBrownFox}
- </span>
+ <div class="start settings-box-text">
+ $i18n{captionsBackgroundOpacity}
+ </div>
+ <settings-dropdown-menu id="captionsBackgroundOpacity"
+ label="$i18n{captionsBackgroundOpacity}"
+ pref="{{prefs.accessibility.captions.background_opacity}}"
+ menu-options="[[backgroundOpacityOptions_]]">
+ </settings-dropdown-menu>
</div>
</div>
</template>
diff --git a/chromium/chrome/browser/resources/settings/a11y_page/captions_subpage.js b/chromium/chrome/browser/resources/settings/a11y_page/captions_subpage.js
index df973af40cd..ca625a3be4f 100644
--- a/chromium/chrome/browser/resources/settings/a11y_page/captions_subpage.js
+++ b/chromium/chrome/browser/resources/settings/a11y_page/captions_subpage.js
@@ -9,21 +9,6 @@
(function() {
'use strict';
-
-/** @type {!Array<number>} */
-const TEXT_OPACITY_RANGE = [
- 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50,
- 55, 60, 65, 70, 75, 80, 85, 90, 95, 100
-];
-
-/**
- * @param {!Array<number>} ticks
- * @return {!Array<!cr_slider.SliderTick>}
- */
-function ticksWithLabels(ticks) {
- return ticks.map(x => ({label: `${x}`, value: x}));
-}
-
Polymer({
is: 'settings-captions',
@@ -36,34 +21,26 @@ Polymer({
},
/**
- * List of fonts populated by the fonts browser proxy.
- * @private {!DropdownMenuOptionList} */
- textFontOptions_: Object,
-
- /**
- * Reasonable, text opacity range.
- * @private {!Array<!cr_slider.SliderTick>}
- */
- textOpacityRange_: {
- readOnly: true,
- type: Array,
- value: ticksWithLabels(TEXT_OPACITY_RANGE),
- },
-
- /**
- * List of options for the text size drop-down menu.
+ * List of options for the background opacity drop-down menu.
* @type {!DropdownMenuOptionList}
*/
- textSizeOptions_: {
+ backgroundOpacityOptions_: {
readOnly: true,
type: Array,
value: function() {
return [
- {value: '50%', name: loadTimeData.getString('verySmall')},
- {value: '75%', name: loadTimeData.getString('small')},
- {value: '', name: loadTimeData.getString('medium')}, // Default = 100%
- {value: '150%', name: loadTimeData.getString('large')},
- {value: '200%', name: loadTimeData.getString('veryLarge')},
+ {
+ value: 100, // Default
+ name: loadTimeData.getString('captionsOpacityOpaque')
+ },
+ {
+ value: 50,
+ name: loadTimeData.getString('captionsOpacitySemiTransparent')
+ },
+ {
+ value: 0,
+ name: loadTimeData.getString('captionsOpacityTransparent')
+ },
];
},
},
@@ -77,18 +54,30 @@ Polymer({
type: Array,
value: function() {
return [
- {value: '', name: loadTimeData.getString('captionsDefaultSetting')},
- {value: '0,0,0', name: loadTimeData.getString('captionsColorBlack')},
+ {
+ value: '',
+ name: loadTimeData.getString('captionsDefaultSetting')
+ },
+ {
+ value: '0,0,0',
+ name: loadTimeData.getString('captionsColorBlack')
+ },
{
value: '255,255,255',
name: loadTimeData.getString('captionsColorWhite')
},
- {value: '255,0,0', name: loadTimeData.getString('captionsColorRed')},
+ {
+ value: '255,0,0',
+ name: loadTimeData.getString('captionsColorRed')
+ },
{
value: '0,255,0',
name: loadTimeData.getString('captionsColorGreen')
},
- {value: '0,0,255', name: loadTimeData.getString('captionsColorBlue')},
+ {
+ value: '0,0,255',
+ name: loadTimeData.getString('captionsColorBlue')
+ },
{
value: '255,255,0',
name: loadTimeData.getString('captionsColorYellow')
@@ -106,6 +95,36 @@ Polymer({
},
/**
+ * List of fonts populated by the fonts browser proxy.
+ * @private {!DropdownMenuOptionList} */
+ textFontOptions_: Object,
+
+ /**
+ * List of options for the text opacity drop-down menu.
+ * @type {!DropdownMenuOptionList}
+ */
+ textOpacityOptions_: {
+ readOnly: true,
+ type: Array,
+ value: function() {
+ return [
+ {
+ value: 100, // Default
+ name: loadTimeData.getString('captionsOpacityOpaque')
+ },
+ {
+ value: 50,
+ name: loadTimeData.getString('captionsOpacitySemiTransparent')
+ },
+ {
+ value: 10,
+ name: loadTimeData.getString('captionsOpacityTransparent')
+ },
+ ];
+ },
+ },
+
+ /**
* List of options for the text shadow drop-down menu.
* @type {!DropdownMenuOptionList}
*/
@@ -135,6 +154,24 @@ Polymer({
];
},
},
+
+ /**
+ * List of options for the text size drop-down menu.
+ * @type {!DropdownMenuOptionList}
+ */
+ textSizeOptions_: {
+ readOnly: true,
+ type: Array,
+ value: function() {
+ return [
+ {value: '25%', name: loadTimeData.getString('verySmall')},
+ {value: '50%', name: loadTimeData.getString('small')},
+ {value: '', name: loadTimeData.getString('medium')}, // Default = 100%
+ {value: '150%', name: loadTimeData.getString('large')},
+ {value: '200%', name: loadTimeData.getString('veryLarge')},
+ ];
+ },
+ },
},
/** @private {?settings.FontsBrowserProxy} */
diff --git a/chromium/chrome/browser/resources/settings/a11y_page/manage_a11y_page.html b/chromium/chrome/browser/resources/settings/a11y_page/manage_a11y_page.html
index c7f4721a974..7f290fc3df3 100644
--- a/chromium/chrome/browser/resources/settings/a11y_page/manage_a11y_page.html
+++ b/chromium/chrome/browser/resources/settings/a11y_page/manage_a11y_page.html
@@ -110,7 +110,8 @@
embedded></cr-link-row>
<cr-link-row class="hr" label="$i18n{appearanceSettingsTitle}"
on-click="onAppearanceTap_"
- sub-label="$i18n{appearanceSettingsDescription}" embedded></cr-link-row>
+ sub-label="$i18n{appearanceSettingsDescription}"
+ external="[[isOSSettings_]]" embedded></cr-link-row>
<h2>$i18n{keyboardAndTextInputHeading}</h2>
<settings-toggle-button class="first"
@@ -142,7 +143,7 @@
<iron-collapse
opened="[[prefs.settings.a11y.switch_access.enabled.value]]">
<cr-link-row label="$i18n{switchAccessOptionsLabel}"
- on-click="onSwitchAccessSettingsTap_" embedded external>
+ on-click="onSwitchAccessSettingsTap_" embedded>
</cr-link-row>
</iron-collapse>
</template>
diff --git a/chromium/chrome/browser/resources/settings/a11y_page/manage_a11y_page.js b/chromium/chrome/browser/resources/settings/a11y_page/manage_a11y_page.js
index 88238c3061f..5365829d90f 100644
--- a/chromium/chrome/browser/resources/settings/a11y_page/manage_a11y_page.js
+++ b/chromium/chrome/browser/resources/settings/a11y_page/manage_a11y_page.js
@@ -126,6 +126,18 @@ Polymer({
},
/**
+ * Whether this page shown as part of OS settings.
+ * TODO(crbug.com/986596): Remove this when SplitSettings is the default.
+ * @private
+ */
+ isOSSettings_: {
+ type: Boolean,
+ value: function() {
+ return loadTimeData.getBoolean('isOSSettings');
+ },
+ },
+
+ /**
* |hasKeyboard_|starts undefined so observers don't trigger
* until it has been populated.
* @private
@@ -200,7 +212,7 @@ Polymer({
/** @private */
onSwitchAccessSettingsTap_: function() {
- chrome.send('showSwitchAccessSettings');
+ settings.navigateTo(settings.routes.MANAGE_SWITCH_ACCESS_SETTINGS);
},
/** @private */
@@ -212,9 +224,16 @@ Polymer({
/** @private */
onAppearanceTap_: function() {
- settings.navigateTo(
- settings.routes.APPEARANCE,
- /* dynamicParams */ null, /* removeSearch */ true);
+ if (loadTimeData.getBoolean('isOSSettings')) {
+ // Open browser appearance section in a new browser tab.
+ window.open('chrome://settings/appearance');
+ } else {
+ // Open browser appearance in this settings window.
+ // TODO(crbug.com/986596): Remove this when SplitSettings is the default.
+ settings.navigateTo(
+ settings.routes.APPEARANCE,
+ /* dynamicParams */ null, /* removeSearch */ true);
+ }
},
/** @private */
diff --git a/chromium/chrome/browser/resources/settings/a11y_page/switch_access_subpage.html b/chromium/chrome/browser/resources/settings/a11y_page/switch_access_subpage.html
index d8c101b1563..6134a743a50 100644
--- a/chromium/chrome/browser/resources/settings/a11y_page/switch_access_subpage.html
+++ b/chromium/chrome/browser/resources/settings/a11y_page/switch_access_subpage.html
@@ -6,6 +6,7 @@
<link rel="import" href="../controls/settings_slider.html">
<link rel="import" href="../controls/settings_toggle_button.html">
<link rel="import" href="../i18n_setup.html">
+<link rel="import" href="../prefs/prefs_behavior.html">
<link rel="import" href="../settings_shared_css.html">
<dom-module id="settings-switch-access-subpage">
@@ -61,7 +62,23 @@
</div>
<settings-slider id="scanSpeedSlider" aria-describedby="scanSpeed"
pref="{{prefs.switch_access.auto_scan.speed_ms}}"
- ticks="[[autoScanSpeedValuesMs_]]"
+ ticks="[[autoScanSpeedRangeMs_]]"
+ min="[[minScanSpeedMs_]]"
+ max="[[maxScanSpeedMs_]]"
+ label-min="[[minScanSpeedLabelSec_]]"
+ label-max="[[maxScanSpeedLabelSec_]]">
+ </settings-dropdown-menu>
+ </div>
+ <div class="settings-box continuation list-item"
+ hidden$="[[!showKeyboardScanSettings_(
+ prefs.switch_access.auto_scan.enabled.value)]]">
+ <div class="start sub-item settings-box-text" id="keyboardScanSpeed">
+ $i18n{switchAccessAutoScanKeyboardSpeedLabel}
+ </div>
+ <settings-slider id="keyboardScanSpeedSlider"
+ aria-describedby="keyboardScanSpeed"
+ pref="{{prefs.switch_access.auto_scan.keyboard.speed_ms}}"
+ ticks="[[autoScanSpeedRangeMs_]]"
min="[[minScanSpeedMs_]]"
max="[[maxScanSpeedMs_]]"
label-min="[[minScanSpeedLabelSec_]]"
diff --git a/chromium/chrome/browser/resources/settings/a11y_page/switch_access_subpage.js b/chromium/chrome/browser/resources/settings/a11y_page/switch_access_subpage.js
index 328e60ca3d0..cd0026e9cdd 100644
--- a/chromium/chrome/browser/resources/settings/a11y_page/switch_access_subpage.js
+++ b/chromium/chrome/browser/resources/settings/a11y_page/switch_access_subpage.js
@@ -3,6 +3,13 @@
// found in the LICENSE file.
/**
+ * @fileoverview 'switch-access-subpage' is the collapsible section containing
+ * Switch Access settings.
+ */
+
+(function() {
+
+/**
* Available switch assignment values.
* @enum {number}
* @const
@@ -13,14 +20,29 @@ const SwitchAccessAssignmentValue = {
ENTER: 2,
};
+/** @type {!Array<number>} */
+const AUTO_SCAN_SPEED_RANGE_MS = [
+ 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600,
+ 1700, 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800,
+ 2900, 3000, 3100, 3200, 3300, 3400, 3500, 3600, 3700, 3800, 3900, 4000
+];
+
/**
- * @fileoverview 'switch-access-subpage' is the collapsible section containing
- * Switch Access settings.
+ * @param {!Array<number>} ticksInMs
+ * @return {!Array<!cr_slider.SliderTick>}
*/
+function ticksWithLabelsInSec(ticksInMs) {
+ // Dividing by 1000 to convert milliseconds to seconds for the label.
+ return ticksInMs.map(x => ({label: `${x / 1000}`, value: x}));
+}
+
Polymer({
is: 'settings-switch-access-subpage',
- behaviors: [I18nBehavior],
+ behaviors: [
+ I18nBehavior,
+ PrefsBehavior,
+ ],
properties: {
/**
@@ -32,15 +54,10 @@ Polymer({
},
/** @private {Array<number>} */
- autoScanSpeedValuesMs_: {
+ autoScanSpeedRangeMs_: {
readOnly: true,
type: Array,
- value: [
- 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300,
- 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100, 2200,
- 2300, 2400, 2500, 2600, 2700, 2800, 2900, 3000, 3100,
- 3200, 3300, 3400, 3500, 3600, 3700, 3800, 3900, 4000
- ]
+ value: ticksWithLabelsInSec(AUTO_SCAN_SPEED_RANGE_MS),
},
/** @private {Object} */
@@ -123,6 +140,19 @@ Polymer({
},
/**
+ * @return {boolean} Whether to show settings for auto-scan within the
+ * keyboard.
+ * @private
+ */
+ showKeyboardScanSettings_: function() {
+ const improvedTextInputEnabled = loadTimeData.getBoolean(
+ 'showExperimentalAccessibilitySwitchAccessImprovedTextInput');
+ const autoScanEnabled = /** @type {boolean} */
+ (this.getPref('switch_access.auto_scan.enabled').value);
+ return improvedTextInputEnabled && autoScanEnabled;
+ },
+
+ /**
* @param {string} command
*/
onSwitchAssigned_: function(command) {
@@ -166,3 +196,4 @@ Polymer({
'durationInSeconds', this.formatter_.format(scanSpeedValueSec));
},
});
+})();
diff --git a/chromium/chrome/browser/resources/settings/about_page/about_page.html b/chromium/chrome/browser/resources/settings/about_page/about_page.html
index 18c371cdbbe..99c0a1c19a1 100644
--- a/chromium/chrome/browser/resources/settings/about_page/about_page.html
+++ b/chromium/chrome/browser/resources/settings/about_page/about_page.html
@@ -23,6 +23,7 @@
<if expr="chromeos">
<link rel="import" href="detailed_build_info.html">
<link rel="import" href="update_warning_dialog.html">
+<link rel="import" href="../chromeos/os_icons.html">
<link rel="import" href="../settings_page/settings_subpage.html">
<link rel="import" href="../reset_page/powerwash_dialog.html">
</if>
@@ -150,14 +151,19 @@
</span>
</if>
<if expr="chromeos">
- <div id="endOfLifeMessageContainer" hidden="[[!hasEndOfLife_]]">
- $i18n{endOfLifeMessage}
- <a href="$i18n{endOfLifeLearnMoreURL}" target="_blank">
- $i18n{learnMore}
- </a>
- </div>
+ <div id="endOfLifeMessageContainer" hidden="[[!hasEndOfLife_]]">
+ $i18n{endOfLifeMessage}
+ <a href="$i18n{endOfLifeLearnMoreURL}" target="_blank">
+ $i18n{learnMore}
+ </a>
+ </div>
</if>
<div class="secondary">$i18n{aboutBrowserVersion}</div>
+<if expr="chromeos">
+ <div class="secondary"
+ inner-h-t-m-l="[[getUpdateOsSettingsLink_()]]">
+ </div>
+</if>
</div>
<div class="separator" hidden="[[!showButtonContainer_]]"></div>
<span id="buttonContainer" hidden="[[!showButtonContainer_]]">
@@ -233,7 +239,7 @@
<if expr="_google_chrome">
<cr-link-row class="hr" id="reportIssue" on-click="onReportIssueTap_"
hidden="[[!prefs.feedback_allowed.value]]"
- label="$i18n{aboutReportAnIssue}"></cr-link-row>
+ label="$i18n{aboutReportAnIssue}" external></cr-link-row>
</if>
<if expr="chromeos">
<cr-link-row class="hr" id="detailed-build-info-trigger"
diff --git a/chromium/chrome/browser/resources/settings/about_page/about_page.js b/chromium/chrome/browser/resources/settings/about_page/about_page.js
index 4899236f7b7..d4781a4d1b7 100644
--- a/chromium/chrome/browser/resources/settings/about_page/about_page.js
+++ b/chromium/chrome/browser/resources/settings/about_page/about_page.js
@@ -491,7 +491,7 @@ Polymer({
// If Chrome OS has reached end of life, display a special icon and
// ignore UpdateStatus.
if (this.hasEndOfLife_) {
- return 'settings:end-of-life';
+ return 'os-settings:end-of-life';
}
// </if>
@@ -632,6 +632,20 @@ Polymer({
this.i18nAdvanced('aboutProductOsLicense');
},
+ // <if expr="chromeos">
+ /**
+ * @return {string}
+ * @private
+ */
+ getUpdateOsSettingsLink_: function() {
+ // Note: This string contains raw HTML and thus requires i18nAdvanced().
+ // Since the i18n template syntax (e.g., $i18n{}) does not include an
+ // "advanced" version, it's not possible to inline this link directly in the
+ // HTML.
+ return this.i18nAdvanced('aboutUpdateOsSettingsLink');
+ },
+ // </if>
+
/**
* @param {boolean} enabled True if Crostini is enabled.
* @private
diff --git a/chromium/chrome/browser/resources/settings/app_management_page/app_management_page.html b/chromium/chrome/browser/resources/settings/app_management_page/app_management_page.html
deleted file mode 100644
index cab1b4a924f..00000000000
--- a/chromium/chrome/browser/resources/settings/app_management_page/app_management_page.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<link rel="import" href="chrome://resources/html/polymer.html">
-
-<link rel="import" href="../open_window_proxy.html">
-<link rel="import" href="chrome://resources/cr_elements/cr_link_row/cr_link_row.html">
-
-<dom-module id="settings-app-management-page">
- <template>
- <cr-link-row id="appManagementButton"
- label="$i18n{manageYourApps}" sub-label="$i18n{manageYourAppsSublabel}"
- on-click="openAppManagement_" external>
- </cr-link-row>
- </template>
- <script src="app_management_page.js"></script>
-</dom-module>
diff --git a/chromium/chrome/browser/resources/settings/app_management_page/app_management_page.js b/chromium/chrome/browser/resources/settings/app_management_page/app_management_page.js
deleted file mode 100644
index da525757d79..00000000000
--- a/chromium/chrome/browser/resources/settings/app_management_page/app_management_page.js
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2019 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/**
- * @fileoverview
- * 'app-management-page' is the settings page which links to App Management.
- */
-
-Polymer({
- is: 'settings-app-management-page',
-
- /** @private */
- openAppManagement_: function() {
- chrome.metricsPrivate.recordUserAction('SettingsPage.OpenAppManagement');
- settings.OpenWindowProxyImpl.getInstance().openURL(
- 'chrome://app-management');
- },
-});
diff --git a/chromium/chrome/browser/resources/settings/appearance_page/BUILD.gn b/chromium/chrome/browser/resources/settings/appearance_page/BUILD.gn
index 7b27f61c697..a3c3d26c232 100644
--- a/chromium/chrome/browser/resources/settings/appearance_page/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/appearance_page/BUILD.gn
@@ -12,6 +12,10 @@ js_type_check("closure_compile") {
":fonts_browser_proxy",
":home_url_input",
]
+
+ if (is_chromeos) {
+ deps += [ ":wallpaper_browser_proxy" ]
+ }
}
js_library("appearance_fonts_page") {
@@ -42,6 +46,7 @@ js_library("appearance_browser_proxy") {
js_library("appearance_page") {
deps = [
":appearance_browser_proxy",
+ ":wallpaper_browser_proxy",
"..:page_visibility",
"..:route",
"../controls:settings_dropdown_menu",
@@ -75,3 +80,10 @@ js_library("home_url_input") {
]
externs_list = [ "$externs_path/settings_private.js" ]
}
+
+js_library("wallpaper_browser_proxy") {
+ deps = [
+ "//ui/webui/resources/js:cr",
+ ]
+ externs_list = [ "$externs_path/chrome_send.js" ]
+}
diff --git a/chromium/chrome/browser/resources/settings/appearance_page/appearance_browser_proxy.js b/chromium/chrome/browser/resources/settings/appearance_page/appearance_browser_proxy.js
index c75464dc66e..7e8bd802fc3 100644
--- a/chromium/chrome/browser/resources/settings/appearance_page/appearance_browser_proxy.js
+++ b/chromium/chrome/browser/resources/settings/appearance_page/appearance_browser_proxy.js
@@ -17,22 +17,6 @@ cr.define('settings', function() {
/** @return {boolean} Whether the current profile is supervised. */
isSupervised() {}
- /**
- * @return {!Promise<boolean>} Whether the wallpaper setting row should be
- * visible.
- */
- isWallpaperSettingVisible() {}
-
- /**
- * @return {!Promise<boolean>} Whether the wallpaper is policy controlled.
- */
- isWallpaperPolicyControlled() {}
-
- // <if expr="chromeos">
- openWallpaperManager() {}
-
- // </if>
-
useDefaultTheme() {}
// <if expr="is_linux and not chromeos">
@@ -70,24 +54,6 @@ cr.define('settings', function() {
return loadTimeData.getBoolean('isSupervised');
}
- // <if expr="chromeos">
- /** @override */
- isWallpaperSettingVisible() {
- return cr.sendWithPromise('isWallpaperSettingVisible');
- }
-
- /** @override */
- isWallpaperPolicyControlled() {
- return cr.sendWithPromise('isWallpaperPolicyControlled');
- }
-
- /** @override */
- openWallpaperManager() {
- chrome.send('openWallpaperManager');
- }
-
- // </if>
-
/** @override */
useDefaultTheme() {
chrome.send('useDefaultTheme');
diff --git a/chromium/chrome/browser/resources/settings/appearance_page/appearance_page.html b/chromium/chrome/browser/resources/settings/appearance_page/appearance_page.html
index df9863a3a64..3a619511bed 100644
--- a/chromium/chrome/browser/resources/settings/appearance_page/appearance_page.html
+++ b/chromium/chrome/browser/resources/settings/appearance_page/appearance_page.html
@@ -18,6 +18,10 @@
<link rel="import" href="appearance_fonts_page.html">
<link rel="import" href="home_url_input.html">
+<if expr="chromeos">
+<link rel="import" href="../appearance_page/wallpaper_browser_proxy.html">
+</if>
+
<dom-module id="settings-appearance-page">
<template>
<style include="settings-shared md-select iron-flex">
diff --git a/chromium/chrome/browser/resources/settings/appearance_page/appearance_page.js b/chromium/chrome/browser/resources/settings/appearance_page/appearance_page.js
index 9fa3b60a182..2551cf3b191 100644
--- a/chromium/chrome/browser/resources/settings/appearance_page/appearance_page.js
+++ b/chromium/chrome/browser/resources/settings/appearance_page/appearance_page.js
@@ -119,7 +119,12 @@ Polymer({
},
/** @private {?settings.AppearanceBrowserProxy} */
- browserProxy_: null,
+ appearanceBrowserProxy_: null,
+
+ // <if expr="chromeos">
+ /** @private {?settings.WallpaperBrowserProxy} */
+ wallpaperBrowserProxy_: null,
+ // </if>
observers: [
'defaultFontSizeChanged_(prefs.webkit.webprefs.default_font_size.value)',
@@ -133,7 +138,12 @@ Polymer({
/** @override */
created: function() {
- this.browserProxy_ = settings.AppearanceBrowserProxyImpl.getInstance();
+ this.appearanceBrowserProxy_ =
+ settings.AppearanceBrowserProxyImpl.getInstance();
+ // <if expr="chromeos">
+ this.wallpaperBrowserProxy_ =
+ settings.WallpaperBrowserProxyImpl.getInstance();
+ // </if>
},
/** @override */
@@ -141,16 +151,16 @@ Polymer({
this.$.defaultFontSize.menuOptions = this.fontSizeOptions_;
// TODO(dschuyler): Look into adding a listener for the
// default zoom percent.
- this.browserProxy_.getDefaultZoom().then(zoom => {
+ this.appearanceBrowserProxy_.getDefaultZoom().then(zoom => {
this.defaultZoom_ = zoom;
});
// <if expr="chromeos">
- this.browserProxy_.isWallpaperSettingVisible().then(
+ this.wallpaperBrowserProxy_.isWallpaperSettingVisible().then(
isWallpaperSettingVisible => {
assert(this.pageVisibility);
this.pageVisibility.setWallpaper = isWallpaperSettingVisible;
});
- this.browserProxy_.isWallpaperPolicyControlled().then(
+ this.wallpaperBrowserProxy_.isWallpaperPolicyControlled().then(
isPolicyControlled => {
this.isWallpaperPolicyControlled_ = isPolicyControlled;
});
@@ -219,13 +229,13 @@ Polymer({
* @private
*/
openWallpaperManager_: function() {
- this.browserProxy_.openWallpaperManager();
+ this.wallpaperBrowserProxy_.openWallpaperManager();
},
// </if>
/** @private */
onUseDefaultTap_: function() {
- this.browserProxy_.useDefaultTheme();
+ this.appearanceBrowserProxy_.useDefaultTheme();
},
// <if expr="is_linux and not chromeos">
@@ -254,7 +264,8 @@ Polymer({
* @private
*/
showUseSystem_: function(themeId, useSystemTheme) {
- return (!!themeId || !useSystemTheme) && !this.browserProxy_.isSupervised();
+ return (!!themeId || !useSystemTheme) &&
+ !this.appearanceBrowserProxy_.isSupervised();
},
/**
@@ -271,7 +282,7 @@ Polymer({
/** @private */
onUseSystemTap_: function() {
- this.browserProxy_.useSystemTheme();
+ this.appearanceBrowserProxy_.useSystemTheme();
},
// </if>
@@ -288,7 +299,7 @@ Polymer({
if (themeId.length > 0 && themeId != AUTOGENERATED_THEME_ID) {
assert(!useSystemTheme);
- this.browserProxy_.getThemeInfo(themeId).then(info => {
+ this.appearanceBrowserProxy_.getThemeInfo(themeId).then(info => {
this.themeSublabel_ = info.name;
});
diff --git a/chromium/chrome/browser/resources/settings/appearance_page/wallpaper_browser_proxy.html b/chromium/chrome/browser/resources/settings/appearance_page/wallpaper_browser_proxy.html
new file mode 100644
index 00000000000..59b04eed214
--- /dev/null
+++ b/chromium/chrome/browser/resources/settings/appearance_page/wallpaper_browser_proxy.html
@@ -0,0 +1,2 @@
+<link rel="href" src="chrome://resources/html/cr.html">
+<script src="wallpaper_browser_proxy.js"></script>
diff --git a/chromium/chrome/browser/resources/settings/appearance_page/wallpaper_browser_proxy.js b/chromium/chrome/browser/resources/settings/appearance_page/wallpaper_browser_proxy.js
new file mode 100644
index 00000000000..90a2e4db7d9
--- /dev/null
+++ b/chromium/chrome/browser/resources/settings/appearance_page/wallpaper_browser_proxy.js
@@ -0,0 +1,48 @@
+// Copyright 2019 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+cr.define('settings', function() {
+ /** @interface */
+ class WallpaperBrowserProxy {
+ /**
+ * @return {!Promise<boolean>} Whether the wallpaper setting row should be
+ * visible.
+ */
+ isWallpaperSettingVisible() {}
+
+ /**
+ * @return {!Promise<boolean>} Whether the wallpaper is policy controlled.
+ */
+ isWallpaperPolicyControlled() {}
+
+ openWallpaperManager() {}
+ }
+
+ /**
+ * @implements {settings.WallpaperBrowserProxy}
+ */
+ class WallpaperBrowserProxyImpl {
+ /** @override */
+ isWallpaperSettingVisible() {
+ return cr.sendWithPromise('isWallpaperSettingVisible');
+ }
+
+ /** @override */
+ isWallpaperPolicyControlled() {
+ return cr.sendWithPromise('isWallpaperPolicyControlled');
+ }
+
+ /** @override */
+ openWallpaperManager() {
+ chrome.send('openWallpaperManager');
+ }
+ }
+
+ cr.addSingletonGetter(WallpaperBrowserProxyImpl);
+
+ return {
+ WallpaperBrowserProxy: WallpaperBrowserProxy,
+ WallpaperBrowserProxyImpl: WallpaperBrowserProxyImpl,
+ };
+});
diff --git a/chromium/chrome/browser/resources/settings/autofill_page/BUILD.gn b/chromium/chrome/browser/resources/settings/autofill_page/BUILD.gn
index 84a9f949cac..1afa9c4b7ef 100644
--- a/chromium/chrome/browser/resources/settings/autofill_page/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/autofill_page/BUILD.gn
@@ -117,14 +117,16 @@ js_library("passwords_section") {
":password_list_item",
":password_manager_proxy",
"..:global_scroll_target_behavior",
+ "../people_page:sync_browser_proxy",
"//third_party/polymer/v1_0/components-chromium/iron-a11y-announcer:iron-a11y-announcer-extracted",
"//third_party/polymer/v1_0/components-chromium/iron-a11y-keys-behavior:iron-a11y-keys-behavior-extracted",
"//ui/webui/resources/cr_elements/cr_action_menu:cr_action_menu",
- "//ui/webui/resources/cr_elements/cr_toast:cr_toast",
+ "//ui/webui/resources/cr_elements/cr_toast:cr_toast_manager",
"//ui/webui/resources/js:assert",
"//ui/webui/resources/js:i18n_behavior",
"//ui/webui/resources/js:list_property_update_behavior",
"//ui/webui/resources/js:util",
+ "//ui/webui/resources/js:web_ui_listener_behavior",
"//ui/webui/resources/js/cr/ui:focus_without_ink",
]
externs_list = [ "$externs_path/passwords_private.js" ]
diff --git a/chromium/chrome/browser/resources/settings/autofill_page/passwords_section.html b/chromium/chrome/browser/resources/settings/autofill_page/passwords_section.html
index 1e7b7923b1a..58e376e7433 100644
--- a/chromium/chrome/browser/resources/settings/autofill_page/passwords_section.html
+++ b/chromium/chrome/browser/resources/settings/autofill_page/passwords_section.html
@@ -3,7 +3,7 @@
<link rel="import" href="chrome://resources/cr_elements/cr_action_menu/cr_action_menu.html">
<link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_icon_button/cr_icon_button.html">
-<link rel="import" href="chrome://resources/cr_elements/cr_toast/cr_toast.html">
+<link rel="import" href="chrome://resources/cr_elements/cr_toast/cr_toast_manager.html">
<link rel="import" href="chrome://resources/cr_elements/icons.html">
<link rel="import" href="chrome://resources/html/assert.html">
<link rel="import" href="chrome://resources/html/cr/ui/focus_without_ink.html">
@@ -17,6 +17,7 @@
<link rel="import" href="../controls/extension_controlled_indicator.html">
<link rel="import" href="../global_scroll_target_behavior.html">
<link rel="import" href="../prefs/prefs.html">
+<link rel="import" href="../prefs/prefs_behavior.html">
<link rel="import" href="../settings_shared_css.html">
<link rel="import" href="../site_favicon.html">
<link rel="import" href="password_edit_dialog.html">
@@ -72,12 +73,23 @@
</extension-controlled-indicator>
</div>
</template>
+ <settings-toggle-button id="passwordsLeakDetectionCheckbox"
+ pref="{{prefs.profile.password_manager_leak_detection}}"
+ checked="[[getCheckedLeakDetection_(
+ userSignedIn_, prefs.profile.password_manager_leak_detection)]]"
+ label="$i18n{passwordsLeakDetectionLabel}"
+ sub-label="[[getPasswordsLeakDetectionSubLabel_(
+ userSignedIn_, prefs.profile.password_manager_leak_detection)]]"
+ hidden$="[[!passwordsLeakDetectionEnabled_]]"
+ disabled="[[!userSignedIn_]]">
+ </settings-toggle-button>
<settings-toggle-button id="autosigninCheckbox"
pref="{{prefs.credentials_enable_autosignin}}"
label="$i18n{passwordsAutosigninLabel}"
sub-label="$i18n{passwordsAutosigninDescription}">
</settings-toggle-button>
- <div id="manageLink" class="settings-box first two-line">
+ <div id="manageLink" class="settings-box first two-line"
+ hidden$="[[hidePasswordsLink_]]">
<!-- This span lays out the url correctly, relative to the label. -->
<span>$i18nRaw{managePasswordsLabel}</span>
</div>
@@ -163,12 +175,11 @@
</settings-password-prompt-dialog>
</template>
</if>
- <cr-toast id="undoToast" duration="[[toastDuration_]]">
- <div id="undoLabel">$i18n{passwordDeleted}</div>
- <cr-button on-click="onUndoButtonTap_">
- $i18n{undoRemovePassword}
- </cr-button>
- </cr-toast>
+ <cr-toast-manager on-undo-click="onUndoButtonTap_"
+ undo-label="$i18n{undoRemovePassword}"
+ undo-description="$i18n{undoDescription}"
+ duration="[[toastDuration_]]">
+ </cr-toast-manager>
<div class="settings-box block first">
<h2>$i18n{passwordExceptionsHeading}</h2>
</div>
diff --git a/chromium/chrome/browser/resources/settings/autofill_page/passwords_section.js b/chromium/chrome/browser/resources/settings/autofill_page/passwords_section.js
index 1f552fdf4ec..a98d69646d4 100644
--- a/chromium/chrome/browser/resources/settings/autofill_page/passwords_section.js
+++ b/chromium/chrome/browser/resources/settings/autofill_page/passwords_section.js
@@ -36,9 +36,11 @@ Polymer({
behaviors: [
I18nBehavior,
+ WebUIListenerBehavior,
ListPropertyUpdateBehavior,
Polymer.IronA11yKeysBehavior,
settings.GlobalScrollTargetBehavior,
+ PrefsBehavior,
],
properties: {
@@ -94,6 +96,18 @@ Polymer({
},
/** @private */
+ hidePasswordsLink_: {
+ type: Boolean,
+ computed: 'computeHidePasswordsLink_(syncPrefs_, syncStatus_)',
+ },
+
+ /** @private */
+ passwordsLeakDetectionEnabled_: {
+ type: Boolean,
+ value: loadTimeData.getBoolean('passwordsLeakDetectionEnabled'),
+ },
+
+ /** @private */
showExportPasswords_: {
type: Boolean,
computed: 'hasPasswords_(savedPasswords.splices)',
@@ -111,6 +125,23 @@ Polymer({
/** @private */
showPasswordEditDialog_: Boolean,
+ // <if expr="not chromeos">
+ /** @private {Array<!settings.StoredAccount>} */
+ storedAccounts_: Object,
+ // </if>
+
+ /** @private {settings.SyncPrefs} */
+ syncPrefs_: Object,
+
+ /** @private {settings.SyncStatus} */
+ syncStatus_: Object,
+
+ /** @private */
+ userSignedIn_: {
+ type: Boolean,
+ computed: 'computeUserSignedIn_(syncStatus_, storedAccounts_)',
+ },
+
/** Filter on the saved passwords and exceptions. */
filter: {
type: String,
@@ -156,11 +187,14 @@ Polymer({
},
/**
- * The element to return focus to, when the currently active dialog is
- * closed.
- * @private {?HTMLElement}
+ * A stack of the elements that triggered dialog to open and should therefore
+ * receive focus when that dialog is closed. The bottom of the stack is the
+ * element that triggered the earliest open dialog and top of the stack is the
+ * element that triggered the most recent (i.e. active) dialog. If no dialog
+ * is open, the stack is empty.
+ * @private {!Array<Element>}
*/
- activeDialogAnchor_: null,
+ activeDialogAnchorStack_: [],
/**
* @type {PasswordManagerProxy}
@@ -210,7 +244,7 @@ Polymer({
this.tokenRequestManager_ = new settings.BlockingRequestManager();
} else {
this.tokenRequestManager_ = new settings.BlockingRequestManager(
- () => this.showPasswordPromptDialog_ = true);
+ this.openPasswordPromptDialog_.bind(this));
}
// </if>
@@ -226,6 +260,23 @@ Polymer({
this.notifySplices('savedPasswords', []);
+ const syncBrowserProxy = settings.SyncBrowserProxyImpl.getInstance();
+
+ const syncStatusChanged = syncStatus => this.syncStatus_ = syncStatus;
+ syncBrowserProxy.getSyncStatus().then(syncStatusChanged);
+ this.addWebUIListener('sync-status-changed', syncStatusChanged);
+
+ // <if expr="not chromeos">
+ const storedAccountsChanged = storedAccounts => this.storedAccounts_ =
+ storedAccounts;
+ syncBrowserProxy.getStoredAccounts().then(storedAccountsChanged);
+ this.addWebUIListener('stored-accounts-updated', storedAccountsChanged);
+ // </if>
+
+ const syncPrefsChanged = syncPrefs => this.syncPrefs_ = syncPrefs;
+ syncBrowserProxy.sendSyncPrefsChanged();
+ this.addWebUIListener('sync-prefs-changed', syncPrefsChanged);
+
Polymer.RenderStatus.afterNextRender(this, function() {
Polymer.IronA11yAnnouncer.requestAvailability();
});
@@ -243,9 +294,8 @@ Polymer({
* @type {function(!Array<PasswordManagerProxy.ExceptionEntry>):void}
*/
(this.setPasswordExceptionsListener_));
-
- if (this.$.undoToast.open) {
- this.$.undoToast.hide();
+ if (cr.toastManager.getInstance().isToastOpen) {
+ cr.toastManager.getInstance().hide();
}
},
@@ -273,6 +323,12 @@ Polymer({
onPasswordPromptClosed_: function() {
this.showPasswordPromptDialog_ = false;
+ cr.ui.focusWithoutInk(assert(this.activeDialogAnchorStack_.pop()));
+ },
+
+ openPasswordPromptDialog_: function() {
+ this.activeDialogAnchorStack_.push(getDeepActiveElement());
+ this.showPasswordPromptDialog_ = true;
},
// </if>
@@ -290,8 +346,7 @@ Polymer({
/** @private */
onPasswordEditDialogClosed_: function() {
this.showPasswordEditDialog_ = false;
- cr.ui.focusWithoutInk(assert(this.activeDialogAnchor_));
- this.activeDialogAnchor_ = null;
+ cr.ui.focusWithoutInk(assert(this.activeDialogAnchorStack_.pop()));
// Trigger a re-evaluation of the activePassword as the visibility state of
// the password might have changed.
@@ -299,6 +354,33 @@ Polymer({
},
/**
+ * @return {boolean}
+ * @private
+ */
+ computeHidePasswordsLink_: function() {
+ return !!this.syncStatus_ && !!this.syncStatus_.signedIn &&
+ !!this.syncPrefs_ && !!this.syncPrefs_.encryptAllData;
+ },
+
+ /**
+ * @return {boolean}
+ * @private
+ */
+ computeUserSignedIn_: function() {
+ return (!!this.syncStatus_ && !!this.syncStatus_.signedIn) ||
+ (!!this.storedAccounts_ && this.storedAccounts_.length > 0);
+ },
+
+ /**
+ * @return {boolean}
+ * @private
+ */
+ getCheckedLeakDetection_: function() {
+ return this.userSignedIn_ &&
+ !!this.getPref('profile.password_manager_leak_detection').value;
+ },
+
+ /**
* @param {string} filter
* @return {!Array<!PasswordManagerProxy.UiEntryWithPassword>}
* @private
@@ -314,6 +396,20 @@ Polymer({
},
/**
+ * @return {string}
+ * @private
+ */
+ getPasswordsLeakDetectionSubLabel_: function() {
+ if (this.userSignedIn_) {
+ return this.i18n('passwordsLeakDetectionSignedInDescription');
+ }
+ if (this.getPref('profile.password_manager_leak_detection').value) {
+ return this.i18n('passwordsLeakDetectionSignedOutEnabledDescription');
+ }
+ return this.i18n('passwordsLeakDetectionSignedOutDisabledDescription');
+ },
+
+ /**
* @param {string} filter
* @return {function(!chrome.passwordsPrivate.ExceptionEntry): boolean}
* @private
@@ -330,8 +426,7 @@ Polymer({
onMenuRemovePasswordTap_: function() {
this.passwordManager_.removeSavedPassword(
this.activePassword.item.entry.id);
- this.fire('iron-announce', {text: this.$.undoLabel.textContent});
- this.$.undoToast.show();
+ cr.toastManager.getInstance().show(this.i18n('passwordDeleted'), false);
/** @type {CrActionMenuElement} */ (this.$.menu).close();
},
@@ -344,7 +439,7 @@ Polymer({
const activeElement = getDeepActiveElement();
if (!activeElement || !isEditable(activeElement)) {
this.passwordManager_.undoRemoveSavedPasswordOrException();
- this.$.undoToast.hide();
+ cr.toastManager.getInstance().hide();
// Preventing the default is necessary to not conflict with a possible
// search action.
event.preventDefault();
@@ -353,7 +448,7 @@ Polymer({
onUndoButtonTap_: function() {
this.passwordManager_.undoRemoveSavedPasswordOrException();
- this.$.undoToast.hide();
+ cr.toastManager.getInstance().hide();
},
/**
* Fires an event that should delete the password exception.
@@ -376,7 +471,7 @@ Polymer({
this.activePassword =
/** @type {!PasswordListItemElement} */ (event.detail.listItem);
menu.showAt(target);
- this.activeDialogAnchor_ = target;
+ this.activeDialogAnchorStack_.push(target);
},
/**
@@ -389,7 +484,7 @@ Polymer({
/** @type {!HTMLElement} */ (this.$$('#exportImportMenuButton'));
menu.showAt(target);
- this.activeDialogAnchor_ = target;
+ this.activeDialogAnchorStack_.push(target);
},
/**
@@ -413,8 +508,7 @@ Polymer({
/** @private */
onPasswordsExportDialogClosed_: function() {
this.showPasswordsExportDialog_ = false;
- cr.ui.focusWithoutInk(assert(this.activeDialogAnchor_));
- this.activeDialogAnchor_ = null;
+ cr.ui.focusWithoutInk(assert(this.activeDialogAnchorStack_.pop()));
},
/**
diff --git a/chromium/chrome/browser/resources/settings/basic_page/BUILD.gn b/chromium/chrome/browser/resources/settings/basic_page/BUILD.gn
index 3680ef7085f..ab89a35dd33 100644
--- a/chromium/chrome/browser/resources/settings/basic_page/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/basic_page/BUILD.gn
@@ -18,6 +18,7 @@ js_library("basic_page") {
"../android_apps_page:android_apps_browser_proxy",
"../change_password_page:change_password_browser_proxy",
"../chrome_cleanup_page:chrome_cleanup_proxy",
+ "../prefs:prefs_behavior",
"../settings_page:main_page_behavior",
"//ui/webui/resources/js:load_time_data",
"//ui/webui/resources/js:web_ui_listener_behavior",
diff --git a/chromium/chrome/browser/resources/settings/basic_page/basic_page.html b/chromium/chrome/browser/resources/settings/basic_page/basic_page.html
index 80d61cd92c3..46deb873d7d 100644
--- a/chromium/chrome/browser/resources/settings/basic_page/basic_page.html
+++ b/chromium/chrome/browser/resources/settings/basic_page/basic_page.html
@@ -17,7 +17,7 @@
<link rel="import" href="../settings_page_css.html">
<if expr="chromeos">
-<link rel="import" href="../app_management_page/app_management_page.html">
+<link rel="import" href="chrome://resources/cr_elements/cr_icon_button/cr_icon_button.html">
<link rel="import" href="../android_apps_page/android_apps_browser_proxy.html">
<link rel="import" href="../android_apps_page/android_apps_page.html">
<link rel="import" href="../bluetooth_page/bluetooth_page.html">
@@ -26,6 +26,7 @@
<link rel="import" href="../device_page/device_page.html">
<link rel="import" href="../internet_page/internet_page.html">
<link rel="import" href="../multidevice_page/multidevice_page.html">
+<link rel="import" href="../prefs/prefs_behavior.html">
</if>
<if expr="not chromeos">
@@ -36,7 +37,7 @@
includes both the basic and advanced settings. -->
<dom-module id="settings-basic-page">
<template>
- <style include="settings-page-styles cr-hidden-style">
+ <style include="settings-page-styles cr-hidden-style settings-shared">
:host([is-subpage-animating]) {
/* Prevent an unwanted horizontal scrollbar when transitioning back from
* a sub-page. */
@@ -62,13 +63,14 @@
font-weight: 600;
}
+ #osSettingsBanner,
#secondaryUserBanner {
@apply --cr-card-elevation;
align-items: center;
background-color: white;
border-radius: 2px;
display: flex;
- margin: 21px 0;
+ margin-top: 21px;
}
#secondaryUserIcon {
@@ -85,11 +87,14 @@
#toggleContainer {
align-items: center;
+ color: var(--cr-primary-text-color);
display: flex;
font: inherit;
justify-content: center;
margin-bottom: 0;
margin-top: 0;
+ padding-bottom: 0;
+ padding-top: 0;
}
#toggleSpacer {
@@ -108,12 +113,22 @@
</settings-reset-profile-banner>
</template>
<if expr="chromeos">
+ <template is="dom-if" if="[[showOSSettingsBanner_]]">
+ <div id="osSettingsBanner" class="settings-box">
+ <div class="start" on-click="onOSSettingsBannerClick_">
+ $i18nRaw{osSettingsBannerText}
+ </div>
+ <cr-icon-button class="icon-clear"
+ id="hideOSSettings"
+ aria-label="$i18n{clear}"
+ on-click="onOSSettingsBannerClosed_">
+ </cr-icon-button>
+ </div>
+ </template>
<div id="secondaryUserBanner" hidden="[[!showSecondaryUserBanner_]]">
<div id="secondaryUserIcon"></div>
<div class="flex">$i18n{secondaryUserBannerText}</div>
</div>
-</if>
-<if expr="chromeos">
<template is="dom-if" if="[[showPage_(pageVisibility.internet)]]"
restamp>
<settings-section page-title="$i18n{internetPageTitle}"
@@ -180,21 +195,12 @@
</settings-section>
</template>
</if>
- <template is="dom-if" if="[[showPage_(pageVisibility.search)]]" restamp>
- <settings-section page-title="$i18n{searchPageTitle}"
- section="search">
- <settings-search-page prefs="{{prefs}}"></settings-search-page>
- </settings-section>
- </template>
+ <settings-section page-title="$i18n{searchPageTitle}"
+ section="search">
+ <settings-search-page prefs="{{prefs}}"></settings-search-page>
+ </settings-section>
<if expr="chromeos">
- <template is="dom-if" if="[[showApps]]" restamp>
- <settings-section page-title="$i18n{appsPageTitle}" section="apps">
- <settings-app-management-page>
- </settings-app-management-page>
- </settings-section>
- </template>
- <template is="dom-if" if="[[shouldCreateAndroidAppsSection_(
- showAndroidApps, pageVisibility)]]" restamp>
+ <template is="dom-if" if="[[showAndroidApps]]" restamp>
<settings-section page-title="$i18n{androidAppsPageTitle}"
section="androidApps" hidden$="[[!shouldShowAndroidAppsSection_(
androidAppsInfo)]]">
@@ -314,13 +320,10 @@
</settings-section>
</template>
<if expr="not chromeos">
- <template is="dom-if" if="[[showPage_(pageVisibility.system)]]"
- restamp>
- <settings-section page-title="$i18n{systemPageTitle}"
- section="system">
- <settings-system-page prefs="{{prefs}}"></settings-system-page>
- </settings-section>
- </template>
+ <settings-section page-title="$i18n{systemPageTitle}"
+ section="system">
+ <settings-system-page prefs="{{prefs}}"></settings-system-page>
+ </settings-section>
</if>
<template is="dom-if" if="[[showPage_(pageVisibility.reset)]]"
restamp>
diff --git a/chromium/chrome/browser/resources/settings/basic_page/basic_page.js b/chromium/chrome/browser/resources/settings/basic_page/basic_page.js
index 53f94adc713..f2f0131a77c 100644
--- a/chromium/chrome/browser/resources/settings/basic_page/basic_page.js
+++ b/chromium/chrome/browser/resources/settings/basic_page/basic_page.js
@@ -6,12 +6,33 @@
* @fileoverview
* 'settings-basic-page' is the settings page containing the actual settings.
*/
+(function() {
+'use strict';
+
+// <if expr="chromeos">
+const OS_BANNER_INTERACTION_METRIC_NAME =
+ 'ChromeOS.Settings.OsBannerInteraction';
+
+/**
+ * These values are persisted to logs and should not be renumbered or re-used.
+ * See tools/metrics/histograms/enums.xml.
+ * @enum {number}
+ */
+const CrosSettingsOsBannerInteraction = {
+ NotShown: 0,
+ Shown: 1,
+ Clicked: 2,
+ Closed: 3,
+};
+// </if>
+
Polymer({
is: 'settings-basic-page',
behaviors: [
settings.MainPageBehavior,
settings.RouteObserverBehavior,
+ PrefsBehavior,
WebUIListenerBehavior,
],
@@ -23,8 +44,6 @@ Polymer({
},
// <if expr="chromeos">
- showApps: Boolean,
-
showAndroidApps: Boolean,
showCrostini: Boolean,
@@ -91,6 +110,13 @@ Polymer({
type: Boolean,
computed: 'computeShowSecondaryUserBanner_(hasExpandedSection_)',
},
+
+ /** @private */
+ showOSSettingsBanner_: {
+ type: Boolean,
+ computed: 'computeShowOSSettingsBanner_(' +
+ 'prefs.settings.cros.show_os_banner.value, currentRoute_)',
+ },
// </if>
/** @private {!settings.Route|undefined} */
@@ -111,6 +137,11 @@ Polymer({
*/
advancedTogglingInProgress_: false,
+ // <if expr="chromeos">
+ /** @private {boolean} */
+ osBannerShowMetricRecorded_: false,
+ // </if>
+
/** @override */
attached: function() {
this.currentRoute_ = settings.getCurrentRoute();
@@ -220,6 +251,58 @@ Polymer({
return !this.hasExpandedSection_ &&
loadTimeData.getBoolean('isSecondaryUser');
},
+
+ /**
+ * @return {boolean|undefined}
+ * @private
+ */
+ computeShowOSSettingsBanner_: function() {
+ // this.prefs is implicitly used by this.getPref() below.
+ if (!this.prefs || !this.currentRoute_) {
+ return;
+ }
+ // Don't show the banner when SplitSettings is disabled (and hence this page
+ // is already showing OS settings).
+ if (loadTimeData.getBoolean('showOSSettings')) {
+ return false;
+ }
+ const showPref = /** @type {boolean} */ (
+ this.getPref('settings.cros.show_os_banner').value);
+
+ // Banner only shows on the main page because direct navigations to a
+ // sub-page are unlikely to be due to a user looking for an OS setting.
+ const show = showPref && !this.currentRoute_.isSubpage();
+
+ // Record the show metric once. We can't record the metric in attached()
+ // because prefs might not be ready yet.
+ if (!this.osBannerShowMetricRecorded_) {
+ chrome.metricsPrivate.recordEnumerationValue(
+ OS_BANNER_INTERACTION_METRIC_NAME,
+ show ? CrosSettingsOsBannerInteraction.Shown :
+ CrosSettingsOsBannerInteraction.NotShown,
+ Object.keys(CrosSettingsOsBannerInteraction).length);
+ this.osBannerShowMetricRecorded_ = true;
+ }
+ return show;
+ },
+
+ /** @private */
+ onOSSettingsBannerClick_: function() {
+ // The label has a link that opens the page, so just record the metric.
+ chrome.metricsPrivate.recordEnumerationValue(
+ OS_BANNER_INTERACTION_METRIC_NAME,
+ CrosSettingsOsBannerInteraction.Clicked,
+ Object.keys(CrosSettingsOsBannerInteraction).length);
+ },
+
+ /** @private */
+ onOSSettingsBannerClosed_: function() {
+ this.setPrefValue('settings.cros.show_os_banner', false);
+ chrome.metricsPrivate.recordEnumerationValue(
+ OS_BANNER_INTERACTION_METRIC_NAME,
+ CrosSettingsOsBannerInteraction.Closed,
+ Object.keys(CrosSettingsOsBannerInteraction).length);
+ },
// </if>
/** @private */
@@ -236,18 +319,6 @@ Polymer({
},
/**
- * Returns true in case Android apps settings needs to be created. It is not
- * created in case ARC++ is not allowed for the current profile.
- * @return {boolean}
- * @private
- */
- shouldCreateAndroidAppsSection_: function() {
- const visibility = /** @type {boolean|undefined} */ (
- this.get('pageVisibility.androidApps'));
- return this.showAndroidApps && this.showPage_(visibility);
- },
-
- /**
* Returns true in case Android apps settings should be shown. It is not
* shown in case we don't have the Play Store app and settings app is not
* yet available.
@@ -382,3 +453,4 @@ Polymer({
return bool.toString();
},
});
+})();
diff --git a/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.html b/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.html
index bf85b1f8556..739b1b7b29b 100644
--- a/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.html
+++ b/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.html
@@ -5,6 +5,7 @@
<link rel="import" href="chrome://resources/cr_elements/icons.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
+<link rel="import" href="../chromeos/os_icons.html">
<link rel="import" href="../icons.html">
<link rel="import" href="../settings_shared_css.html">
diff --git a/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.js b/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.js
index ead6fe1075e..9ed885e2782 100644
--- a/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.js
+++ b/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.js
@@ -132,24 +132,24 @@ Polymer({
case 'computer':
return 'cr:computer';
case 'phone':
- return 'settings:smartphone';
+ return 'os-settings:smartphone';
case 'audio':
case 'carAudio':
- return 'settings:headset';
+ return 'os-settings:headset';
case 'video':
return 'cr:videocam';
case 'joystick':
case 'gamepad':
- return 'settings:gamepad';
+ return 'os-settings:gamepad';
case 'keyboard':
case 'keyboardMouseCombo':
- return 'settings:keyboard';
+ return 'os-settings:keyboard';
case 'tablet':
- return 'settings:tablet';
+ return 'os-settings:tablet';
case 'mouse':
- return 'settings:mouse';
+ return 'os-settings:mouse';
default:
- return device.connected ? 'settings:bluetooth-connected' :
+ return device.connected ? 'os-settings:bluetooth-connected' :
'cr:bluetooth';
}
},
diff --git a/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.html b/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.html
index 81f28b1245d..44dac770e3e 100644
--- a/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.html
+++ b/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.html
@@ -5,8 +5,8 @@
<link rel="import" href="chrome://resources/cr_elements/icons.html">
<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_indicator.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
+<link rel="import" href="../chromeos/os_icons.html">
<link rel="import" href="../i18n_setup.html">
-<link rel="import" href="../icons.html">
<link rel="import" href="../prefs/prefs.html">
<link rel="import" href="../prefs/prefs_behavior.html">
<link rel="import" href="../settings_page/settings_animated_pages.html">
diff --git a/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js b/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js
index b84118487a0..fd9aabbdf7f 100644
--- a/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js
+++ b/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js
@@ -172,7 +172,7 @@ Polymer({
// Don't use |this.bluetoothToggleState_| here, since it has not been
// updated yet to the latest value.
if (!bluetoothToggleState) {
- return 'settings:bluetooth-disabled';
+ return 'os-settings:bluetooth-disabled';
}
return 'cr:bluetooth';
},
diff --git a/chromium/chrome/browser/resources/settings/chromeos/BUILD.gn b/chromium/chrome/browser/resources/settings/chromeos/BUILD.gn
index e2642b28c73..37366df42de 100644
--- a/chromium/chrome/browser/resources/settings/chromeos/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/chromeos/BUILD.gn
@@ -28,6 +28,13 @@ if (optimize_webui) {
"crisper.js",
"lazy_load.crisper.js",
]
+ excludes = [
+ "chrome://os-settings/app-management/app_management.mojom-lite.js",
+ "chrome://os-settings/app-management/bitmap.mojom-lite.js",
+ "chrome://os-settings/app-management/image_info.mojom-lite.js",
+ "chrome://os-settings/app-management/image.mojom-lite.js",
+ "chrome://os-settings/app-management/types.mojom-lite.js",
+ ]
deps = [
":unpak",
@@ -63,6 +70,7 @@ if (optimize_webui) {
group("closure_compile") {
deps = [
"os_a11y_page:closure_compile",
+ "os_apps_page:closure_compile",
"os_files_page:closure_compile",
"os_languages_page:closure_compile",
"os_people_page:closure_compile",
diff --git a/chromium/chrome/browser/resources/settings/app_management_page/BUILD.gn b/chromium/chrome/browser/resources/settings/chromeos/os_apps_page/BUILD.gn
index d404c63c107..b54af0ac04f 100644
--- a/chromium/chrome/browser/resources/settings/app_management_page/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/chromeos/os_apps_page/BUILD.gn
@@ -6,13 +6,16 @@ import("//third_party/closure_compiler/compile_js.gni")
js_type_check("closure_compile") {
deps = [
- ":app_management_page",
+ ":os_apps_page",
]
}
-js_library("app_management_page") {
+js_library("os_apps_page") {
deps = [
- "..:open_window_proxy",
+ "../../:route",
+ "../../settings_page:settings_animated_pages",
+ "app_management_page",
]
+
externs_list = [ "$externs_path/metrics_private.js" ]
}
diff --git a/chromium/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/BUILD.gn b/chromium/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/BUILD.gn
new file mode 100644
index 00000000000..c9841d1a9d7
--- /dev/null
+++ b/chromium/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/BUILD.gn
@@ -0,0 +1,230 @@
+# Copyright 2019 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//third_party/closure_compiler/compile_js.gni")
+
+js_type_check("closure_compile") {
+ deps = [
+ ":actions",
+ ":api_listener",
+ ":app_item",
+ ":app_management_page",
+ ":app_permission_view",
+ ":arc_permission_view",
+ ":browser_proxy",
+ ":chrome_app_permission_view",
+ ":constants",
+ ":dom_switch",
+ ":fake_page_handler",
+ ":main_view",
+ ":permission_item",
+ ":permission_toggle",
+ ":pin_to_shelf_item",
+ ":pwa_permission_view",
+ ":reducers",
+ ":router",
+ ":store",
+ ":store_client",
+ ":toggle_row",
+ ":types",
+ ":uninstall_button",
+ ":util",
+ ]
+}
+
+js_library("actions") {
+ deps = [
+ "//chrome/browser/ui/webui/app_management:mojo_bindings_js_library_for_compile",
+ "//ui/webui/resources/js:cr",
+ ]
+}
+
+js_library("api_listener") {
+ deps = [
+ ":actions",
+ ":store",
+ ":util",
+ "//ui/webui/resources/js:cr",
+ ]
+}
+
+js_library("app_item") {
+ deps = [
+ ":actions",
+ ":store_client",
+ "//ui/webui/resources/js:load_time_data",
+ ]
+}
+
+js_library("app_management_page") {
+ deps = [
+ ":actions",
+ ":browser_proxy",
+ ":main_view",
+ ":router",
+ ":store",
+ ":store_client",
+ ]
+}
+
+js_library("app_permission_view") {
+ deps = [
+ ":arc_permission_view",
+ ":chrome_app_permission_view",
+ ":dom_switch",
+ ":pwa_permission_view",
+ ":store_client",
+ ]
+}
+
+js_library("arc_permission_view") {
+ deps = [
+ ":constants",
+ ":fake_page_handler",
+ ":permission_item",
+ ":pin_to_shelf_item",
+ ":store_client",
+ ]
+}
+
+js_library("browser_proxy") {
+ deps = [
+ ":fake_page_handler",
+ "//chrome/browser/ui/webui/app_management:mojo_bindings_js_library_for_compile",
+ "//ui/webui/resources/js:cr",
+ ]
+}
+
+js_library("chrome_app_permission_view") {
+ deps = [
+ ":fake_page_handler",
+ ":pin_to_shelf_item",
+ ":store_client",
+ ]
+}
+
+js_library("constants") {
+}
+
+js_library("dom_switch") {
+}
+
+js_library("fake_page_handler") {
+ deps = [
+ ":constants",
+ ":types",
+ ":util",
+ "//chrome/browser/ui/webui/app_management:mojo_bindings_js_library_for_compile",
+ "//ui/webui/resources/js:cr",
+ ]
+}
+
+js_library("main_view") {
+ deps = [
+ ":app_item",
+ ":browser_proxy",
+ ":constants",
+ ":store_client",
+ "//ui/webui/resources/js:load_time_data",
+ ]
+}
+
+js_library("permission_item") {
+ deps = [
+ ":fake_page_handler",
+ ":permission_toggle",
+ ":store_client",
+ ":util",
+ ]
+}
+
+js_library("permission_toggle") {
+ deps = [
+ ":util",
+ ]
+}
+
+js_library("pin_to_shelf_item") {
+ deps = [
+ ":browser_proxy",
+ ":toggle_row",
+ ":types",
+ ]
+}
+
+js_library("pwa_permission_view") {
+ deps = [
+ ":constants",
+ ":fake_page_handler",
+ ":permission_item",
+ ":pin_to_shelf_item",
+ ":store_client",
+ ]
+}
+
+js_library("reducers") {
+ deps = [
+ ":types",
+ ":util",
+ "//ui/webui/resources/js:cr",
+ ]
+}
+
+js_library("router") {
+ deps = [
+ ":actions",
+ ":constants",
+ ":store_client",
+ ]
+}
+
+js_library("store") {
+ deps = [
+ ":reducers",
+ ":util",
+ "//ui/webui/resources/js:cr",
+ "//ui/webui/resources/js/cr/ui:store",
+ ]
+}
+
+js_library("store_client") {
+ deps = [
+ ":store",
+ ":types",
+ "//ui/webui/resources/js:cr",
+ "//ui/webui/resources/js/cr/ui:store",
+ "//ui/webui/resources/js/cr/ui:store_client",
+ ]
+}
+
+js_library("toggle_row") {
+ deps = [
+ ":types",
+ "//ui/webui/resources/cr_elements/cr_toggle:cr_toggle",
+ "//ui/webui/resources/cr_elements/policy:cr_policy_indicator",
+ ]
+}
+
+js_library("types") {
+ deps = [
+ "//chrome/browser/ui/webui/app_management:mojo_bindings_js_library_for_compile",
+ ]
+}
+
+js_library("uninstall_button") {
+ deps = [
+ ":store_client",
+ ":util",
+ "//ui/webui/resources/cr_elements/cr_button:cr_button",
+ "//ui/webui/resources/cr_elements/policy:cr_tooltip_icon",
+ ]
+}
+
+js_library("util") {
+ deps = [
+ ":constants",
+ ":types",
+ "//ui/webui/resources/js:cr",
+ ]
+}
diff --git a/chromium/chrome/browser/resources/settings/chromeos/os_files_page/BUILD.gn b/chromium/chrome/browser/resources/settings/chromeos/os_files_page/BUILD.gn
index a1b5d3d633d..38ac772a9b0 100644
--- a/chromium/chrome/browser/resources/settings/chromeos/os_files_page/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/chromeos/os_files_page/BUILD.gn
@@ -20,7 +20,6 @@ js_library("smb_shares_page") {
js_library("os_files_page") {
deps = [
- "../..:page_visibility",
"../..:route",
]
}
diff --git a/chromium/chrome/browser/resources/settings/chromeos/os_reset_page/BUILD.gn b/chromium/chrome/browser/resources/settings/chromeos/os_reset_page/BUILD.gn
index 85fc4d825ac..42ff0d047c9 100644
--- a/chromium/chrome/browser/resources/settings/chromeos/os_reset_page/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/chromeos/os_reset_page/BUILD.gn
@@ -7,28 +7,27 @@ import("//third_party/closure_compiler/compile_js.gni")
js_type_check("closure_compile") {
deps = [
":os_powerwash_dialog",
+ ":os_reset_browser_proxy",
":os_reset_page",
- ":reset_os_proxy",
]
}
js_library("os_powerwash_dialog") {
deps = [
- ":reset_os_proxy",
+ ":os_reset_browser_proxy",
"../..:lifetime_browser_proxy",
]
}
js_library("os_reset_page") {
deps = [
- "../..:page_visibility",
"//ui/webui/resources/js:assert",
"//ui/webui/resources/js:cr",
"//ui/webui/resources/js/cr/ui:focus_without_ink",
]
}
-js_library("reset_os_proxy") {
+js_library("os_reset_browser_proxy") {
deps = [
"//ui/webui/resources/js:cr",
]
diff --git a/chromium/chrome/browser/resources/settings/chromeos/os_settings_menu/BUILD.gn b/chromium/chrome/browser/resources/settings/chromeos/os_settings_menu/BUILD.gn
index 397f4d3e434..3c3c14e9d3d 100644
--- a/chromium/chrome/browser/resources/settings/chromeos/os_settings_menu/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/chromeos/os_settings_menu/BUILD.gn
@@ -12,7 +12,6 @@ js_type_check("closure_compile") {
js_library("os_settings_menu") {
deps = [
- "../..:page_visibility",
"../..:route",
"//third_party/polymer/v1_0/components-chromium/iron-collapse:iron-collapse-extracted",
"//third_party/polymer/v1_0/components-chromium/paper-ripple:paper-ripple-extracted",
diff --git a/chromium/chrome/browser/resources/settings/chromeos/os_settings_page/BUILD.gn b/chromium/chrome/browser/resources/settings/chromeos/os_settings_page/BUILD.gn
index e34d80d6362..11525a13645 100644
--- a/chromium/chrome/browser/resources/settings/chromeos/os_settings_page/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/chromeos/os_settings_page/BUILD.gn
@@ -17,6 +17,7 @@ js_library("os_settings_page") {
"../..:search_settings",
"../../android_apps_page:android_apps_browser_proxy",
"../../chrome_cleanup_page:chrome_cleanup_proxy",
+ "../../prefs:prefs_behavior",
"../../settings_page:main_page_behavior",
"//ui/webui/resources/js:load_time_data",
"//ui/webui/resources/js:web_ui_listener_behavior",
diff --git a/chromium/chrome/browser/resources/settings/chromeos/os_settings_ui/BUILD.gn b/chromium/chrome/browser/resources/settings/chromeos/os_settings_ui/BUILD.gn
index b098e77ce26..058863d4b69 100644
--- a/chromium/chrome/browser/resources/settings/chromeos/os_settings_ui/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/chromeos/os_settings_ui/BUILD.gn
@@ -16,10 +16,10 @@ js_library("os_settings_ui") {
"../..:page_visibility",
"../../prefs",
"../os_settings_main:os_settings_main",
+ "../os_toolbar",
"//ui/webui/resources/cr_elements:cr_container_shadow_behavior",
"//ui/webui/resources/cr_elements/chromeos/network:cr_onc_types",
"//ui/webui/resources/cr_elements/cr_drawer:cr_drawer",
- "//ui/webui/resources/cr_elements/cr_toolbar:cr_toolbar",
"//ui/webui/resources/cr_elements/cr_toolbar:cr_toolbar_search_field",
"//ui/webui/resources/cr_elements/policy:cr_policy_indicator_behavior",
"//ui/webui/resources/js:find_shortcut_behavior",
diff --git a/chromium/chrome/browser/resources/settings/chromeos/os_toolbar/BUILD.gn b/chromium/chrome/browser/resources/settings/chromeos/os_toolbar/BUILD.gn
new file mode 100644
index 00000000000..3ac49b91c8f
--- /dev/null
+++ b/chromium/chrome/browser/resources/settings/chromeos/os_toolbar/BUILD.gn
@@ -0,0 +1,18 @@
+# Copyright 2019 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//third_party/closure_compiler/compile_js.gni")
+
+js_type_check("closure_compile") {
+ deps = [
+ ":os_toolbar",
+ ]
+}
+
+js_library("os_toolbar") {
+ deps = [
+ "//ui/webui/resources/cr_elements/cr_toolbar:cr_toolbar_search_field",
+ ]
+ externs_list = [ "$externs_path/web_animations.js" ]
+}
diff --git a/chromium/chrome/browser/resources/settings/chromeos/personalization_page/BUILD.gn b/chromium/chrome/browser/resources/settings/chromeos/personalization_page/BUILD.gn
index 7e68a1627b6..ca1cedfb81c 100644
--- a/chromium/chrome/browser/resources/settings/chromeos/personalization_page/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/chromeos/personalization_page/BUILD.gn
@@ -6,21 +6,13 @@ import("//third_party/closure_compiler/compile_js.gni")
js_type_check("closure_compile") {
deps = [
- ":personalization_browser_proxy",
":personalization_page",
]
}
-js_library("personalization_browser_proxy") {
- deps = [
- "//ui/webui/resources/js:cr",
- ]
- externs_list = [ "$externs_path/chrome_send.js" ]
-}
-
js_library("personalization_page") {
deps = [
- ":personalization_browser_proxy",
+ "../../appearance_page:wallpaper_browser_proxy",
"../../settings_page:settings_animated_pages",
"//ui/webui/resources/js:cr",
]
diff --git a/chromium/chrome/browser/resources/settings/controls/password_prompt_dialog.html b/chromium/chrome/browser/resources/settings/controls/password_prompt_dialog.html
index d58fdddf3d8..4a0026ee454 100644
--- a/chromium/chrome/browser/resources/settings/controls/password_prompt_dialog.html
+++ b/chromium/chrome/browser/resources/settings/controls/password_prompt_dialog.html
@@ -8,19 +8,18 @@
<dom-module id="settings-password-prompt-dialog">
<template>
<style include="settings-shared">
- #passwordInput {
- display: inline-block;
+ cr-dialog::part(dialog) {
+ width: 320px;
}
- .settings-box {
+ #passwordPrompt {
padding: 0;
}
</style>
-
<cr-dialog id="dialog" close-text="$i18n{close}">
<div slot="title">$i18n{passwordPromptTitle}</div>
<div slot="body">
- <div class="settings-box first">
+ <div id="passwordPrompt" class="settings-box first line-only">
[[passwordPromptText]]
</div>
<cr-input id="passwordInput" type="password"
diff --git a/chromium/chrome/browser/resources/settings/controls/pref_control_behavior.js b/chromium/chrome/browser/resources/settings/controls/pref_control_behavior.js
index 51bbe0199f2..8db2d75dc99 100644
--- a/chromium/chrome/browser/resources/settings/controls/pref_control_behavior.js
+++ b/chromium/chrome/browser/resources/settings/controls/pref_control_behavior.js
@@ -37,6 +37,10 @@ const PrefControlBehavior = {
}
error += ' in ' + this.domHost.tagName;
console.error(error);
+ } else if (
+ this.pref.enforcement ==
+ chrome.settingsPrivate.Enforcement.PARENT_SUPERVISED) {
+ console.error('PARENT_SUPERVISED is not enforced by pref controls');
}
});
},
diff --git a/chromium/chrome/browser/resources/settings/crostini_page/BUILD.gn b/chromium/chrome/browser/resources/settings/crostini_page/BUILD.gn
index db0a920aee3..2e4035eae4a 100644
--- a/chromium/chrome/browser/resources/settings/crostini_page/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/crostini_page/BUILD.gn
@@ -24,6 +24,7 @@ js_library("crostini_browser_proxy") {
js_library("crostini_export_import") {
deps = [
":crostini_browser_proxy",
+ "//ui/webui/resources/js:web_ui_listener_behavior",
]
}
diff --git a/chromium/chrome/browser/resources/settings/crostini_page/crostini_browser_proxy.js b/chromium/chrome/browser/resources/settings/crostini_page/crostini_browser_proxy.js
index 225da323ed6..f9b965ea621 100644
--- a/chromium/chrome/browser/resources/settings/crostini_page/crostini_browser_proxy.js
+++ b/chromium/chrome/browser/resources/settings/crostini_page/crostini_browser_proxy.js
@@ -51,14 +51,26 @@ cr.define('settings', function() {
*/
removeCrostiniSharedPath(vmName, path) {}
- /* Request chrome send a crostini-installer-status-changed event with the
- current installer status */
+ /**
+ * Request chrome send a crostini-installer-status-changed event with the
+ * current installer status
+ */
requestCrostiniInstallerStatus() {}
- /* Export crostini container. */
+ /**
+ * Request chrome send a crostini-export-import-operation-status-changed
+ * event with the current operation status
+ */
+ requestCrostiniExportImportOperationStatus() {}
+
+ /**
+ * Export crostini container.
+ */
exportCrostiniContainer() {}
- /* Import crostini container. */
+ /**
+ * Import crostini container.
+ */
importCrostiniContainer() {}
}
@@ -100,6 +112,11 @@ cr.define('settings', function() {
}
/** @override */
+ requestCrostiniExportImportOperationStatus() {
+ chrome.send('requestCrostiniExportImportOperationStatus');
+ }
+
+ /** @override */
exportCrostiniContainer() {
chrome.send('exportCrostiniContainer');
}
diff --git a/chromium/chrome/browser/resources/settings/crostini_page/crostini_export_import.html b/chromium/chrome/browser/resources/settings/crostini_page/crostini_export_import.html
index 88989b88f9c..43c4d73d8da 100644
--- a/chromium/chrome/browser/resources/settings/crostini_page/crostini_export_import.html
+++ b/chromium/chrome/browser/resources/settings/crostini_page/crostini_export_import.html
@@ -2,6 +2,7 @@
<link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
+<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
<link rel="import" href="crostini_browser_proxy.html">
<link rel="import" href="crostini_import_confirmation_dialog.html">
<link rel="import" href="../i18n_setup.html">
@@ -15,18 +16,18 @@
<div id="exportCrostiniLabel" class="start secondary">
$i18n{crostiniExportLabel}
</div>
- <cr-button on-click="onExportClick_"
- aria-labelledby="exportCrostiniLabel">
- $i18n{crostiniExport}
+ <cr-button on-click="onExportClick_" disabled="[[!enableButtons_]]"
+ aria-labelledby="exportCrostiniLabel">
+ $i18n{crostiniExport}
</cr-button>
</div>
<div id="import" class="list-item">
<div id="importCrostiniLabel" class="start secondary">
$i18n{crostiniImportLabel}
</div>
- <cr-button on-click="onImportClick_"
- aria-labelledby="importCrostiniLabel">
- $i18n{crostiniImport}
+ <cr-button on-click="onImportClick_" disabled="[[!enableButtons_]]"
+ aria-labelledby="importCrostiniLabel">
+ $i18n{crostiniImport}
</cr-button>
</div>
</div>
diff --git a/chromium/chrome/browser/resources/settings/crostini_page/crostini_export_import.js b/chromium/chrome/browser/resources/settings/crostini_page/crostini_export_import.js
index fa1be63a919..1cb7d34abc2 100644
--- a/chromium/chrome/browser/resources/settings/crostini_page/crostini_export_import.js
+++ b/chromium/chrome/browser/resources/settings/crostini_page/crostini_export_import.js
@@ -11,12 +11,33 @@
Polymer({
is: 'settings-crostini-export-import',
+ behaviors: [WebUIListenerBehavior],
+
properties: {
/** @private */
showImportConfirmationDialog_: {
type: Boolean,
value: false,
},
+
+ /**
+ * Whether the export import buttons should be enabled. Initially false
+ * until status has been confirmed.
+ * @private {boolean}
+ */
+ enableButtons_: {
+ type: Boolean,
+ value: false,
+ },
+ },
+
+ attached: function() {
+ this.addWebUIListener(
+ 'crostini-export-import-operation-status-changed', inProgress => {
+ this.enableButtons_ = !inProgress;
+ });
+ settings.CrostiniBrowserProxyImpl.getInstance()
+ .requestCrostiniExportImportOperationStatus();
},
/** @private */
diff --git a/chromium/chrome/browser/resources/settings/crostini_page/crostini_page.html b/chromium/chrome/browser/resources/settings/crostini_page/crostini_page.html
index 1949eb2f98f..d241d5baf3a 100644
--- a/chromium/chrome/browser/resources/settings/crostini_page/crostini_page.html
+++ b/chromium/chrome/browser/resources/settings/crostini_page/crostini_page.html
@@ -43,7 +43,7 @@
<template is="dom-if" if="[[!prefs.crostini.enabled.value]]">
<div class="separator"></div>
<cr-button id="enable"
- disabled="[[!allowCrostini]]"
+ disabled$="[[disableCrostiniInstall_]]"
on-click="onEnableTap_"
aria-label="$i18n{crostiniPageTitle}"
aria-describedby="secondaryText">
diff --git a/chromium/chrome/browser/resources/settings/crostini_page/crostini_page.js b/chromium/chrome/browser/resources/settings/crostini_page/crostini_page.js
index 1f2b08a13e9..7a74d5b5fbd 100644
--- a/chromium/chrome/browser/resources/settings/crostini_page/crostini_page.js
+++ b/chromium/chrome/browser/resources/settings/crostini_page/crostini_page.js
@@ -12,7 +12,7 @@
Polymer({
is: 'settings-crostini-page',
- behaviors: [I18nBehavior, PrefsBehavior],
+ behaviors: [I18nBehavior, PrefsBehavior, WebUIListenerBehavior],
properties: {
/** Preferences state. */
@@ -49,6 +49,27 @@ Polymer({
return map;
},
},
+
+ /**
+ * Whether the install option should be enabled.
+ * @private {boolean}
+ */
+ disableCrostiniInstall_: {
+ type: Boolean,
+ },
+ },
+
+ attached: function() {
+ if (!loadTimeData.getBoolean('allowCrostini')) {
+ this.disableCrostiniInstall_ = true;
+ return;
+ }
+ this.addWebUIListener(
+ 'crostini-installer-status-changed', (installerShowing) => {
+ this.disableCrostiniInstall_ = installerShowing;
+ });
+ settings.CrostiniBrowserProxyImpl.getInstance()
+ .requestCrostiniInstallerStatus();
},
/**
diff --git a/chromium/chrome/browser/resources/settings/crostini_page/crostini_subpage.html b/chromium/chrome/browser/resources/settings/crostini_page/crostini_subpage.html
index 125be381c77..c77f6161ec1 100644
--- a/chromium/chrome/browser/resources/settings/crostini_page/crostini_subpage.html
+++ b/chromium/chrome/browser/resources/settings/crostini_page/crostini_subpage.html
@@ -17,14 +17,12 @@
label="$i18n{crostiniSharedPaths}"
on-click="onSharedPathsClick_">
</cr-link-row>
- <template is="dom-if" if="[[enableCrostiniUsbDeviceSupport_]]">
- <cr-link-row
- class="hr"
- label="$i18n{crostiniSharedUsbDevicesLabel}"
- id="crostini-shared-usb-devices"
- on-click="onSharedUsbDevicesClick_">
- </cr-link-row>
- </template>
+ <cr-link-row
+ class="hr"
+ label="$i18n{crostiniSharedUsbDevicesLabel}"
+ id="crostini-shared-usb-devices"
+ on-click="onSharedUsbDevicesClick_">
+ </cr-link-row>
<template is="dom-if" if="[[showCrostiniExportImport_]]">
<cr-link-row
class="hr"
diff --git a/chromium/chrome/browser/resources/settings/crostini_page/crostini_subpage.js b/chromium/chrome/browser/resources/settings/crostini_page/crostini_subpage.js
index 736b8a86e4b..66d8ca13fce 100644
--- a/chromium/chrome/browser/resources/settings/crostini_page/crostini_subpage.js
+++ b/chromium/chrome/browser/resources/settings/crostini_page/crostini_subpage.js
@@ -20,17 +20,6 @@ Polymer({
},
/**
- * Whether CrostiniUsbSupport flag is enabled.
- * @private {boolean}
- */
- enableCrostiniUsbDeviceSupport_: {
- type: Boolean,
- value: function() {
- return loadTimeData.getBoolean('enableCrostiniUsbDeviceSupport');
- },
- },
-
- /**
* Whether export / import UI should be displayed.
* @private {boolean}
*/
diff --git a/chromium/chrome/browser/resources/settings/date_time_page/date_time_page.html b/chromium/chrome/browser/resources/settings/date_time_page/date_time_page.html
index 735549d7721..1575327101d 100644
--- a/chromium/chrome/browser/resources/settings/date_time_page/date_time_page.html
+++ b/chromium/chrome/browser/resources/settings/date_time_page/date_time_page.html
@@ -65,7 +65,11 @@
</settings-toggle-button>
<cr-link-row class="hr" id="setDateTime"
on-click="onSetDateTimeTap_" hidden$="[[!canSetDateTime_]]"
- label="$i18n{setDateTime}"></cr-link-row>
+ label="$i18n{setDateTime}">
+ <template is="dom-if" if="[[displayManagedByParentIcon_]]">
+ <cr-policy-indicator indicator-type="parent"></cr-policy-indicator>
+ </template>
+ </cr-link-row>
</div>
<template is="dom-if" route-path="/dateTime/timeZone">
<settings-subpage data-route="DATETIME_TIMEZONE_SUBPAGE"
diff --git a/chromium/chrome/browser/resources/settings/date_time_page/date_time_page.js b/chromium/chrome/browser/resources/settings/date_time_page/date_time_page.js
index 186c536e121..f5f8a8f3761 100644
--- a/chromium/chrome/browser/resources/settings/date_time_page/date_time_page.js
+++ b/chromium/chrome/browser/resources/settings/date_time_page/date_time_page.js
@@ -58,6 +58,17 @@ Polymer({
/** @private */
isChild_: {type: Boolean, value: loadTimeData.getBoolean('isChild')},
+
+ /**
+ * Whether the icon informing that this action is managed by a parent is
+ * displayed.
+ * @private
+ */
+ displayManagedByParentIcon_: {
+ type: Boolean,
+ value: loadTimeData.getBoolean('isChild') &&
+ loadTimeData.getBoolean('timeActionsProtectedForChild')
+ },
},
/** @override */
diff --git a/chromium/chrome/browser/resources/settings/date_time_page/timezone_subpage.html b/chromium/chrome/browser/resources/settings/date_time_page/timezone_subpage.html
index 2ae2ba3226e..2ee6c254ec8 100644
--- a/chromium/chrome/browser/resources/settings/date_time_page/timezone_subpage.html
+++ b/chromium/chrome/browser/resources/settings/date_time_page/timezone_subpage.html
@@ -36,7 +36,7 @@
<settings-dropdown-menu id="timeZoneResolveMethodDropdown"
pref="{{prefs.generated.resolve_timezone_by_geolocation_method_short}}"
label="$i18n{selectTimeZoneResolveMethod}"
- hidden="[[!prefs.generated.resolve_timezone_by_geolocation_on_off.value]]"
+ disabled="[[!prefs.generated.resolve_timezone_by_geolocation_on_off.value]]"
menu-options="[[getTimeZoneResolveMethodsList_(
prefs.generated.resolve_timezone_by_geolocation_method_short)]]">
</settings-dropdown-menu>
diff --git a/chromium/chrome/browser/resources/settings/date_time_page/timezone_subpage.js b/chromium/chrome/browser/resources/settings/date_time_page/timezone_subpage.js
index f77b53e820c..3e29c0d9f05 100644
--- a/chromium/chrome/browser/resources/settings/date_time_page/timezone_subpage.js
+++ b/chromium/chrome/browser/resources/settings/date_time_page/timezone_subpage.js
@@ -27,22 +27,26 @@ Polymer({
*/
getTimeZoneResolveMethodsList_: function() {
const result = [];
+ const pref =
+ this.getPref('generated.resolve_timezone_by_geolocation_method_short');
// Make sure current value is in the list, even if it is not
// user-selectable.
- if (this.getPref('generated.resolve_timezone_by_geolocation_method_short')
- .value == settings.TimeZoneAutoDetectMethod.DISABLED) {
- result.push({
- value: settings.TimeZoneAutoDetectMethod.DISABLED,
- name: loadTimeData.getString('setTimeZoneAutomaticallyDisabled')
- });
+ if (pref.value == settings.TimeZoneAutoDetectMethod.DISABLED) {
+ // If disabled by policy, show the 'Automatic timezone disabled' label.
+ // Otherwise, just show the default string, since the control will be
+ // disabled as well.
+ const label = pref.controlledBy ?
+ loadTimeData.getString('setTimeZoneAutomaticallyDisabled') :
+ loadTimeData.getString('setTimeZoneAutomaticallyIpOnlyDefault');
+ result.push(
+ {value: settings.TimeZoneAutoDetectMethod.DISABLED, name: label});
}
result.push({
value: settings.TimeZoneAutoDetectMethod.IP_ONLY,
name: loadTimeData.getString('setTimeZoneAutomaticallyIpOnlyDefault')
});
- if (this.getPref('generated.resolve_timezone_by_geolocation_method_short')
- .value ==
+ if (pref.value ==
settings.TimeZoneAutoDetectMethod.SEND_WIFI_ACCESS_POINTS) {
result.push({
value: settings.TimeZoneAutoDetectMethod.SEND_WIFI_ACCESS_POINTS,
diff --git a/chromium/chrome/browser/resources/settings/device_page/device_page.html b/chromium/chrome/browser/resources/settings/device_page/device_page.html
index 1f22b1fe3e7..8eacafb0ba7 100644
--- a/chromium/chrome/browser/resources/settings/device_page/device_page.html
+++ b/chromium/chrome/browser/resources/settings/device_page/device_page.html
@@ -85,7 +85,7 @@
<template is="dom-if" if="[[androidEnabled_]]">
<template is="dom-if" route-path="/storage/externalStoragePreferences">
<settings-subpage
- associated-control="[[$$('#externalStoragePreferencesRow')]]"
+ associated-control="[[$$('#storageRow')]]"
page-title="$i18n{storageExternal}">
<settings-storage-external prefs="{{prefs}}">
</settings-storage-external>
diff --git a/chromium/chrome/browser/resources/settings/device_page/device_page_browser_proxy.js b/chromium/chrome/browser/resources/settings/device_page/device_page_browser_proxy.js
index 2c8a7bf3606..13fa10e6b8a 100644
--- a/chromium/chrome/browser/resources/settings/device_page/device_page_browser_proxy.js
+++ b/chromium/chrome/browser/resources/settings/device_page/device_page_browser_proxy.js
@@ -78,6 +78,14 @@ settings.NoteAppLockScreenSupport = {
*/
settings.NoteAppInfo;
+/**
+ * @typedef {{
+ * label: string,
+ * uuid: string
+ * }}
+ */
+settings.ExternalStorage;
+
cr.define('settings', function() {
/** @interface */
class DevicePageBrowserProxy {
@@ -154,6 +162,16 @@ cr.define('settings', function() {
* actions from the lock screen.
*/
setPreferredNoteTakingAppEnabledOnLockScreen(enabled) {}
+
+ /** Requests an external storage list update. */
+ updateExternalStorages() {}
+
+ /**
+ * |callback| is run when the list of plugged-in external storages is
+ * available after |updateExternalStorages| has been called.
+ * @param {function(Array<!settings.ExternalStorage>):void} callback
+ */
+ setExternalStoragesUpdatedCallback(callback) {}
}
/**
@@ -234,6 +252,16 @@ cr.define('settings', function() {
setPreferredNoteTakingAppEnabledOnLockScreen(enabled) {
chrome.send('setPreferredNoteTakingAppEnabledOnLockScreen', [enabled]);
}
+
+ /** @override */
+ updateExternalStorages() {
+ chrome.send('updateExternalStorages');
+ }
+
+ /** @override */
+ setExternalStoragesUpdatedCallback(callback) {
+ cr.addWebUIListener('onExternalStoragesUpdated', callback);
+ }
}
cr.addSingletonGetter(DevicePageBrowserProxyImpl);
diff --git a/chromium/chrome/browser/resources/settings/device_page/display_overscan_dialog.html b/chromium/chrome/browser/resources/settings/device_page/display_overscan_dialog.html
index 514f8d719b6..7fcd324f6fe 100644
--- a/chromium/chrome/browser/resources/settings/device_page/display_overscan_dialog.html
+++ b/chromium/chrome/browser/resources/settings/device_page/display_overscan_dialog.html
@@ -5,7 +5,7 @@
<link rel="import" href="chrome://resources/cr_elements/icons.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
-<link rel="import" href="../icons.html">
+<link rel="import" href="../chromeos/os_icons.html">
<link rel="import" href="../settings_shared_css.html">
<dom-module id="settings-display-overscan-dialog">
@@ -55,7 +55,7 @@
<iron-icon icon="cr:expand-less"></iron-icon>
</div>
<div class="layout horizontal">
- <iron-icon icon="settings:chevron-left"></iron-icon>
+ <iron-icon icon="os-settings:chevron-left"></iron-icon>
<iron-icon icon="cr:expand-more"></iron-icon>
<iron-icon icon="cr:chevron-right"></iron-icon>
</div>
diff --git a/chromium/chrome/browser/resources/settings/device_page/pointers.html b/chromium/chrome/browser/resources/settings/device_page/pointers.html
index 95301b12bf5..fff070da29c 100644
--- a/chromium/chrome/browser/resources/settings/device_page/pointers.html
+++ b/chromium/chrome/browser/resources/settings/device_page/pointers.html
@@ -22,8 +22,8 @@
.subsection > settings-toggle-button,
.subsection > .settings-box {
- padding-left: 0;
- padding-right: 0;
+ padding-inline-end: 0;
+ padding-inline-start: 0;
}
</style>
<div id="mouse" hidden$="[[!hasMouse]]">
@@ -43,6 +43,12 @@
pref="{{prefs.settings.mouse.reverse_scroll}}"
label="$i18n{mouseReverseScroll}">
</settings-toggle-button>
+ <template is="dom-if" if="[[allowDisableAcceleration_]]">
+ <settings-toggle-button id="mouseAcceleration"
+ pref="{{prefs.settings.mouse.acceleration}}"
+ label="$i18n{pointerAccelerationLabel}">
+ </settings-toggle-button>
+ </template>
<div class="settings-box">
<div class="start" id="mouseSpeedLabel">$i18n{mouseSpeed}</div>
<settings-slider pref="{{prefs.settings.mouse.sensitivity2}}"
@@ -66,6 +72,12 @@
pref="{{prefs.settings.touchpad.enable_tap_dragging}}"
label="$i18n{tapDraggingLabel}">
</settings-toggle-button>
+ <template is="dom-if" if="[[allowDisableAcceleration_]]">
+ <settings-toggle-button id="touchpadAcceleration"
+ pref="{{prefs.settings.touchpad.acceleration}}"
+ label="$i18n{pointerAccelerationLabel}">
+ </settings-toggle-button>
+ </template>
<div class="settings-box">
<div class="start" id="touchpadSpeedLabel">$i18n{touchpadSpeed}</div>
<settings-slider id="touchpadSensitivity"
diff --git a/chromium/chrome/browser/resources/settings/device_page/pointers.js b/chromium/chrome/browser/resources/settings/device_page/pointers.js
index 4414214536d..1db873949f2 100644
--- a/chromium/chrome/browser/resources/settings/device_page/pointers.js
+++ b/chromium/chrome/browser/resources/settings/device_page/pointers.js
@@ -30,6 +30,17 @@ Polymer({
value: [1, 2, 3, 4, 5],
readOnly: true,
},
+
+ /**
+ * TODO(zentaro): Remove this conditional once the feature is launched.
+ * @private
+ */
+ allowDisableAcceleration_: {
+ type: Boolean,
+ value: function() {
+ return loadTimeData.getBoolean('allowDisableMouseAcceleration');
+ },
+ },
},
// Used to correctly identify when the mouse button has been released.
diff --git a/chromium/chrome/browser/resources/settings/device_page/storage.html b/chromium/chrome/browser/resources/settings/device_page/storage.html
index 701623f33f3..f0a518e2572 100644
--- a/chromium/chrome/browser/resources/settings/device_page/storage.html
+++ b/chromium/chrome/browser/resources/settings/device_page/storage.html
@@ -217,7 +217,7 @@
</template>
<cr-link-row id="browsingDataSize" class="hr" on-click="onBrowsingDataTap_"
label="$i18n{storageItemBrowsingData}"
- sub-label="$i18n{storageSizeComputing}"></cr-link-row>
+ sub-label="$i18n{storageSizeComputing}" external></cr-link-row>
<template is="dom-if" if="[[androidRunning_]]">
<cr-link-row id="androidSize" class="hr" on-click="onAndroidTap_"
label="$i18n{storageItemAndroid}"
diff --git a/chromium/chrome/browser/resources/settings/device_page/storage.js b/chromium/chrome/browser/resources/settings/device_page/storage.js
index 211c28c7726..2717462da66 100644
--- a/chromium/chrome/browser/resources/settings/device_page/storage.js
+++ b/chromium/chrome/browser/resources/settings/device_page/storage.js
@@ -162,9 +162,7 @@ Polymer({
* @private
*/
onBrowsingDataTap_: function() {
- settings.navigateTo(
- settings.routes.CLEAR_BROWSER_DATA,
- /* dynamicParams */ null, /* removeSearch */ true);
+ window.open('chrome://settings/clearBrowserData');
},
/**
diff --git a/chromium/chrome/browser/resources/settings/device_page/storage_external.html b/chromium/chrome/browser/resources/settings/device_page/storage_external.html
index e215e54f0d5..922c2613d1f 100644
--- a/chromium/chrome/browser/resources/settings/device_page/storage_external.html
+++ b/chromium/chrome/browser/resources/settings/device_page/storage_external.html
@@ -1,21 +1,32 @@
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/html/assert.html">
+<link rel="import" href="storage_external_entry.html">
<link rel="import" href="../prefs/prefs.html">
<link rel="import" href="../settings_shared_css.html">
<dom-module id="settings-storage-external">
<template>
- <style include="settings-shared"></style>
+ <style include="settings-shared">
+ h2 {
+ padding-inline-start: var(--cr-section-padding);
+ }
+
+ </style>
<div class="settings-box first">
<span>
$i18n{storageAndroidAppsExternalDrivesNote}
</span>
</div>
- <settings-toggle-button class="hr"
- pref="{{prefs.arc.has_access_to_removable_media}}"
- label="$i18n{storageAndroidAppsExternalDrives}">
- </settings-toggle-button>
+ <h2>$i18n{storageExternalStorageListHeader}</h2>
+ <iron-list id="removableDevices" preserve-focus
+ items="[[externalStorages_]]">
+ <template>
+ <storage-external-entry uuid="[[item.uuid]]" label="[[item.label]]"
+ prefs="{{prefs}}">
+ </storage-external-entry>
+ </template>
+ </iron-list>
</template>
<script src="storage_external.js"></script>
</dom-module>
diff --git a/chromium/chrome/browser/resources/settings/device_page/storage_external.js b/chromium/chrome/browser/resources/settings/device_page/storage_external.js
index 61f54f6fdf3..b52ab99a3ae 100644
--- a/chromium/chrome/browser/resources/settings/device_page/storage_external.js
+++ b/chromium/chrome/browser/resources/settings/device_page/storage_external.js
@@ -10,4 +10,50 @@
Polymer({
is: 'settings-storage-external',
+
+ behaviors: [WebUIListenerBehavior],
+
+ properties: {
+ /**
+ * List of the plugged-in external storages.
+ * @private {Arrray<!settings.ExternalStorage>}
+ */
+ externalStorages_: {
+ type: Array,
+ value: function() {
+ return [];
+ }
+ },
+
+ /** @private {!chrome.settingsPrivate.PrefObject} */
+ externalStorageVisiblePref_: {
+ type: Object,
+ value: function() {
+ return /** @type {!chrome.settingsPrivate.PrefObject} */ ({});
+ },
+ },
+ },
+
+ /** @private {?settings.DevicePageBrowserProxy} */
+ browserProxy_: null,
+
+ /** @override */
+ created: function() {
+ this.browserProxy_ = settings.DevicePageBrowserProxyImpl.getInstance();
+ },
+
+ /** @override */
+ attached: function() {
+ this.browserProxy_.setExternalStoragesUpdatedCallback(
+ this.handleExternalStoragesUpdated_.bind(this));
+ this.browserProxy_.updateExternalStorages();
+ },
+
+ /**
+ * @param {Array<!settings.ExternalStorage>} storages
+ * @private
+ */
+ handleExternalStoragesUpdated_: function(storages) {
+ this.externalStorages_ = storages;
+ },
});
diff --git a/chromium/chrome/browser/resources/settings/device_page/storage_external_entry.html b/chromium/chrome/browser/resources/settings/device_page/storage_external_entry.html
new file mode 100644
index 00000000000..c7f20266418
--- /dev/null
+++ b/chromium/chrome/browser/resources/settings/device_page/storage_external_entry.html
@@ -0,0 +1,25 @@
+<link rel="import" href="chrome://resources/html/polymer.html">
+
+<link rel="import" href="chrome://resources/html/assert.html">
+<link rel="import" href="../prefs/prefs.html">
+<link rel="import" href="../prefs/prefs_behavior.html">
+<link rel="import" href="../settings_shared_css.html">
+
+<dom-module id="storage-external-entry">
+ <template>
+ <style include="settings-shared">
+ settings-toggle-button {
+ margin-inline-end: var(--cr-section-padding);
+ margin-inline-start: var(--cr-section-indent-padding);
+ padding-inline-end: 0;
+ padding-inline-start: 0;
+ }
+ </style>
+ <settings-toggle-button class="hr"
+ pref="{{visiblePref_}}"
+ label="[[label]]"
+ on-settings-boolean-control-change="onVisibleChange_">
+ </settings-toggle-button>
+ </template>
+ <script src="storage_external_entry.js"></script>
+</dom-module>
diff --git a/chromium/chrome/browser/resources/settings/device_page/storage_external_entry.js b/chromium/chrome/browser/resources/settings/device_page/storage_external_entry.js
new file mode 100644
index 00000000000..8749afa8033
--- /dev/null
+++ b/chromium/chrome/browser/resources/settings/device_page/storage_external_entry.js
@@ -0,0 +1,72 @@
+// Copyright 2019 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * @fileoverview
+ * 'storage-external-entry' is the polymer element for showing a certain
+ * external storage device with a toggle switch. When the switch is ON,
+ * the storage's uuid will be saved to a preference.
+ */
+Polymer({
+ is: 'storage-external-entry',
+
+ behaviors: [WebUIListenerBehavior, PrefsBehavior],
+
+ properties: {
+ /**
+ * FileSystem UUID of an external storage.
+ */
+ uuid: String,
+
+ /**
+ * Label of an external storage.
+ */
+ label: String,
+
+ /** @private {chrome.settingsPrivate.PrefObject} */
+ visiblePref_: {
+ type: Object,
+ value: function() {
+ return /** @type {chrome.settingsPrivate.PrefObject} */ ({});
+ },
+ },
+ },
+
+ observers: [
+ 'updateVisible_(prefs.arc.visible_external_storages.*)',
+ ],
+
+ /**
+ * Handler for when the toggle button for this entry is clicked by a user.
+ * @param {!Event} event
+ * @private
+ */
+ onVisibleChange_: function(event) {
+ const visible = !!event.target.checked;
+ if (visible) {
+ this.appendPrefListItem('arc.visible_external_storages', this.uuid);
+ } else {
+ this.deletePrefListItem('arc.visible_external_storages', this.uuid);
+ }
+ chrome.metricsPrivate.recordBoolean(
+ 'Arc.ExternalStorage.SetVisible', visible);
+ },
+
+ /**
+ * Updates |visiblePref_| by reading the preference and check if it contains
+ * UUID of this storage.
+ * @private
+ */
+ updateVisible_: function() {
+ const uuids = /** @type {!Array<string>} */ (
+ this.getPref('arc.visible_external_storages').value);
+ const visible = uuids.some((id) => id === this.uuid);
+ const pref = {
+ key: '',
+ type: chrome.settingsPrivate.PrefType.BOOLEAN,
+ value: visible,
+ };
+ this.visiblePref_ = pref;
+ },
+}); \ No newline at end of file
diff --git a/chromium/chrome/browser/resources/settings/google_assistant_page/google_assistant_page.js b/chromium/chrome/browser/resources/settings/google_assistant_page/google_assistant_page.js
index a901f4e32bd..559d65184d1 100644
--- a/chromium/chrome/browser/resources/settings/google_assistant_page/google_assistant_page.js
+++ b/chromium/chrome/browser/resources/settings/google_assistant_page/google_assistant_page.js
@@ -16,7 +16,7 @@ const DspHotwordState = {
* Indicates user's activity control consent status.
*
* Note: This should be kept in sync with ash::mojom::ConsentStatus in
- * ash/public/interfaces/voice_interaction_controller.mojom
+ * ash/public/mojom/voice_interaction_controller.mojom
* @enum {number}
*/
const ConsentStatus = {
diff --git a/chromium/chrome/browser/resources/settings/icons.html b/chromium/chrome/browser/resources/settings/icons.html
index 816bb70c3a1..ad722128231 100644
--- a/chromium/chrome/browser/resources/settings/icons.html
+++ b/chromium/chrome/browser/resources/settings/icons.html
@@ -4,6 +4,7 @@
<!--
List icons here rather than importing large sets of (e.g. Polymer) icons.
+NOTE: Chrome OS icons go in ./chromeos/os_icons.html.
-->
<iron-iconset-svg name="settings20" size="20">
<svg>
@@ -12,10 +13,17 @@ List icons here rather than importing large sets of (e.g. Polymer) icons.
<g id="googleg"><path d="M16.58 8H9v2.75h4.47c-.24 1.2-1.42 3.27-4.47 3.27-2.72 0-4.93-2.25-4.93-5.02S6.28 3.98 9 3.98c1.54 0 2.57.66 3.17 1.22l2.19-2.12C12.97 1.79 11.16 1 9 1 4.58 1 1 4.58 1 9s3.58 8 8 8c4.62 0 7.68-3.25 7.68-7.82 0-.46-.04-.83-.1-1.18z"></path></g>
<g id="location-on"><path d="M10,2 C6.95928571,2 4.5,4.504 4.5,7.6 C4.5,11.8 10,18 10,18 C10,18 15.5,11.8 15.5,7.6 C15.5,4.504 13.0407143,2 10,2 Z M10,9.5 C8.896,9.5 8,8.604 8,7.5 C8,6.396 8.896,5.5 10,5.5 C11.104,5.5 12,6.396 12,7.5 C12,8.604 11.104,9.5 10,9.5 Z"></path></g>
<g id="vpn-key"><path d="M10.4727273,8 C9.87272727,6.2525 8.26181818,5 6.36363636,5 C3.95272727,5 2,7.01375 2,9.5 C2,11.98625 3.95272727,14 6.36363636,14 C8.26181818,14 9.87272727,12.7475 10.4727273,11 L13.6363636,11 L13.6363636,14 L16.5454545,14 L16.5454545,11 L18,11 L18,8 L10.4727273,8 Z M6.36363636,11 C5.56,11 4.90909091,10.32875 4.90909091,9.5 C4.90909091,8.67125 5.56,8 6.36363636,8 C7.16727273,8 7.81818182,8.67125 7.81818182,9.5 C7.81818182,10.32875 7.16727273,11 6.36363636,11 Z"></path></g>
+ <g id="cloud-off"><path d="M16.4732571,13.3443682 C16.8002856,12.9882746 17,12.5134184 17,11.9922 C17,10.8882 16.104,9.9922 15,9.9922 L13.494,9.9922 L13.494,9.0002 C13.494,7.0672 11.927,5.5002 9.994,5.5002 C9.5847901,5.5002 9.1930204,5.57089988 8.82954884,5.70065995 L7.33083687,4.20194798 C8.11843435,3.75577808 9.02717677,3.5002 10,3.5002 C12.71,3.5002 14.957,5.4612 15.411,8.0412 C17.424,8.2502 19,9.9312 19,12.0002 C19,13.0718701 18.5784721,14.0451601 17.8921876,14.7632987 L16.4732571,13.3443682 Z M17.8711111,17 L16.8711111,18 L14.8713111,16.0002 L6,16.0002 C3.239,16.0002 1,13.7622 1,11.0002 C1,8.58475294 2.71868905,6.59044755 4.99627833,6.12516722 L2,3.12888889 L3,2.12888889 L17.8711111,17 Z M6.86331111,7.9922 L6,7.9922 C4.343,7.9922 3,9.3352 3,10.9922 C3,12.6492 4.343,13.9922 6,13.9922 L12.8633111,13.9922 L6.86331111,7.9922 Z"></path></g>
+ <!-- The polygon ("+" shape) within this icon will always be filled with
+ the color #4285F4. Any color fills specified programmatically will
+ only be applied to the outer layer. -->
+ <g id="printer-add"><path d="M17.8734304,8.29826826 C17.2839707,8.10470383 16.6542128,8 16,8 C13.3875623,8 11.1650842,9.66961525 10.3414114,12 L7,12 L7,15 L10.0829584,15 C10.2034032,15.7179235 10.4513404,16.3926158 10.8026932,17 L5,17 L5,14 L2,14 L2,9 C2,7.8954305 2.8954305,7 4,7 L5,7 L5,3 L15,3 L15,7 L16,7 C16.8576527,7 17.5892179,7.53984453 17.8734304,8.29826826 Z M7,5 L7,7 L13,7 L13,5 L7,5 Z"></path><polygon fill="#4285F4" points="17 13 19 13 19 15 17 15 17 17 15 17 15 15 13 15 13 13 15 13 15 11 17 11"></polygon></g>
</defs>
</svg>
</iron-iconset-svg>
+<!-- NOTE: In the common case that the final icon will be 20x20, export the SVG
+ at 20px and place it in the section above. -->
<iron-iconset-svg name="settings" size="24">
<svg>
<defs>
@@ -38,31 +46,6 @@ List icons here rather than importing large sets of (e.g. Polymer) icons.
<path fill="none" d="M1 1h22v22H1z"></path>
</g>
-<if expr="chromeos">
- <!-- Icons from http://icons/ -->
- <g id="play-prism"><path d="M20.18 10.88l-3.06-1.74L14.26 12l2.86 2.86 3.06-1.74c.55-.31.82-.71.82-1.12 0-.41-.27-.81-.82-1.12zM4.71 2.45l8.42 8.42 2.55-2.55-10.7-6.06c-.07-.04-.14-.07-.21-.1-.17-.07-.3.05-.15.21.03.02.06.05.09.08zm0 19.1l-.08.08c-.15.15-.02.28.15.21.07-.03.14-.06.21-.1l10.69-6.06-2.55-2.55s-7.2 7.21-8.42 8.42zM12 12L3.38 3.38c-.19-.19-.38-.07-.38.19v16.86c0 .26.19.38.38.19L12 12z"></path></g>
-
- <!-- Apps icon for Settings drawer -->
- <g id="apps">
- <rect width="24" height="24"></rect>
- <path d="M6 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm6 12c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm-6 0c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0-6c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm6 0c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm4-8c0 1.1.9 2 2 2s2-.9 2-2-.9-2-2-2-2 .9-2 2zm-4 2c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm6 6c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 6c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"></path>
- </g>
-
- <!-- Crostini Mascot icon for Settings drawer -->
- <g id="crostini-mascot" fill-rule="evenodd">
- <rect width="24" height="24" fill="none"></rect>
- <path d="M6.70994751,22.1802367 C3.77039152,20.9576222 1.88689678,18.4876617 1.82270453,14.1866283 C1.52620735,14.3410271 1.18877909,14.3669908 0.800057996,14.221322 C-0.312414045,13.804436 -0.0624529958,12.4120387 0.345560769,11.1705211 C0.68346303,10.142341 1.83735671,9.39181671 2.40240955,9.23479478 C3.71763772,4.05541221 6.80346772,0 12,0 C17.2584272,0 20.3654882,3.88805047 21.6436562,9.24850027 C22.2231374,9.43172978 23.3254781,10.1695473 23.6544392,11.1705211 C24.062453,12.4120387 24.312414,13.804436 23.199942,14.221322 C22.8112853,14.3669667 22.4739044,14.3410357 22.1774428,14.186705 C22.1189307,18.5169382 20.2342349,20.9750038 17.2936622,22.1879533 C17.3379726,22.2841737 17.3614392,22.3916932 17.3614392,22.5115654 C17.3614392,23.3336051 17.750632,24 14.8965517,24 C12.813813,24 12.4581871,23.5470722 12.4180882,23.0543665 C12.2796354,22.9647547 12.14026,22.8305157 12,22.8305157 C11.8594243,22.8305157 11.7197425,22.9755283 11.5809922,23.0650454 C11.536581,23.553597 11.171131,24 9.10344828,24 C6.24936798,24 6.63856075,23.3336051 6.63856075,22.5115654 C6.63856075,22.3884786 6.66330281,22.278416 6.70994751,22.1802367 Z M12,20.3378361 C17.4851654,20.3378361 19.4630542,17.934489 19.4630542,12.6147346 C19.4630542,8.20063746 17.6641739,4.14700996 14.6790451,3.47027327 C13.7222433,3.25336374 13.052482,5.61336212 12,5.61336212 C10.947518,5.61336212 10.1820765,3.25336374 9.32095491,3.47027327 C6.32316904,4.22539115 4.53694581,8.43392639 4.53694581,12.6147346 C4.53694581,17.6346061 6.51483457,20.3378361 12,20.3378361 Z M8.27586207,9.99377535 C7.59026721,9.99377535 7.03448276,9.42257974 7.03448276,8.71797424 C7.03448276,8.01336875 7.59026721,7.44217314 8.27586207,7.44217314 C8.96145693,7.44217314 9.51724138,8.01336875 9.51724138,8.71797424 C9.51724138,9.42257974 8.96145693,9.99377535 8.27586207,9.99377535 Z M15.7241379,9.99377535 C15.0385431,9.99377535 14.4827586,9.42257974 14.4827586,8.71797424 C14.4827586,8.01336875 15.0385431,7.44217314 15.7241379,7.44217314 C16.4097328,7.44217314 16.9655172,8.01336875 16.9655172,8.71797424 C16.9655172,9.42257974 16.4097328,9.99377535 15.7241379,9.99377535 Z M12.224615,10.6827627 L13.9283449,11.4510541 C14.2234366,11.5841248 14.3564393,11.9349546 14.2254148,12.2346546 C14.1996198,12.293657 14.1645229,12.3479919 14.1215061,12.39552 L12.4275305,14.2671455 C12.2090286,14.5085621 11.8392003,14.5243719 11.6014958,14.3024578 C11.5890079,14.2907994 11.5770255,14.2785946 11.5655826,14.265878 L9.87720766,12.3895636 C9.65939502,12.1475054 9.67603268,11.771949 9.91436891,11.5507349 C9.9604013,11.5080095 10.012868,11.4730393 10.0697797,11.4471502 L11.7484004,10.6835476 C11.8998356,10.6146599 12.0729604,10.6143745 12.224615,10.6827627 Z"></path>
- </g>
-
- <!-- Plugin VM icon for Settings drawer -->
- <g id="plugin-vm"><path transform="scale(1.2)" d="M7 12v4H4V4a1 1 0 0 1 1-1h8a3 3 0 0 1 3 3v3a3 3 0 0 1-3 3H7zm0-6v3h5a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H7z"></path></g>
-
- <!-- Icons for MultiDevice Settings UI -->
- <g id="multidevice-better-together-suite"><path d="M17,1.01 L7,1 C5.9,1 5,1.9 5,3 L5,21 C5,22.1 5.9,23 7,23 L17,23 C18.1,23 19,22.1 19,21 L19,3 C19,1.9 18.1,1.01 17,1.01 Z M17,21 L7,21 L7,20 L17,20 L17,21 Z M17,18 L7,18 L7,6 L17,6 L17,18 Z M7,4 L7,3 L17,3 L17,4 L7,4 Z"></path></g>
- <g id="multidevice-smart-lock"><path d="M18,9 L17,9 L17,7 C17,4.24 14.76,2 12,2 C9.24,2 7,4.24 7,7 L7,9 L6,9 C4.9,9 4,9.9 4,11 L4,21 C4,22.1 4.9,23 6,23 L18,23 C19.1,23 20,22.1 20,21 L20,11 C20,9.9 19.1,9 18,9 Z M9,7 C9,5.34 10.34,4 12,4 C13.66,4 15,5.34 15,7 L15,9 L9,9 L9,7 Z M18,21 L6,21 L6,11 L18,11 L18,21 Z M12,18 C13.1,18 14,17.1 14,16 C14,14.9 13.1,14 12,14 C10.9,14 10,14.9 10,16 C10,17.1 10.9,18 12,18 Z"></path></g>
- <g id="multidevice-messages"><path d="M19.9593506,2 C21.0593506,2 22,2.89658203 22,3.99658203 L22,16.0036621 C22,17.1036621 21.0593506,18.0036621 19.9593506,18.0036621 L6.00878906,18.0036621 L2.00878906,22.4 L2.01878906,3.99658203 C2.01878906,2.89658203 2.90878906,2 4.00878906,2 L19.9593506,2 Z M8,8.56896973 L4.5,12 L8,15.6103516 L8,13 L14,13 L14,11 L8,11 L8,8.56896973 Z M20.5688477,7 L17,3.57207031 L17,6 L11,6 L11,8 L17,8 L17,10.5720703 L20.5688477,7 Z"></path></g>
-</if>
-
<!-- Protected Content SVG -->
<g id="protected-content">
<path d="M10,15 L6,11.1783439 L7.41,9.83121019 L10,12.2961783 L16.59,6 L18,7.3566879 L10,15 Z M21,3 L3,3 C1.89,3 1,3.89 1,5 L1,17 C1,18.1 1.89,19 3,19 L8,19 L8,21 L16,21 L16,19 L21,19 C22.1,19 22.99,18.1 22.99,17 L23,5 C23,3.89 22.1,3 21,3 Z M21,17 L3,17 L3,5 L21,5 L21,17 Z"></path>
@@ -72,50 +55,21 @@ List icons here rather than importing large sets of (e.g. Polymer) icons.
These icons are copied from Polymer's iron-icons and kept in sorted order.
See http://goo.gl/Y1OdAq for instructions on adding additional icons.
-->
-<if expr="chromeos">
- <g id="access-time"><path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z"></path></g>
-</if>
<g id="accessibility"><path d="M12 2c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm9 7h-6v13h-2v-6h-2v6H9V9H3V7h18v2z"></path></g>
<g id="apps"><path d="M4 8h4V4H4v4zm6 12h4v-4h-4v4zm-6 0h4v-4H4v4zm0-6h4v-4H4v4zm6 0h4v-4h-4v4zm6-10v4h4V4h-4zm-6 4h4V4h-4v4zm6 6h4v-4h-4v4zm0 6h4v-4h-4v4z"></path></g>
<g id="assignment"><path d="M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm2 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z"></path></g>
-<if expr="chromeos">
- <g id="bluetooth-connected"><path d="M7 12l-2-2-2 2 2 2 2-2zm10.71-4.29L12 2h-1v7.59L6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 11 14.41V22h1l5.71-5.71-4.3-4.29 4.3-4.29zM13 5.83l1.88 1.88L13 9.59V5.83zm1.88 10.46L13 18.17v-3.76l1.88 1.88zM19 10l-2 2 2 2 2-2-2-2z"></path></g>
- <g id="bluetooth-disabled"><path d="M13 5.83l1.88 1.88-1.6 1.6 1.41 1.41 3.02-3.02L12 2h-1v5.03l2 2v-3.2zM5.41 4L4 5.41 10.59 12 5 17.59 6.41 19 11 14.41V22h1l4.29-4.29 2.3 2.29L20 18.59 5.41 4zM13 18.17v-3.76l1.88 1.88L13 18.17z"></path></g>
- <g id="brightness-1"><circle cx="12" cy="12" r="10"></circle></g>
-</if>
<if expr="not chromeos">
<g id="build"><path d="M22.7 19l-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4z"></path></g>
</if>
<g id="check-circle"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"></path></g>
-<if expr="chromeos">
- <g id="chevron-left"><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"</path></g>
-</if>
<g id="clipboard"><path d="M19 2h-4.18C14.4.84 13.3 0 12 0c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm7 18H5V4h2v3h10V4h2v16z"></path></g>
<g id="cloud"><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z"></path></g>
<g id="code"><path d="M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"></path></g>
<g id="content-copy"><path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"></path></g>
-<if expr="chromeos">
- <g id="devices-other"><path d="M3 6h18V4H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h4v-2H3V6zm10 6H9v1.78c-.61.55-1 1.33-1 2.22s.39 1.67 1 2.22V20h4v-1.78c.61-.55 1-1.34 1-2.22s-.39-1.67-1-2.22V12zm-2 5.5c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zM22 8h-6c-.5 0-1 .5-1 1v10c0 .5.5 1 1 1h6c.5 0 1-.5 1-1V9c0-.5-.5-1-1-1zm-1 10h-4v-8h4v8z"></path></g>
-</if>
<g id="exit-to-app"><path d="M10.09 15.59L11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67l-2.58 2.59zM19 3H5c-1.11 0-2 .9-2 2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"></path></g>
-<if expr="chromeos">
- <g id="fingerprint"><path d="M17.81 4.47c-.08 0-.16-.02-.23-.06C15.66 3.42 14 3 12.01 3c-1.98 0-3.86.47-5.57 1.41-.24.13-.54.04-.68-.2-.13-.24-.04-.55.2-.68C7.82 2.52 9.86 2 12.01 2c2.13 0 3.99.47 6.03 1.52.25.13.34.43.21.67-.09.18-.26.28-.44.28zM3.5 9.72c-.1 0-.2-.03-.29-.09-.23-.16-.28-.47-.12-.7.99-1.4 2.25-2.5 3.75-3.27C9.98 4.04 14 4.03 17.15 5.65c1.5.77 2.76 1.86 3.75 3.25.16.22.11.54-.12.7-.23.16-.54.11-.7-.12-.9-1.26-2.04-2.25-3.39-2.94-2.87-1.47-6.54-1.47-9.4.01-1.36.7-2.5 1.7-3.4 2.96-.08.14-.23.21-.39.21zm6.25 12.07c-.13 0-.26-.05-.35-.15-.87-.87-1.34-1.43-2.01-2.64-.69-1.23-1.05-2.73-1.05-4.34 0-2.97 2.54-5.39 5.66-5.39s5.66 2.42 5.66 5.39c0 .28-.22.5-.5.5s-.5-.22-.5-.5c0-2.42-2.09-4.39-4.66-4.39-2.57 0-4.66 1.97-4.66 4.39 0 1.44.32 2.77.93 3.85.64 1.15 1.08 1.64 1.85 2.42.19.2.19.51 0 .71-.11.1-.24.15-.37.15zm7.17-1.85c-1.19 0-2.24-.3-3.1-.89-1.49-1.01-2.38-2.65-2.38-4.39 0-.28.22-.5.5-.5s.5.22.5.5c0 1.41.72 2.74 1.94 3.56.71.48 1.54.71 2.54.71.24 0 .64-.03 1.04-.1.27-.05.53.13.58.41.05.27-.13.53-.41.58-.57.11-1.07.12-1.21.12zM14.91 22c-.04 0-.09-.01-.13-.02-1.59-.44-2.63-1.03-3.72-2.1-1.4-1.39-2.17-3.24-2.17-5.22 0-1.62 1.38-2.94 3.08-2.94 1.7 0 3.08 1.32 3.08 2.94 0 1.07.93 1.94 2.08 1.94s2.08-.87 2.08-1.94c0-3.77-3.25-6.83-7.25-6.83-2.84 0-5.44 1.58-6.61 4.03-.39.81-.59 1.76-.59 2.8 0 .78.07 2.01.67 3.61.1.26-.03.55-.29.64-.26.1-.55-.04-.64-.29-.49-1.31-.73-2.61-.73-3.96 0-1.2.23-2.29.68-3.24 1.33-2.79 4.28-4.6 7.51-4.6 4.55 0 8.25 3.51 8.25 7.83 0 1.62-1.38 2.94-3.08 2.94s-3.08-1.32-3.08-2.94c0-1.07-.93-1.94-2.08-1.94s-2.08.87-2.08 1.94c0 1.71.66 3.31 1.87 4.51.95.94 1.86 1.46 3.27 1.85.27.07.42.35.35.61-.05.23-.26.38-.47.38z"></path></g>
- <g id="gamepad"><path d="M15 7.5V2H9v5.5l3 3 3-3zM7.5 9H2v6h5.5l3-3-3-3zM9 16.5V22h6v-5.5l-3-3-3 3zM16.5 9l-3 3 3 3H22V9h-5.5z"></path></g>
- <g id="headset"><path d="M12 1c-4.97 0-9 4.03-9 9v7c0 1.66 1.34 3 3 3h3v-8H5v-2c0-3.87 3.13-7 7-7s7 3.13 7 7v2h-4v8h3c1.66 0 3-1.34 3-3v-7c0-4.97-4.03-9-9-9z"></path></g>
- <g id="keyboard"><path d="M20 5H4c-1.1 0-1.99.9-1.99 2L2 17c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-9 3h2v2h-2V8zm0 3h2v2h-2v-2zM8 8h2v2H8V8zm0 3h2v2H8v-2zm-1 2H5v-2h2v2zm0-3H5V8h2v2zm9 7H8v-2h8v2zm0-4h-2v-2h2v2zm0-3h-2V8h2v2zm3 3h-2v-2h2v2zm0-3h-2V8h2v2z"></path></g>
-</if>
<g id="language"><path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"></path></g>
-<if expr="chromeos">
- <g id="laptop-chromebook"><path d="M22 18V3H2v15H0v2h24v-2h-2zm-8 0h-4v-1h4v1zm6-3H4V5h16v10z"></path></g>
-</if>
<g id="midi"><path d="M21,19.1H3V5h18V19.1z M21,3H3C1.9,3,1,3.9,1,5v14c0,1.1,0.9,2,2,2h18c1.1,0,2-0.9,2-2V5C23,3.9,22.1,3,21,3z"></path><path fill="none" d="M21,19.1H3V5h18V19.1z M21,3H3C1.9,3,1,3.9,1,5v14c0,1.1,0.9,2,2,2h18c1.1,0,2-0.9,2-2V5C23,3.9,22.1,3,21,3z"></path><path d="M14,5h3v8h-3V5z"></path><path d="M15,12h1v8h-1V12z"></path><path fill="none" d="M0,0h24v24H0V0z"></path><rect x="7" y="5" width="3" height="8"></rect><rect x="8" y="12" width="1" height="8"></rect></g>
-<if expr="chromeos">
- <g id="mouse"><path d="M13 1.07V9h7c0-4.08-3.05-7.44-7-7.93zM4 15c0 4.42 3.58 8 8 8s8-3.58 8-8v-4H4v4zm7-13.93C7.05 1.56 4 4.92 4 9h7V1.07z"></path></g>
-</if>
<g id="music-note"><path d="M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z"></path></g>
-<if expr="chromeos">
- <g id="network-wifi"><path fill-opacity=".3" d="M12.01 21.49L23.64 7c-.45-.34-4.93-4-11.64-4C5.28 3 .81 6.66.36 7l11.63 14.49.01.01.01-.01z"></path><path d="M3.53 10.95l8.46 10.54.01.01.01-.01 8.46-10.54C20.04 10.62 16.81 8 12 8c-4.81 0-8.04 2.62-8.47 2.95z"></path></g>
-</if>
<g id="notifications"><path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"></path></g>
<g id="pdf"><path d="M7 11.5h1v-1H7v1zM19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-9.5 8.5c0 .83-.67 1.5-1.5 1.5H7v2H5.5V9H8c.83 0 1.5.67 1.5 1.5v1zm10-1H17v1h1.5V13H17v2h-1.5V9h4v1.5zm-5 3c0 .83-.67 1.5-1.5 1.5h-2.5V9H13c.83 0 1.5.67 1.5 1.5v3zm-2.5 0h1v-3h-1v3z"></path><path fill="none" d="M0 0h24v24H0z"></path></g>
<g id="palette"><path d="M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9c.83 0 1.5-.67 1.5-1.5 0-.39-.15-.74-.39-1.01-.23-.26-.38-.61-.38-.99 0-.83.67-1.5 1.5-1.5H16c2.76 0 5-2.24 5-5 0-4.42-4.03-8-9-8zm-5.5 9c-.83 0-1.5-.67-1.5-1.5S5.67 9 6.5 9 8 9.67 8 10.5 7.33 12 6.5 12zm3-4C8.67 8 8 7.33 8 6.5S8.67 5 9.5 5s1.5.67 1.5 1.5S10.33 8 9.5 8zm5 0c-.83 0-1.5-.67-1.5-1.5S13.67 5 14.5 5s1.5.67 1.5 1.5S15.33 8 14.5 8zm3 4c-.83 0-1.5-.67-1.5-1.5S16.67 9 17.5 9s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"></path></g>
@@ -125,29 +79,15 @@ List icons here rather than importing large sets of (e.g. Polymer) icons.
<g id="protocol-handler"><path d="M21.72 11.33l-6.644-7.035a.97.97 0 0 0-1.38-.01l-1.67 1.72-1.617-1.712a.97.97 0 0 0-1.38-.01l-6.737 6.935c-.187.191-.29.447-.292.719-.002.272.099.529.28.722l6.644 7.034a.949.949 0 0 0 1.38.011l1.671-1.718 1.615 1.71a.949.949 0 0 0 1.381.01l6.74-6.935a1.054 1.054 0 0 0 .01-1.44zM6.947 12.464l3.657 3.785-.974.98-5.273-5.456 5.349-5.378.929.962-3.677 3.7a.998.998 0 0 0-.292.702 1 1 0 0 0 .28.705zm7.35 4.768l-.931-.963 3.68-3.7a1.012 1.012 0 0 0 .007-1.407l-3.656-3.784.974-.98 5.273 5.456-5.348 5.378z"></path></g>
<g id="restore"><path d="M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"></path></g>
<g id="rotate-right"><path d="M15.55 5.55L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45zM19.93 11c-.17-1.39-.72-2.73-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47h2.02zM13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03zm3.89-2.42l1.42 1.41c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.48z"></path></g>
+ <g id="save-original"><path d="M16.058 24.876H8.002c-1.107 0-2.002-.94-2.002-2.088l.01-16.7C6.01 4.939 6.905 4 8.012 4h8.046l6.035 6.263v4.175h-2.011v-3.131h-5.03v-5.22h-7.04v16.701h4.023v2.088h4.023zm7.581-6.157l1.474 1.481-4.18 4.2-4.182-4.2 1.474-1.48 1.662 1.659V16h2.09v4.378l1.662-1.659zM26.308 28H15.557v-2.4h10.75V28z" id="a"></path></g>
<g id="sensors"><path d="M10 8.5c-0.8 0-1.5 0.7-1.5 1.5s0.7 1.5 1.5 1.5s1.5-0.7 1.5-1.5S10.8 8.5 10 8.5z M7.6 5.8 C6.2 6.7 5.2 8.2 5.2 10c0 1.8 1 3.4 2.4 4.2l0.8-1.4c-1-0.6-1.6-1.6-1.6-2.8c0-1.2 0.6-2.2 1.6-2.8L7.6 5.8z M14.8 10 c0-1.8-1-3.4-2.4-4.2l-0.8 1.4c0.9 0.6 1.6 1.6 1.6 2.8c0 1.2-0.6 2.2-1.6 2.8l0.8 1.4C13.8 13.4 14.8 11.8 14.8 10z M6 3 c-2.4 1.4-4 4-4 7c0 3 1.6 5.6 4 7l0.8-1.4c-1.9-1.1-3.2-3.2-3.2-5.6c0-2.4 1.3-4.5 3.2-5.6L6 3z M13.2 4.4 c1.9 1.1 3.2 3.2 3.2 5.6c0 2.4-1.3 4.5-3.2 5.6L14 17c2.4-1.4 4-4 4-7c0-3-1.6-5.6-4-7L13.2 4.4z"></path></g>
<g id="serial-port"><path d="M22 9V7h-2V5c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-2h2v-2h-2v-2h2v-2h-2V9h2zm-4 10H4V5h14v14zM6 13h5v4H6zm6-6h4v3h-4zM6 7h5v5H6zm6 4h4v6h-4z"></path></g>
-<if expr="chromeos">
- <g id="alert-device-out-of-range" fill="none" fill-rule="evenodd"><path d="M-1-1h20v20H-1z"></path><path fill="#C53929" fill-rule="nonzero" d="M8.167 11.5h1.666v1.667H8.167V11.5zm0-6.667h1.666v5H8.167v-5zM8.992.667C4.392.667.667 4.4.667 9s3.725 8.333 8.325 8.333c4.608 0 8.341-3.733 8.341-8.333S13.6.667 8.992.667zm.008 15A6.665 6.665 0 0 1 2.333 9 6.665 6.665 0 0 1 9 2.333 6.665 6.665 0 0 1 15.667 9 6.665 6.665 0 0 1 9 15.667z"></path></g>
- <g id="signal-cellular-0-bar"><path fill-opacity=".3" d="M2 22h20V2z"></path></g>
- <g id="signal-cellular-1-bar"><path fill-opacity=".3" d="M2 22h20V2z"></path><path d="M12 12L2 22h10z"></path></g>
- <g id="signal-cellular-2-bar"><path fill-opacity=".3" d="M2 22h20V2z"></path><path d="M14 10L2 22h12z"></path></g>
- <g id="signal-cellular-3-bar"><path fill-opacity=".3" d="M2 22h20V2z"></path><path d="M17 7L2 22h15z"></path></g>
- <g id="signal-cellular-4-bar"><path d="M2 22h20V2z"></path></g>
- <g id="smartphone"><path d="M17 1.01L7 1c-1.1 0-2 .9-2 2v18c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V3c0-1.1-.9-1.99-2-1.99zM17 19H7V5h10v14z"></path></g>
-</if>
<g id="supervisor-account"><path d="M16.5 12c1.38 0 2.49-1.12 2.49-2.5S17.88 7 16.5 7C15.12 7 14 8.12 14 9.5s1.12 2.5 2.5 2.5zM9 11c1.66 0 2.99-1.34 2.99-3S10.66 5 9 5C7.34 5 6 6.34 6 8s1.34 3 3 3zm7.5 3c-1.83 0-5.5.92-5.5 2.75V19h11v-2.25c0-1.83-3.67-2.75-5.5-2.75zM9 13c-2.33 0-7 1.17-7 3.5V19h7v-2.25c0-.85.33-2.34 2.37-3.47C10.5 13.1 9.66 13 9 13z"></path></g>
<g id="sync-disabled"><path d="M10 6.35V4.26c-.8.21-1.55.54-2.23.96l1.46 1.46c.25-.12.5-.24.77-.33zm-7.14-.94l2.36 2.36C4.45 8.99 4 10.44 4 12c0 2.21.91 4.2 2.36 5.64L4 20h6v-6l-2.24 2.24C6.68 15.15 6 13.66 6 12c0-1 .25-1.94.68-2.77l8.08 8.08c-.25.13-.5.25-.77.34v2.09c.8-.21 1.55-.54 2.23-.96l2.36 2.36 1.27-1.27L4.14 4.14 2.86 5.41zM20 4h-6v6l2.24-2.24C17.32 8.85 18 10.34 18 12c0 1-.25 1.94-.68 2.77l1.46 1.46C19.55 15.01 20 13.56 20 12c0-2.21-.91-4.2-2.36-5.64L20 4z"></path></g>
<g id="sync-problem"><path d="M3 12c0 2.21.91 4.2 2.36 5.64L3 20h6v-6l-2.24 2.24C5.68 15.15 5 13.66 5 12c0-2.61 1.67-4.83 4-5.65V4.26C5.55 5.15 3 8.27 3 12zm8 5h2v-2h-2v2zM21 4h-6v6l2.24-2.24C18.32 8.85 19 10.34 19 12c0 2.61-1.67 4.83-4 5.65v2.09c3.45-.89 6-4.01 6-7.74 0-2.21-.91-4.2-2.36-5.64L21 4zm-10 9h2V7h-2v6z"></path></g>
-<if expr="chromeos">
- <g id="tablet"><path d="M21 4H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h18c1.1 0 1.99-.9 1.99-2L23 6c0-1.1-.9-2-2-2zm-2 14H5V6h14v12z"></path></g>
-</if>
<g id="usb"><path d="M15 7v4h1v2h-3V5h2l-3-4-3 4h2v8H8v-2.07c.7-.37 1.2-1.08 1.2-1.93 0-1.21-.99-2.2-2.2-2.2-1.21 0-2.2.99-2.2 2.2 0 .85.5 1.56 1.2 1.93V13c0 1.11.89 2 2 2h3v3.05c-.71.37-1.2 1.1-1.2 1.95 0 1.22.99 2.2 2.2 2.2 1.21 0 2.2-.98 2.2-2.2 0-.85-.49-1.58-1.2-1.95V15h3c1.11 0 2-.89 2-2v-2h1V7h-4z"></path></g>
<g id="volume-up"><path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"></path></g>
<g id="bluetooth-scanning"><path d="M14.24 12.01l2.32 2.32c.28-.72.44-1.51.44-2.33 0-.82-.16-1.59-.43-2.31l-2.33 2.32zm5.29-5.3l-1.26 1.26c.63 1.21.98 2.57.98 4.02s-.36 2.82-.98 4.02l1.2 1.2a9.936 9.936 0 0 0 1.54-5.31c-.01-1.89-.55-3.67-1.48-5.19zm-3.82 1L10 2H9v7.59L4.41 5 3 6.41 8.59 12 3 17.59 4.41 19 9 14.41V22h1l5.71-5.71-4.3-4.29 4.3-4.29zM11 5.83l1.88 1.88L11 9.59V5.83zm1.88 10.46L11 18.17v-3.76l1.88 1.88z"></path></g>
-<if expr="chromeos">
- <g id="end-of-life"><path d="M4.574 2.916H4.55l.01.01.014-.01zM2.5 4.968v.023a.18.18 0 0 1 .01-.013l-.01-.01zm14.585 10.49v-.024l-.01.013.01.01zm.223 1.817l-.933-.95-4.106-4.11L8.026 7.99 3.675 3.635l-.942-.941-.712-.713L1 3.002l1.733 1.733A9.056 9.056 0 0 0 1.05 9.98c0 1.95.628 3.748 1.683 5.22.574.8 1.274 1.501 2.074 2.075a8.918 8.918 0 0 0 5.218 1.684 8.918 8.918 0 0 0 5.218-1.684L16.991 19l1.02-1.021-.703-.704zM15.243 2.684A8.922 8.922 0 0 0 10.025 1a8.922 8.922 0 0 0-5.218 1.684c-.005.003 4.135 4.16 4.135 4.16l1.083-1.814L15.042 11h-1.846l4.11 4.214a8.939 8.939 0 0 0 .011-10.456 9.021 9.021 0 0 0-2.074-2.074zM12 15H7.012v-3.989L4.5 11l2.227-1.876L12 14.6v.4z" fill="#DB4437" fill-rule="evenodd"></path></g>
-</if>
<if expr="not chromeos">
<g id="web"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-5 14H4v-4h11v4zm0-5H4V9h11v4zm5 5h-4V9h4v9z"></path></g>
</if>
diff --git a/chromium/chrome/browser/resources/settings/internet_page/BUILD.gn b/chromium/chrome/browser/resources/settings/internet_page/BUILD.gn
index 936eea443b4..7b8a8fa0718 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/internet_page/BUILD.gn
@@ -27,6 +27,7 @@ js_library("internet_page") {
"../settings_page:settings_animated_pages",
"//chromeos/services/network_config/public/mojom:mojom_js_library_for_compile",
"//ui/webui/resources/cr_components/chromeos/network:mojo_interface_provider",
+ "//ui/webui/resources/cr_elements/chromeos/network:cr_network_listener_behavior",
"//ui/webui/resources/cr_elements/chromeos/network:cr_onc_types",
"//ui/webui/resources/js:assert",
"//ui/webui/resources/js:i18n_behavior",
@@ -35,7 +36,6 @@ js_library("internet_page") {
]
externs_list = [
"$externs_path/chrome_send.js",
- "$externs_path/management.js",
"$externs_path/networking_private.js",
]
extra_sources = [ "$interfaces_path/networking_private_interface.js" ]
@@ -68,7 +68,7 @@ js_library("internet_detail_page") {
"..:route",
"//ui/webui/resources/cr_elements/chromeos/network:cr_network_listener_behavior",
"//ui/webui/resources/cr_elements/chromeos/network:cr_onc_types",
- "//ui/webui/resources/cr_elements/policy:cr_policy_network_behavior",
+ "//ui/webui/resources/cr_elements/policy:cr_policy_network_behavior_mojo",
"//ui/webui/resources/js:assert",
"//ui/webui/resources/js:i18n_behavior",
]
@@ -84,7 +84,7 @@ js_library("internet_known_networks_page") {
"//ui/webui/resources/cr_elements/chromeos/network:cr_network_listener_behavior",
"//ui/webui/resources/cr_elements/chromeos/network:cr_onc_types",
"//ui/webui/resources/cr_elements/cr_action_menu:cr_action_menu",
- "//ui/webui/resources/cr_elements/policy:cr_policy_network_behavior",
+ "//ui/webui/resources/cr_elements/policy:cr_policy_network_behavior_mojo",
"//ui/webui/resources/js:assert",
]
externs_list = [ "$externs_path/networking_private.js" ]
@@ -96,7 +96,7 @@ js_library("internet_subpage") {
":internet_page_browser_proxy",
"..:route",
"//ui/webui/resources/cr_elements/chromeos/network:cr_network_listener_behavior",
- "//ui/webui/resources/cr_elements/policy:cr_policy_network_behavior",
+ "//ui/webui/resources/cr_elements/policy:cr_policy_network_behavior_mojo",
"//ui/webui/resources/js:assert",
"//ui/webui/resources/js:i18n_behavior",
"//ui/webui/resources/js/chromeos:onc_mojo",
@@ -111,9 +111,10 @@ js_library("network_proxy_section") {
"../controls:settings_checkbox",
"../prefs:prefs_behavior",
"//ui/webui/resources/cr_components/chromeos/network:network_proxy",
- "//ui/webui/resources/cr_elements/chromeos/network:cr_onc_types",
+ "//ui/webui/resources/cr_elements/policy:cr_policy_network_behavior_mojo",
"//ui/webui/resources/js:assert",
"//ui/webui/resources/js:i18n_behavior",
+ "//ui/webui/resources/js/chromeos:onc_mojo",
"//ui/webui/resources/js/cr/ui:focus_without_ink",
]
}
@@ -122,7 +123,6 @@ js_library("network_summary") {
deps = [
"//ui/webui/resources/cr_elements/chromeos/network:cr_network_listener_behavior",
"//ui/webui/resources/cr_elements/chromeos/network:cr_onc_types",
- "//ui/webui/resources/cr_elements/policy:cr_policy_network_behavior",
"//ui/webui/resources/js:assert",
"//ui/webui/resources/js/chromeos:onc_mojo",
]
@@ -132,7 +132,7 @@ js_library("network_summary") {
js_library("network_summary_item") {
deps = [
"//ui/webui/resources/cr_elements/chromeos/network:cr_onc_types",
- "//ui/webui/resources/cr_elements/policy:cr_policy_network_behavior",
+ "//ui/webui/resources/cr_elements/policy:cr_policy_network_behavior_mojo",
"//ui/webui/resources/js:assert",
"//ui/webui/resources/js:i18n_behavior",
"//ui/webui/resources/js/chromeos:onc_mojo",
@@ -142,9 +142,9 @@ js_library("network_summary_item") {
js_library("tether_connection_dialog") {
deps = [
- "//ui/webui/resources/cr_elements/chromeos/network:cr_onc_types",
"//ui/webui/resources/cr_elements/cr_dialog:cr_dialog",
"//ui/webui/resources/js:cr",
"//ui/webui/resources/js:i18n_behavior",
+ "//ui/webui/resources/js/chromeos:onc_mojo",
]
}
diff --git a/chromium/chrome/browser/resources/settings/internet_page/internet_detail_page.html b/chromium/chrome/browser/resources/settings/internet_page/internet_detail_page.html
index a49a1d32fe9..c78ca56e50b 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/internet_detail_page.html
+++ b/chromium/chrome/browser/resources/settings/internet_page/internet_detail_page.html
@@ -4,7 +4,7 @@
<link rel="import" href="chrome://resources/cr_components/chromeos/network/network_choose_mobile.html">
<link rel="import" href="chrome://resources/cr_components/chromeos/network/network_ip_config.html">
<link rel="import" href="chrome://resources/cr_components/chromeos/network/network_nameservers.html">
-<link rel="import" href="chrome://resources/cr_components/chromeos/network/network_property_list.html">
+<link rel="import" href="chrome://resources/cr_components/chromeos/network/network_property_list_mojo.html">
<link rel="import" href="chrome://resources/cr_components/chromeos/network/network_siminfo.html">
<link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_network_icon.html">
<link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_network_listener_behavior.html">
@@ -14,8 +14,9 @@
<link rel="import" href="chrome://resources/cr_elements/cr_toggle/cr_toggle.html">
<link rel="import" href="chrome://resources/cr_elements/icons.html">
<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_indicator.html">
-<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network_behavior.html">
-<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network_indicator.html">
+<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network_behavior_mojo.html">
+<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network_indicator_mojo.html">
+<link rel="import" href="chrome://resources/html/chromeos/onc_mojo.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-collapse/iron-collapse.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
@@ -23,6 +24,7 @@
<link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner-lite.html">
<link rel="import" href="../controls/controlled_button.html">
<link rel="import" href="../controls/settings_toggle_button.html">
+<link rel="import" href="../i18n_setup.html">
<link rel="import" href="../prefs/prefs.html">
<link rel="import" href="../route.html">
<link rel="import" href="internet_page_browser_proxy.html">
@@ -49,7 +51,7 @@
margin-inline-start: var(--settings-control-label-spacing);
}
- cr-policy-network-indicator,
+ cr-policy-network-indicator-mojo,
cr-policy-indicator,
cr-policy-pref-indicator {
margin-inline-start: var(--settings-controlled-by-spacing);
@@ -76,72 +78,74 @@
<div class="start layout horizontal center">
<cr-network-icon
show-technology-badge="[[showTechnologyBadge_]]"
- network-state="[[getNetworkState_(networkProperties_)]]">
+ network-state="[[getNetworkState_(managedProperties_)]]">
</cr-network-icon>
<div id="networkState" class="title settings-box-text"
- connected$="[[isConnectedState_(networkProperties_)]]"
- error$="[[outOfRange_]]">
- [[getStateText_(networkProperties_, outOfRange_)]]
+ connected$="[[isConnectedState_(managedProperties_)]]"
+ error$="[[isConnectionErrorState_(
+ managedProperties_, outOfRange_)]]">
+ [[getStateText_(managedProperties_, propertiesReceived_,
+ outOfRange_)]]
</div>
<template is="dom-if"
- if="[[isPolicySource(networkProperties_.Source))]]">
+ if="[[isPolicySource(managedProperties_.source))]]">
<cr-policy-indicator
indicator-type="[[getIndicatorTypeForSource(
- networkProperties_.Source)]]">
+ managedProperties_.source)]]">
</cr-policy-indicator>
</template>
</div>
<cr-button on-click="onForgetTap_"
- hidden$="[[!showForget_(networkProperties_)]]"
- disabled="[[disableForget_(networkProperties_,
+ hidden$="[[!showForget_(managedProperties_)]]"
+ disabled="[[disableForget_(managedProperties_,
prefs.vpn_config_allowed)]]">
$i18n{networkButtonForget}
</cr-button>
<cr-button on-click="onViewAccountTap_"
- hidden$="[[!showViewAccount_(networkProperties_)]]">
+ hidden$="[[!showViewAccount_(managedProperties_)]]">
$i18n{networkButtonViewAccount}
</cr-button>
<cr-button on-click="onActivateTap_"
- hidden$="[[!showActivate_(networkProperties_)]]">
+ hidden$="[[!showActivate_(managedProperties_)]]">
$i18n{networkButtonActivate}
</cr-button>
<cr-button on-click="onConfigureTap_"
- hidden$="[[!showConfigure_(networkProperties_, globalPolicy,
+ hidden$="[[!showConfigure_(managedProperties_, globalPolicy,
managedNetworkAvailable)]]"
- disabled="[[disableConfigure_(networkProperties_,
+ disabled="[[disableConfigure_(managedProperties_,
prefs.vpn_config_allowed)]]">
$i18n{networkButtonConfigure}
</cr-button>
<!-- Use policy properties from vpn_config_allowed to indicate when that
pref disables buttons in this row. -->
<controlled-button id="connect" action-button on-click="onConnectTap_"
- hidden$="[[!showConnect_(networkProperties_, globalPolicy,
+ hidden$="[[!showConnect_(managedProperties_, globalPolicy,
managedNetworkAvailable)]]"
- disabled="[[!enableConnect_(networkProperties_, defaultNetwork,
- networkPropertiesReceived_, outOfRange_, globalPolicy,
+ disabled="[[!enableConnect_(managedProperties_, defaultNetwork,
+ propertiesReceived_, outOfRange_, globalPolicy,
managedNetworkAvailable)]]"
label="$i18n{networkButtonConnect}"
- pref="[[getFakeVpnConfigPrefForEnforcement_(networkProperties_,
+ pref="[[getFakeVpnConfigPrefForEnforcement_(managedProperties_,
prefs.vpn_config_allowed)]]">
</controlled-button>
<controlled-button id="disconnect" action-button
on-click="onDisconnectTap_"
- hidden$="[[!showDisconnect_(networkProperties_)]]"
+ hidden$="[[!showDisconnect_(managedProperties_)]]"
label="$i18n{networkButtonDisconnect}"
- pref="[[getFakeVpnConfigPrefForEnforcement_(networkProperties_,
+ pref="[[getFakeVpnConfigPrefForEnforcement_(managedProperties_,
prefs.vpn_config_allowed)]]">
</controlled-button>
</div>
<!-- Disabled by policy / Shared messages. -->
<div class="settings-box continuation"
- hidden$="[[!isBlockedByPolicy_(networkProperties_, globalPolicy,
+ hidden$="[[!isBlockedByPolicy_(managedProperties_, globalPolicy,
managedNetworkAvailable)]]">
<iron-icon class="policy" icon="cr20:domain"></iron-icon>
<div class="settings-box-text">$i18n{networkConnectNotAllowed}</div>
</div>
<div class="settings-box continuation settings-box-text"
- hidden$="[[!showShared_(networkProperties_, globalPolicy,
+ hidden$="[[!showShared_(managedProperties_, globalPolicy,
managedNetworkAvailable)]]">
$i18n{networkShared}
</div>
@@ -161,37 +165,37 @@
<template is="dom-if" if="[[!isSecondaryUser_]]">
<!-- Prefer this network. -->
<template is="dom-if"
- if="[[showPreferNetwork_(networkProperties_, globalPolicy,
+ if="[[showPreferNetwork_(managedProperties_, globalPolicy,
managedNetworkAvailable)]]">
<div class="settings-box" on-click="onPreferNetworkRowClicked_"
actionable$="[[!isNetworkPolicyEnforced(
- networkProperties_.Priority)]]">
+ managedProperties_.priority)]]">
<div id="preferNetworkToggleLabel" class="start settings-box-text">
$i18n{networkPrefer}
</div>
- <cr-policy-network-indicator
- property="[[networkProperties_.Priority]]">
- </cr-policy-network-indicator>
+ <cr-policy-network-indicator-mojo
+ property="[[managedProperties_.priority]]">
+ </cr-policy-network-indicator-mojo>
<cr-toggle id="preferNetworkToggle" checked="{{preferNetwork_}}"
disabled="[[isNetworkPolicyEnforced(
- networkProperties_.Priority)]]"
+ managedProperties_.priority)]]"
aria-labelledby="preferNetworkToggleLabel">
</cr-toggle>
</div>
</template>
<!-- Autoconnect. -->
<template is="dom-if"
- if="[[showAutoConnect_(networkProperties_, globalPolicy,
+ if="[[showAutoConnect_(managedProperties_, globalPolicy,
managedNetworkAvailable)]]">
<settings-toggle-button
id="autoConnectToggle"
- pref="{{autoConnect_}}"
- label="[[getAutoConnectToggleLabel_(networkProperties_)]]">
+ pref="{{autoConnectPref_}}"
+ label="[[getAutoConnectToggleLabel_(managedProperties_)]]">
</settings-toggle-button>
<!-- Hidden Network Warning -->
<template is="dom-if"
- if="[[showHiddenNetworkWarning_(autoConnect_.*,
- networkProperties_)]]"
+ if="[[showHiddenNetworkWarning_(autoConnectPref_.*,
+ managedProperties_)]]"
restamp>
<div class="warning">
<iron-icon icon="cr:warning"></iron-icon>
@@ -201,47 +205,48 @@
</template>
<!-- Always-on VPN. -->
<template is="dom-if"
- if="[[showAlwaysOnVpn_(networkProperties_)]]">
+ if="[[showAlwaysOnVpn_(managedProperties_)]]">
<settings-toggle-button id="alwaysOnVpnToggle"
pref="{{alwaysOnVpn_}}"
label="$i18n{networkAlwaysOnVpn}">
</settings-toggle-button>
</template>
<!-- Data roaming (Cellular only). -->
- <template is="dom-if" if="[[isCellular_(networkProperties_)]]">
+ <template is="dom-if" if="[[isCellular_(managedProperties_)]]">
<settings-toggle-button id="allowDataRoaming"
pref="{{prefs.cros.signed.data_roaming_enabled}}"
label="$i18n{networkAllowDataRoaming}"
- sub-label="[[getRoamingDetails_(networkProperties_)]]">
+ sub-label="[[getRoamingDetails_(managedProperties_)]]">
</settings-toggle-button>
</template>
<!-- SIM Info (Cellular only). -->
- <template is="dom-if" if="[[showCellularSim_(networkProperties_)]]"
+ <template is="dom-if" if="[[showCellularSim_(managedProperties_)]]"
restamp>
<div class="settings-box single-column stretch">
- <network-siminfo on-siminfo-change="onNetworkPropertyChange_">
+ <network-siminfo device-state="[[deviceState_]]">
</network-siminfo>
</div>
</template>
<!-- IP Address. -->
<div class="settings-box two-line single-column stretch settings-box-text"
- hidden$="[[!showIpAddress_(ipAddress_, networkProperties_)]]">
+ hidden$="[[!showIpAddress_(ipAddress_, managedProperties_)]]">
<div>$i18n{networkIPAddress}</div>
<div class="secondary">[[ipAddress_]]</div>
</div>
<!-- Properties to always show if present. -->
- <template is="dom-if" if="[[hasInfoFields_(networkProperties_)]]">
+ <template is="dom-if" if="[[hasInfoFields_(managedProperties_)]]">
<div class="settings-box single-column stretch">
- <network-property-list
- fields="[[getInfoFields_(networkProperties_)]]"
- edit-field-types="[[getInfoEditFieldTypes_(networkProperties_)]]"
- property-dict="[[networkProperties_]]"
+ <network-property-list-mojo
+ fields="[[getInfoFields_(managedProperties_)]]"
+ edit-field-types="[[getInfoEditFieldTypes_(managedProperties_)]]"
+ property-dict="[[managedProperties_]]"
on-property-change="onNetworkPropertyChange_">
- </network-property-list>
+ </network-property-list-mojo>
</div>
</template>
- <template is="dom-if" if="[[showAdvanced_(networkProperties_)]]">
+ <template is="dom-if"
+ if="[[showAdvanced_(managedProperties_, propertiesReceived_)]]">
<!-- Advanced toggle. -->
<cr-expand-button
alt="$i18n{networkSectionAdvancedA11yLabel}"
@@ -253,24 +258,24 @@
<!-- Advanced section -->
<iron-collapse opened="[[advancedExpanded_]]">
<div class="settings-box single-column stretch indented first"
- hidden$="[[!hasAdvancedOrDeviceFields_(networkProperties_)]]">
+ hidden$="[[!hasAdvancedOrDeviceFields_(managedProperties_)]]">
<!-- Advanced properties -->
- <network-property-list
- hidden$="[[!hasAdvancedFields_(networkProperties_)]]"
- fields="[[getAdvancedFields_(networkProperties_)]]"
- property-dict="[[networkProperties_]]">
- </network-property-list>
+ <network-property-list-mojo
+ hidden$="[[!hasAdvancedFields_(managedProperties_)]]"
+ fields="[[getAdvancedFields_(managedProperties_)]]"
+ property-dict="[[managedProperties_]]">
+ </network-property-list-mojo>
<!-- Device properties -->
- <network-property-list
- hidden$="[[!hasDeviceFields_(networkProperties_)]]"
- fields="[[getDeviceFields_(networkProperties_)]]"
- property-dict="[[networkProperties_]]">
- </network-property-list>
+ <network-property-list-mojo
+ hidden$="[[!hasDeviceFields_(managedProperties_)]]"
+ fields="[[getDeviceFields_(managedProperties_)]]"
+ property-dict="[[managedProperties_]]">
+ </network-property-list-mojo>
</div>
</iron-collapse>
</template>
- <template is="dom-if" if="[[hasNetworkSection_(networkProperties_,
+ <template is="dom-if" if="[[hasNetworkSection_(managedProperties_,
globalPolicy, managedNetworkAvailable)]]">
<!-- Network toggle -->
<cr-expand-button
@@ -282,7 +287,7 @@
$i18n{networkSectionNetwork}
</div>
<template is="dom-if"
- if="[[showScanningSpinner_(networkProperties_)]]">
+ if="[[showScanningSpinner_(managedProperties_, deviceState_)]]">
<paper-spinner-lite active></paper-spinner-lite>
</template>
</div>
@@ -292,35 +297,41 @@
<div class="settings-box single-column stretch indented first">
<!-- Choose Mobile Network (Cellular only). -->
<template is="dom-if"
- if="[[showCellularChooseNetwork_(networkProperties_)]]">
- <network-choose-mobile
- networking-private="[[networkingPrivate]]"
- network-properties="[[networkProperties_]]">
+ if="[[showCellularChooseNetwork_(managedProperties_)]]">
+ <network-choose-mobile device-state="[[deviceState_]]"
+ managed-properties="[[managedProperties_]]">
</network-choose-mobile>
</template>
<!-- APN -->
- <template is="dom-if" if="[[isCellular_(networkProperties_)]]">
- <network-apnlist on-apn-change="onNetworkPropertyChange_"
- network-properties="[[networkProperties_]]">
+ <template is="dom-if" if="[[isCellular_(managedProperties_)]]">
+ <network-apnlist on-apn-change="onApnChange_"
+ managed-properties="[[managedProperties_]]">
</network-apnlist>
</template>
<!-- IP Config, Nameservers -->
<template is="dom-if"
- if="[[isRememberedOrConnected_(networkProperties_)]]">
+ if="[[isRememberedOrConnected_(managedProperties_)]]">
<network-ip-config on-ip-change="onIPConfigChange_"
- network-properties="[[networkProperties_]]">
+ managed-properties="[[managedProperties_]]">
</network-ip-config>
<network-nameservers on-nameservers-change="onIPConfigChange_"
- network-properties="[[networkProperties_]]">
+ managed-properties="[[managedProperties_]]">
</network-nameservers>
</template>
</div>
+
+ <!-- MAC Address. -->
+ <div class="settings-box two-line single-column stretch indented"
+ hidden$="[[!deviceState_.macAddress]]">
+ <div>$i18n{OncMacAddress}</div>
+ <div class="secondary">[[deviceState_.macAddress]]</div>
+ </div>
</iron-collapse>
</template>
- <template is="dom-if" if="[[hasProxySection_(networkProperties_,
+ <template is="dom-if" if="[[hasProxySection_(managedProperties_,
globalPolicy, managedNetworkAvailable)]]">
<!-- Proxy toggle -->
<cr-expand-button
@@ -333,17 +344,19 @@
<iron-collapse opened="[[proxyExpanded_]]">
<network-proxy-section prefs="{{prefs}}"
on-proxy-change="onProxyChange_"
- network-properties="[[networkProperties_]]">
+ managed-properties="[[managedProperties_]]">
</network-proxy-section>
</iron-collapse>
</template>
</template>
- <tether-connection-dialog id="tetherDialog"
- network-properties="[[networkProperties_]]"
- on-tether-connect="onTetherConnect_"
- out-of-range="[[outOfRange_]]">
- </tether-connection-dialog>
+ <template is="dom-if" if="[[isTether_(managedProperties_)]]" restamp>
+ <tether-connection-dialog id="tetherDialog"
+ managed-properties="[[managedProperties_]]"
+ on-tether-connect="onTetherConnect_"
+ out-of-range="[[outOfRange_]]">
+ </tether-connection-dialog>
+ </template>
</template>
<script src="internet_detail_page.js"></script>
</dom-module>
diff --git a/chromium/chrome/browser/resources/settings/internet_page/internet_detail_page.js b/chromium/chrome/browser/resources/settings/internet_page/internet_detail_page.js
index bf2d66f205c..3dd71d9ff20 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/internet_detail_page.js
+++ b/chromium/chrome/browser/resources/settings/internet_page/internet_detail_page.js
@@ -17,7 +17,7 @@ Polymer({
behaviors: [
CrNetworkListenerBehavior,
- CrPolicyNetworkBehavior,
+ CrPolicyNetworkBehaviorMojo,
settings.RouteObserverBehavior,
I18nBehavior,
],
@@ -32,15 +32,16 @@ Polymer({
notify: true,
},
- /**
- * The current properties for the network matching |guid|. Note: This may
- * become set to |undefined| after it is initially set if the network is no
- * longer visible, so always test that it is set before accessing it.
- * @private {!CrOnc.NetworkProperties|undefined}
- */
- networkProperties_: {
+ /** @private {!chromeos.networkConfig.mojom.ManagedProperties|undefined} */
+ managedProperties_: {
+ type: Object,
+ observer: 'managedPropertiesChanged_',
+ },
+
+ /** @private {?OncMojo.DeviceStateProperties} */
+ deviceState_: {
type: Object,
- observer: 'networkPropertiesChanged_',
+ value: null,
},
/**
@@ -90,12 +91,8 @@ Polymer({
value: null,
},
- /** @type {!chrome.networkingPrivate.GlobalPolicy|undefined} */
- globalPolicy: {
- type: Object,
- value: null,
- observer: 'globalPolicyChanged_',
- },
+ /** @type {!chromeos.networkConfig.mojom.GlobalPolicy|undefined} */
+ globalPolicy: Object,
/**
* Whether a managed network is available in the visible network list.
@@ -116,9 +113,9 @@ Polymer({
* The network AutoConnect state as a fake preference object.
* @private {!chrome.settingsPrivate.PrefObject|undefined}
*/
- autoConnect_: {
+ autoConnectPref_: {
type: Object,
- observer: 'autoConnectChanged_',
+ observer: 'autoConnectPrefChanged_',
},
/**
@@ -180,8 +177,11 @@ Polymer({
observers: [
'updateAlwaysOnVpnPrefValue_(prefs.arc.vpn.always_on.*)',
- 'updateAlwaysOnVpnPrefEnforcement_(prefs.vpn_config_allowed.*)',
- 'autoConnectChanged_(autoConnect_.*)', 'alwaysOnVpnChanged_(alwaysOnVpn_.*)'
+ 'updateAlwaysOnVpnPrefEnforcement_(managedProperties_,' +
+ 'prefs.vpn_config_allowed.*)',
+ 'updateAutoConnectPref_(globalPolicy)',
+ 'autoConnectPrefChanged_(autoConnectPref_.*)',
+ 'alwaysOnVpnChanged_(alwaysOnVpn_.*)',
],
/** @private {boolean} */
@@ -192,12 +192,12 @@ Polymer({
* prevents setProperties from being called when setting default properties.
* @private {boolean}
*/
- networkPropertiesReceived_: false,
+ propertiesReceived_: false,
/**
* Set in currentRouteChanged() if the showConfigure URL query
* parameter is set to true. The dialog cannot be shown until the
- * network properties have been fetched in networkPropertiesChanged_().
+ * network properties have been fetched in managedPropertiesChanged_().
* @private {boolean}
*/
shouldShowConfigureWhenNetworkLoaded_: false,
@@ -209,16 +209,15 @@ Polymer({
* This UI will use both the networkingPrivate extension API and the
* networkConfig mojo API until we provide all of the required functionality
* in networkConfig. TODO(stevenjb): Remove use of networkingPrivate api.
- * @private {?chromeos.networkConfig.mojom.CrosNetworkConfigProxy}
+ * @private {?chromeos.networkConfig.mojom.CrosNetworkConfigRemote}
*/
- networkConfigProxy_: null,
+ networkConfig_: null,
/** @override */
created: function() {
this.browserProxy_ = settings.InternetPageBrowserProxyImpl.getInstance();
- this.networkConfigProxy_ =
- network_config.MojoInterfaceProviderImpl.getInstance()
- .getMojoServiceProxy();
+ this.networkConfig_ = network_config.MojoInterfaceProviderImpl.getInstance()
+ .getMojoServiceRemote();
},
/**
@@ -241,28 +240,23 @@ Polymer({
this.shouldShowConfigureWhenNetworkLoaded_ =
queryParams.get('showConfigure') == 'true';
- const type = /** @type {!chrome.networkingPrivate.NetworkType} */ (
- queryParams.get('type')) ||
- CrOnc.Type.WI_FI;
+ const type = queryParams.get('type') || 'WiFi';
const name = queryParams.get('name') || type;
this.init(guid, type, name);
},
/**
* @param {string} guid
- * @param {!chrome.networkingPrivate.NetworkType} type
+ * @param {string} type
* @param {string} name
- * @private
*/
init: function(guid, type, name) {
this.guid = guid;
- // Set basic networkProperties until they are loaded.
- this.networkPropertiesReceived_ = false;
- this.networkProperties_ = {
- GUID: this.guid,
- Type: type,
- Name: {Active: name},
- };
+ // Set default properties until they are loaded.
+ this.propertiesReceived_ = false;
+ this.deviceState_ = null;
+ this.managedProperties_ = OncMojo.getDefaultManagedProperties(
+ OncMojo.getNetworkTypeFromString(type), this.guid, name);
this.didSetFocus_ = false;
this.getNetworkDetails_();
},
@@ -281,8 +275,8 @@ Polymer({
// Clear network properties before navigating away to ensure that a future
// navigation back to the details page does not show a flicker of
// incorrect text. See https://crbug.com/905986.
- this.networkProperties_ = undefined;
- this.networkPropertiesReceived_ = false;
+ this.managedProperties_ = undefined;
+ this.propertiesReceived_ = false;
settings.navigateToPreviousRoute();
});
@@ -293,64 +287,69 @@ Polymer({
* @param {!Array<OncMojo.NetworkStateProperties>} networks
*/
onActiveNetworksChanged: function(networks) {
- if (!this.guid || !this.networkProperties_) {
+ if (!this.guid || !this.managedProperties_) {
return;
}
// If the network was or is active, request an update.
- if (this.networkProperties_.ConnectionState !=
- CrOnc.ConnectionState.NOT_CONNECTED ||
+ if (this.managedProperties_.connectionState !=
+ mojom.ConnectionStateType.kNotConnected ||
networks.find(network => network.guid == this.guid)) {
this.getNetworkDetails_();
}
},
+ /**
+ * CrosNetworkConfigObserver impl
+ * @param {!chromeos.networkConfig.mojom.NetworkStateProperties} network
+ */
+ onNetworkStateChanged: function(network) {
+ if (!this.guid || !this.managedProperties_) {
+ return;
+ }
+ if (network.guid == this.guid) {
+ this.getNetworkDetails_();
+ }
+ },
+
/** CrosNetworkConfigObserver impl */
onNetworkStateListChanged: function() {
+ if (!this.guid || !this.managedProperties_) {
+ return;
+ }
this.checkNetworkExists_();
},
/** CrosNetworkConfigObserver impl */
onDeviceStateListChanged: function() {
- if (this.guid) {
- this.getNetworkDetails_();
+ if (!this.guid || !this.managedProperties_) {
+ return;
}
- },
-
- /**
- * @param {!chrome.networkingPrivate.GlobalPolicy} globalPolicy
- * @private
- */
- globalPolicyChanged_: function(globalPolicy) {
- this.updateAutoConnectPref_(
- !!(this.autoConnect_ && this.autoConnect_.value), globalPolicy);
+ this.getDeviceState_();
+ this.getNetworkDetails_();
},
/** @private */
- networkPropertiesChanged_: function() {
- if (!this.networkProperties_) {
+ managedPropertiesChanged_: function() {
+ if (!this.managedProperties_) {
return;
}
+ this.updateAutoConnectPref_();
- // Update autoConnect if it has changed. Default value is false.
- this.updateAutoConnectPref_(
- CrOnc.getAutoConnect(this.networkProperties_), this.globalPolicy);
-
- // Update preferNetwork if it has changed. Default value is false.
- const priority = /** @type {number} */ (
- CrOnc.getActiveValue(this.networkProperties_.Priority) || 0);
- const preferNetwork = priority > 0;
- if (preferNetwork != this.preferNetwork_) {
- this.preferNetwork_ = preferNetwork;
+ const priority = this.managedProperties_.priority;
+ if (priority) {
+ const preferNetwork = priority.activeValue > 0;
+ if (preferNetwork != this.preferNetwork_) {
+ this.preferNetwork_ = preferNetwork;
+ }
}
- // Set the IPAddress property to the IPV4 Address.
- const ipv4 =
- CrOnc.getIPConfigForType(this.networkProperties_, CrOnc.IPType.IPV4);
- this.ipAddress_ = (ipv4 && ipv4.IPAddress) || '';
+ // Set the IPAddress property to the IPv4 Address.
+ const ipv4 = OncMojo.getIPConfigForType(this.managedProperties_, 'IPv4');
+ this.ipAddress_ = (ipv4 && ipv4.ipAddress) || '';
// Update the detail page title.
- this.parentNode.pageTitle = CrOnc.getNetworkName(this.networkProperties_);
-
+ const networkName = OncMojo.getNetworkName(this.managedProperties_);
+ this.parentNode.pageTitle = networkName;
Polymer.dom.flush();
if (!this.didSetFocus_) {
@@ -364,49 +363,69 @@ Polymer({
}
if (this.shouldShowConfigureWhenNetworkLoaded_ &&
- this.networkProperties_.Tether) {
+ this.managedProperties_.type == mojom.NetworkType.kTether) {
// Set |this.shouldShowConfigureWhenNetworkLoaded_| back to false to
// ensure that the Tether dialog is only shown once.
this.shouldShowConfigureWhenNetworkLoaded_ = false;
- this.showTetherDialog_();
+ // Async call to ensure dialog is stamped.
+ setTimeout(() => this.showTetherDialog_());
}
},
/** @private */
- autoConnectChanged_: function() {
- if (!this.networkProperties_ || !this.guid) {
+ getDeviceState_: function() {
+ if (!this.managedProperties_) {
return;
}
- const onc = this.getEmptyNetworkProperties_();
- CrOnc.setTypeProperty(onc, 'AutoConnect', !!this.autoConnect_.value);
- this.setNetworkProperties_(onc);
+ const type = this.managedProperties_.type;
+ this.networkConfig_.getDeviceStateList().then(response => {
+ const devices = response.result;
+ this.deviceState_ = devices.find(device => device.type == type) || null;
+ });
+ },
+
+ /** @private */
+ autoConnectPrefChanged_: function() {
+ if (!this.propertiesReceived_) {
+ return;
+ }
+ const config = {};
+ config.autoConnect = {value: !!this.autoConnectPref_.value};
+ this.setMojoNetworkProperties_(config);
},
/**
* Updates auto-connect pref value.
- * @param {boolean} value
- * @param {!chrome.networkingPrivate.GlobalPolicy|undefined} globalPolicy
* @private
*/
- updateAutoConnectPref_: function(value, globalPolicy) {
+ updateAutoConnectPref_: function() {
+ if (!this.managedProperties_) {
+ return;
+ }
+ const autoConnect = OncMojo.getManagedAutoConnect(this.managedProperties_);
+ if (!autoConnect) {
+ return;
+ }
+
let enforcement;
let controlledBy;
-
- if (this.isAutoConnectEnforcedByPolicy(
- this.networkProperties_, globalPolicy)) {
+ if (autoConnect.enforced ||
+ (!!this.globalPolicy &&
+ !!this.globalPolicy.allowOnlyPolicyNetworksToAutoconnect)) {
enforcement = chrome.settingsPrivate.Enforcement.ENFORCED;
controlledBy = chrome.settingsPrivate.ControlledBy.DEVICE_POLICY;
}
- if (this.autoConnect_ && this.autoConnect_.value == value &&
- enforcement == this.autoConnect_.enforcement &&
- controlledBy == this.autoConnect_.controlledBy) {
+ if (this.autoConnectPref_ &&
+ this.autoConnectPref_.value == autoConnect.activeValue &&
+ enforcement == this.autoConnectPref_.enforcement &&
+ controlledBy == this.autoConnectPref_.controlledBy) {
return;
}
const newPrefValue = {
key: 'fakeAutoConnectPref',
- value: value,
+ value: autoConnect.activeValue,
type: chrome.settingsPrivate.PrefType.BOOLEAN,
};
if (enforcement) {
@@ -414,95 +433,83 @@ Polymer({
newPrefValue.controlledBy = controlledBy;
}
- this.autoConnect_ = newPrefValue;
+ this.autoConnectPref_ = newPrefValue;
},
/** @private */
preferNetworkChanged_: function() {
- if (!this.networkProperties_ || !this.guid) {
+ if (!this.propertiesReceived_) {
return;
}
- const onc = this.getEmptyNetworkProperties_();
- onc.Priority = this.preferNetwork_ ? 1 : 0;
- this.setNetworkProperties_(onc);
+ const config = {};
+ config.priority = {value: this.preferNetwork_ ? 1 : 0};
+ this.setMojoNetworkProperties_(config);
},
/** @private */
checkNetworkExists_: function() {
const filter = {
- networkType: CrOnc.Type.ALL,
- visible: true,
- configured: false
+ filter: mojom.FilterType.kVisible,
+ networkType: mojom.NetworkType.kAll,
+ limit: mojom.kNoLimit,
};
- this.networkingPrivate.getNetworks(filter, networks => {
- if (networks.find(network => network.GUID == this.guid)) {
+ this.networkConfig_.getNetworkState(this.guid).then(response => {
+ if (response.result) {
+ // Don't update the state, a change event will trigger the update.
return;
}
this.outOfRange_ = true;
- if (this.networkProperties_) {
+ if (this.managedProperties_) {
// Set the connection state since we won't receive an update for a non
// existent network.
- this.networkProperties_.ConnectionState =
- CrOnc.ConnectionState.NOT_CONNECTED;
+ this.managedProperties_.connectionState =
+ mojom.ConnectionStateType.kNotConnected;
}
});
},
- /**
- * Calls networkingPrivate.getProperties for this.guid.
- * @private
- */
+ /** @private */
getNetworkDetails_: function() {
assert(this.guid);
if (this.isSecondaryUser_) {
- this.networkConfigProxy_.getNetworkState(this.guid).then(response => {
+ this.networkConfig_.getNetworkState(this.guid).then(response => {
this.getStateCallback_(response.result);
});
} else {
- this.networkingPrivate.getManagedProperties(
- this.guid, this.getPropertiesCallback_.bind(this));
+ this.networkConfig_.getManagedProperties(this.guid).then(response => {
+ this.getPropertiesCallback_(response.result);
+ });
}
},
/**
- * networkingPrivate.getProperties callback.
- * @param {!CrOnc.NetworkProperties} properties The network properties.
+ * @param {?mojom.ManagedProperties} properties
* @private
*/
getPropertiesCallback_: function(properties) {
- if (chrome.runtime.lastError) {
- const message = chrome.runtime.lastError.message;
- if (message == 'Error.InvalidNetworkGuid') {
- console.error('Details page: GUID no longer exists: ' + this.guid);
- } else {
- console.error(
- 'Unexpected networkingPrivate.getManagedProperties error: ' +
- message + ' For: ' + this.guid);
- }
- this.close();
- return;
- }
-
// Details page was closed while request was in progress, ignore the result.
if (!this.guid) {
return;
}
if (!properties) {
- // Edge case, may occur when disabling. Close this.
+ console.error('Details page: GUID no longer exists: ' + this.guid);
this.close();
return;
}
+ this.managedProperties_ = properties;
// Detail page should not be shown when Arc VPN is not connected.
- if (this.isArcVpn_(properties) && !this.isConnectedState_(properties)) {
+ if (this.isArcVpn_(this.managedProperties_) &&
+ !this.isConnectedState_(this.managedProperties_)) {
this.guid = '';
this.close();
}
-
- this.networkProperties_ = properties;
- this.networkPropertiesReceived_ = true;
+ this.propertiesReceived_ = true;
this.outOfRange_ = false;
+ if (!this.deviceState_) {
+ this.getDeviceState_();
+ }
},
/**
@@ -515,57 +522,38 @@ Polymer({
this.close();
return;
}
- const type = /** @type {CrOnc.Type} */ (
- OncMojo.getNetworkTypeString(networkState.type));
-
- let connectionState;
- switch (networkState.connectionState) {
- case mojom.ConnectionStateType.kOnline:
- case mojom.ConnectionStateType.kConnected:
- case mojom.ConnectionStateType.kPortal:
- connectionState = CrOnc.ConnectionState.CONNECTED;
- break;
- case mojom.ConnectionStateType.kConnecting:
- connectionState = CrOnc.ConnectionState.CONNECTING;
- break;
- case mojom.ConnectionStateType.kNotConnected:
- connectionState = CrOnc.ConnectionState.NOT_CONNECTED;
- break;
- }
-
- this.networkProperties_ = {
- GUID: networkState.guid,
- Name: {Active: networkState.name},
- Type: type,
- Connectable: networkState.connectable,
- ConnectionState: connectionState,
- };
- this.networkPropertiesReceived_ = true;
+ const managedProperties = OncMojo.getDefaultManagedProperties(
+ networkState.type, networkState.guid, networkState.name);
+ managedProperties.connectable = networkState.connectable;
+ managedProperties.connectionState = networkState.connectionState;
+ this.managedProperties_ = managedProperties;
+
+ this.propertiesReceived_ = true;
this.outOfRange_ = false;
},
/**
- * @param {!CrOnc.NetworkProperties} properties
+ * @param {!mojom.ManagedProperties} properties
* @return {!OncMojo.NetworkStateProperties|undefined}
*/
getNetworkState_: function(properties) {
- return properties ? OncMojo.oncPropertiesToNetworkState(properties) :
- undefined;
+ if (!properties) {
+ return undefined;
+ }
+ return OncMojo.managedPropertiesToNetworkState(properties);
},
/**
- * @param {!chrome.networkingPrivate.NetworkConfigProperties} onc The ONC
- * network properties.
+ * @param {!mojom.ConfigProperties} config
* @private
*/
- setNetworkProperties_: function(onc) {
- if (!this.networkPropertiesReceived_) {
+ setMojoNetworkProperties_: function(config) {
+ if (!this.propertiesReceived_ || !this.guid) {
return;
}
-
- assert(this.guid);
- this.networkingPrivate.setProperties(this.guid, onc, () => {
- if (chrome.runtime.lastError) {
+ this.networkConfig_.setProperties(this.guid, config).then(response => {
+ if (!response.success) {
+ console.error('Unable to set properties: ' + JSON.stringify(config));
// An error typically indicates invalid input; request the properties
// to update any invalid fields.
this.getNetworkDetails_();
@@ -574,279 +562,338 @@ Polymer({
},
/**
- * @return {!chrome.networkingPrivate.NetworkConfigProperties} An ONC
- * dictionary with just the Type property set. Used for passing properties
- * to setNetworkProperties_.
- * @private
- */
- getEmptyNetworkProperties_: function() {
- const type = this.networkProperties_ ? this.networkProperties_.Type :
- CrOnc.Type.WI_FI;
- return {Type: type};
- },
-
- /**
- * @param {!CrOnc.NetworkProperties} networkProperties
+ * @param {!mojom.ManagedProperties} managedProperties
+ * @param {boolean} propertiesReceived
* @param {boolean} outOfRange
* @return {string} The text to display for the network connection state.
* @private
*/
- getStateText_: function(networkProperties, outOfRange) {
- if (!networkProperties || !networkProperties.ConnectionState) {
+ getStateText_: function(managedProperties, propertiesReceived, outOfRange) {
+ if (!managedProperties || !propertiesReceived) {
return '';
}
if (outOfRange) {
- return networkProperties.Type == CrOnc.Type.TETHER ?
+ return managedProperties.type == mojom.NetworkType.kTether ?
this.i18n('tetherPhoneOutOfRange') :
this.i18n('networkOutOfRange');
}
- return this.i18n('Onc' + networkProperties.ConnectionState);
+ if (managedProperties.type == mojom.NetworkType.kCellular &&
+ !managedProperties.connectable) {
+ if (managedProperties.cellular.homeProvider &&
+ managedProperties.cellular.homeProvider.name) {
+ return this.i18n(
+ 'cellularContactSpecificCarrier',
+ managedProperties.cellular.homeProvider.name);
+ }
+ return this.i18n('cellularContactDefaultCarrier');
+ }
+
+ return this.i18n(
+ OncMojo.getConnectionStateString(managedProperties.connectionState));
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties
+ * @param {!mojom.ManagedProperties} managedProperties
* @return {string} The text to display for auto-connect toggle label.
* @private
*/
- getAutoConnectToggleLabel_: function(networkProperties) {
- return this.isCellular_(networkProperties) ?
+ getAutoConnectToggleLabel_: function(managedProperties) {
+ return this.isCellular_(managedProperties) ?
this.i18n('networkAutoConnectCellular') :
this.i18n('networkAutoConnect');
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties
+ * @param {!mojom.ManagedProperties} managedProperties
* @return {string} The text to display with roaming details.
* @private
*/
- getRoamingDetails_: function(networkProperties) {
- if (!networkProperties.Cellular.AllowRoaming) {
+ getRoamingDetails_: function(managedProperties) {
+ if (!this.isCellular_(managedProperties)) {
+ return '';
+ }
+ if (!managedProperties.cellular.allowRoaming) {
return this.i18n('networkAllowDataRoamingDisabled');
}
- return networkProperties.Cellular.RoamingState ===
- CrOnc.RoamingState.ROAMING ?
+ return managedProperties.cellular.roamingState == 'Roaming' ?
this.i18n('networkAllowDataRoamingEnabledRoaming') :
this.i18n('networkAllowDataRoamingEnabledHome');
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties
+ * @param {!mojom.ManagedProperties|undefined} managedProperties
* @return {boolean} True if the network is connected.
* @private
*/
- isConnectedState_: function(networkProperties) {
- return !!networkProperties &&
- networkProperties.ConnectionState == CrOnc.ConnectionState.CONNECTED;
+ isConnectedState_: function(managedProperties) {
+ return !!managedProperties &&
+ OncMojo.connectionStateIsConnected(managedProperties.connectionState);
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties
+ * @param {!mojom.ManagedProperties|undefined} managedProperties
+ * @param {boolean} outOfRange
+ * @return {boolean} True if the network shown cannot initiate a connection.
+ * @private
+ */
+ isConnectionErrorState_: function(managedProperties, outOfRange) {
+ if (outOfRange) {
+ return true;
+ }
+
+ if (!managedProperties) {
+ return false;
+ }
+
+ // It's still possible to initiate a connection to a network if it is not
+ // connectable as long as the network has an associated configuration flow.
+ // Cellular networks do not have a configuration flow, so a Cellular network
+ // that is not connectable represents an error state.
+ return managedProperties.type == mojom.NetworkType.kCellular &&
+ !managedProperties.connectable;
+ },
+
+ /**
+ * @param {!mojom.ManagedProperties} managedProperties
* @return {boolean}
* @private
*/
- isRemembered_: function(networkProperties) {
- const source = networkProperties ? networkProperties.Source : null;
- return !!source && source != CrOnc.Source.NONE;
+ isRemembered_: function(managedProperties) {
+ return !!managedProperties &&
+ managedProperties.source != mojom.OncSource.kNone;
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties
+ * @param {!mojom.ManagedProperties} managedProperties
* @return {boolean}
* @private
*/
- isRememberedOrConnected_: function(networkProperties) {
- return this.isRemembered_(networkProperties) ||
- this.isConnectedState_(networkProperties);
+ isRememberedOrConnected_: function(managedProperties) {
+ return this.isRemembered_(managedProperties) ||
+ this.isConnectedState_(managedProperties);
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties
+ * @param {!mojom.ManagedProperties} managedProperties
* @return {boolean}
* @private
*/
- isCellular_: function(networkProperties) {
- return !!networkProperties &&
- networkProperties.Type == CrOnc.Type.CELLULAR &&
- !!networkProperties.Cellular;
+ isCellular_: function(managedProperties) {
+ return !!managedProperties &&
+ managedProperties.type == mojom.NetworkType.kCellular;
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties
- * @param {!chrome.networkingPrivate.GlobalPolicy} globalPolicy
+ * @param {!mojom.ManagedProperties} managedProperties
+ * @return {boolean}
+ * @private
+ */
+ isTether_: function(managedProperties) {
+ return !!managedProperties &&
+ managedProperties.type == mojom.NetworkType.kTether;
+ },
+
+ /**
+ * @param {!mojom.ManagedProperties} managedProperties
+ * @param {!mojom.GlobalPolicy|undefined} globalPolicy
* @param {boolean} managedNetworkAvailable
* @return {boolean}
* @private
*/
isBlockedByPolicy_: function(
- networkProperties, globalPolicy, managedNetworkAvailable) {
- if (!networkProperties || networkProperties.Type != CrOnc.Type.WI_FI ||
- this.isPolicySource(networkProperties.Source) || !globalPolicy) {
+ managedProperties, globalPolicy, managedNetworkAvailable) {
+ if (!managedProperties || !globalPolicy ||
+ managedProperties.type != mojom.NetworkType.kWiFi ||
+ this.isPolicySource(managedProperties.source)) {
return false;
}
- return !!globalPolicy.AllowOnlyPolicyNetworksToConnect ||
- (!!globalPolicy.AllowOnlyPolicyNetworksToConnectIfAvailable &&
+ const hexSsid = OncMojo.getActiveString(managedProperties.wifi.hexSsid);
+ return !!globalPolicy.allowOnlyPolicyNetworksToConnect ||
+ (!!globalPolicy.allowOnlyPolicyNetworksToConnectIfAvailable &&
!!managedNetworkAvailable) ||
- (!!networkProperties.WiFi && !!networkProperties.WiFi.HexSSID &&
- !!globalPolicy.BlacklistedHexSSIDs &&
- globalPolicy.BlacklistedHexSSIDs.includes(
- CrOnc.getStateOrActiveString(networkProperties.WiFi.HexSSID)));
+ (!!hexSsid && !!globalPolicy.blockedHexSsids &&
+ globalPolicy.blockedHexSsids.includes(hexSsid));
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties
- * @param {!chrome.networkingPrivate.GlobalPolicy} globalPolicy
+ * @param {!mojom.ManagedProperties} managedProperties
+ * @param {!mojom.GlobalPolicy} globalPolicy
* @param {boolean} managedNetworkAvailable
* @return {boolean}
* @private
*/
showConnect_: function(
- networkProperties, globalPolicy, managedNetworkAvailable) {
- if (!networkProperties) {
+ managedProperties, globalPolicy, managedNetworkAvailable) {
+ if (!managedProperties) {
return false;
}
if (this.isBlockedByPolicy_(
- networkProperties, globalPolicy, managedNetworkAvailable)) {
+ managedProperties, globalPolicy, managedNetworkAvailable)) {
return false;
}
+
// TODO(lgcheng@) support connect Arc VPN from UI once Android support API
// to initiate a VPN session.
- if (this.isArcVpn_(networkProperties)) {
+ if (this.isArcVpn_(managedProperties)) {
return false;
}
-
- return networkProperties.Type != CrOnc.Type.ETHERNET &&
- networkProperties.ConnectionState ==
- CrOnc.ConnectionState.NOT_CONNECTED;
+ if (managedProperties.connectionState !=
+ mojom.ConnectionStateType.kNotConnected) {
+ return false;
+ }
+ // Cellular is not configurable, so we always show the connect button, and
+ // disable it if 'connectable' is false.
+ if (managedProperties.type == mojom.NetworkType.kCellular) {
+ return true;
+ }
+ // If 'connectable' is false we show the configure button.
+ return managedProperties.connectable &&
+ managedProperties.type != mojom.NetworkType.kEthernet;
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties
+ * @param {!mojom.ManagedProperties} managedProperties
* @return {boolean}
* @private
*/
- showDisconnect_: function(networkProperties) {
- return !!networkProperties &&
- networkProperties.Type != CrOnc.Type.ETHERNET &&
- CrOnc.isConnectingOrConnected(networkProperties);
+ showDisconnect_: function(managedProperties) {
+ if (!managedProperties ||
+ managedProperties.type == mojom.NetworkType.kEthernet) {
+ return false;
+ }
+ return managedProperties.connectionState !=
+ mojom.ConnectionStateType.kNotConnected;
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties
+ * @param {!mojom.ManagedProperties} managedProperties
* @return {boolean}
* @private
*/
- showForget_: function(networkProperties) {
- if (this.isSecondaryUser_ || !networkProperties) {
+ showForget_: function(managedProperties) {
+ if (!managedProperties || this.isSecondaryUser_) {
return false;
}
- const type = networkProperties.Type;
- if (type != CrOnc.Type.WI_FI && type != CrOnc.Type.VPN) {
+ const type = managedProperties.type;
+ if (type != mojom.NetworkType.kWiFi && type != mojom.NetworkType.kVPN) {
return false;
}
- if (this.isArcVpn_(networkProperties)) {
+ if (this.isArcVpn_(managedProperties)) {
return false;
}
- return !this.isPolicySource(networkProperties.Source) &&
- this.isRemembered_(networkProperties);
+ return !this.isPolicySource(managedProperties.source) &&
+ this.isRemembered_(managedProperties);
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties
+ * @param {!mojom.ManagedProperties} managedProperties
* @return {boolean}
* @private
*/
- showActivate_: function(networkProperties) {
- if (this.isSecondaryUser_) {
+ showActivate_: function(managedProperties) {
+ if (!managedProperties || this.isSecondaryUser_) {
return false;
}
- if (!this.isCellular_(networkProperties)) {
+ if (!this.isCellular_(managedProperties)) {
return false;
}
- const activation = networkProperties.Cellular.ActivationState;
- return activation == CrOnc.ActivationState.NOT_ACTIVATED ||
- activation == CrOnc.ActivationState.PARTIALLY_ACTIVATED;
+ const activation = managedProperties.cellular.activationState;
+ return activation == mojom.ActivationStateType.kNotActivated ||
+ activation == mojom.ActivationStateType.kPartiallyActivated;
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties
- * @param {!chrome.networkingPrivate.GlobalPolicy} globalPolicy
+ * @param {!mojom.ManagedProperties} managedProperties
+ * @param {!mojom.GlobalPolicy} globalPolicy
* @param {boolean} managedNetworkAvailable
* @return {boolean}
* @private
*/
showConfigure_: function(
- networkProperties, globalPolicy, managedNetworkAvailable) {
- if (this.isSecondaryUser_ || !networkProperties) {
+ managedProperties, globalPolicy, managedNetworkAvailable) {
+ if (!managedProperties || this.isSecondaryUser_) {
return false;
}
if (this.isBlockedByPolicy_(
- networkProperties, globalPolicy, managedNetworkAvailable)) {
+ managedProperties, globalPolicy, managedNetworkAvailable)) {
return false;
}
- const type = networkProperties.Type;
- if (type == CrOnc.Type.CELLULAR || type == CrOnc.Type.TETHER) {
+ const type = managedProperties.type;
+ if (type == mojom.NetworkType.kCellular ||
+ type == mojom.NetworkType.kTether) {
return false;
}
- if (type == CrOnc.Type.WI_FI) {
- const security = networkProperties.WiFi &&
- CrOnc.getActiveValue(networkProperties.WiFi.Security);
- if (!security || security == CrOnc.Security.NONE) {
- return false;
- }
+ if (type == mojom.NetworkType.kWiFi &&
+ managedProperties.wifi.security == mojom.SecurityType.kNone) {
+ return false;
}
- if ((type == CrOnc.Type.WI_FI || type == CrOnc.Type.WI_MAX) &&
- CrOnc.isConnectingOrConnected(networkProperties)) {
+ if (type == mojom.NetworkType.kWiFi &&
+ (managedProperties.connectionState !=
+ mojom.ConnectionStateType.kNotConnected)) {
return false;
}
- if (this.isArcVpn_(networkProperties) &&
- !this.isConnectedState_(networkProperties)) {
+ if (this.isArcVpn_(managedProperties) &&
+ !this.isConnectedState_(managedProperties)) {
return false;
}
return true;
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties
- * @param {!chrome.settingsPrivate.PrefObject} vpn_config_allowed
+ * @param {!mojom.ManagedProperties} managedProperties
+ * @param {!chrome.settingsPrivate.PrefObject} vpnConfigAllowed
* @return {boolean}
* @private
*/
- disableForget_: function(networkProperties, vpn_config_allowed) {
- return this.isVpn_(networkProperties) && vpn_config_allowed &&
- !vpn_config_allowed.value;
+ disableForget_: function(managedProperties, vpnConfigAllowed) {
+ if (!managedProperties) {
+ return true;
+ }
+ return managedProperties.type == mojom.NetworkType.kVPN &&
+ vpnConfigAllowed && !vpnConfigAllowed.value;
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties
- * @param {!chrome.settingsPrivate.PrefObject} vpn_config_allowed
+ * @param {!mojom.ManagedProperties} managedProperties
+ * @param {!chrome.settingsPrivate.PrefObject} vpnConfigAllowed
* @return {boolean}
* @private
*/
- disableConfigure_: function(networkProperties, vpn_config_allowed) {
- if (!networkProperties ||
- (this.isVpn_(networkProperties) && vpn_config_allowed &&
- !vpn_config_allowed.value)) {
+ disableConfigure_: function(managedProperties, vpnConfigAllowed) {
+ if (!managedProperties) {
return true;
}
- return this.isPolicySource(networkProperties.Source) &&
- !this.hasRecommendedFields_(networkProperties);
+ if (managedProperties.type == mojom.NetworkType.kVPN && vpnConfigAllowed &&
+ !vpnConfigAllowed.value) {
+ return true;
+ }
+ return this.isPolicySource(managedProperties.source) &&
+ !this.hasRecommendedFields_(managedProperties);
},
/**
- * @param {!Object} networkProperties
+ * @param {!mojom.ManagedProperties} managedProperties
* @return {boolean}
*/
- hasRecommendedFields_: function(networkProperties) {
- for (const property in networkProperties) {
- const propertyValue = networkProperties[property];
- if (this.isNetworkPolicyRecommended(propertyValue) ||
- (typeof propertyValue == 'object' &&
- this.hasRecommendedFields_(propertyValue))) {
+ hasRecommendedFields_: function(managedProperties) {
+ if (!managedProperties) {
+ return false;
+ }
+ for (const key of Object.keys(managedProperties)) {
+ const value = managedProperties[key];
+ if (typeof value != 'object' || value === null) {
+ continue;
+ }
+ if ('activeValue' in value) {
+ if (this.isNetworkPolicyRecommended(value)) {
+ return true;
+ }
+ } else if (this.hasRecommendedFields_(value)) {
return true;
}
}
@@ -854,34 +901,33 @@ Polymer({
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties
+ * @param {!mojom.ManagedProperties} managedProperties
* @return {boolean}
* @private
*/
- showViewAccount_: function(networkProperties) {
- if (this.isSecondaryUser_) {
+ showViewAccount_: function(managedProperties) {
+ if (!managedProperties || this.isSecondaryUser_) {
return false;
}
// Show either the 'Activate' or the 'View Account' button (Cellular only).
- if (!this.isCellular_(networkProperties) ||
- this.showActivate_(networkProperties)) {
+ if (!this.isCellular_(managedProperties) ||
+ this.showActivate_(managedProperties)) {
return false;
}
- const paymentPortal = networkProperties.Cellular.PaymentPortal;
- if (!paymentPortal || !paymentPortal.Url) {
+ const paymentPortal = managedProperties.cellular.paymentPortal;
+ if (!paymentPortal || !paymentPortal.url) {
return false;
}
// Only show for connected networks or LTE networks with a valid MDN.
- if (!this.isConnectedState_(networkProperties)) {
- const technology = networkProperties.Cellular.NetworkTechnology;
- if (technology != CrOnc.NetworkTechnology.LTE &&
- technology != CrOnc.NetworkTechnology.LTE_ADVANCED) {
+ if (!this.isConnectedState_(managedProperties)) {
+ const technology = managedProperties.cellular.networkTechnology;
+ if (technology != 'LTE' && technology != 'LTEAdvanced') {
return false;
}
- if (!networkProperties.Cellular.MDN) {
+ if (!managedProperties.cellular.mdn) {
return false;
}
}
@@ -890,49 +936,37 @@ Polymer({
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties
+ * @param {!mojom.ManagedProperties} managedProperties
* @param {?OncMojo.NetworkStateProperties} defaultNetwork
- * @param {boolean} networkPropertiesReceived
+ * @param {boolean} propertiesReceived
* @param {boolean} outOfRange
- * @param {!chrome.networkingPrivate.GlobalPolicy} globalPolicy
+ * @param {!mojom.GlobalPolicy} globalPolicy
* @param {boolean} managedNetworkAvailable
* @return {boolean} Whether or not to enable the network connect button.
* @private
*/
enableConnect_: function(
- networkProperties, defaultNetwork, networkPropertiesReceived, outOfRange,
+ managedProperties, defaultNetwork, propertiesReceived, outOfRange,
globalPolicy, managedNetworkAvailable) {
if (!this.showConnect_(
- networkProperties, globalPolicy, managedNetworkAvailable)) {
+ managedProperties, globalPolicy, managedNetworkAvailable)) {
return false;
}
- if (!networkPropertiesReceived || outOfRange) {
+ if (!propertiesReceived || outOfRange) {
return false;
}
- if (this.isSecondaryUser_ &&
- this.networkProperties_.Connectable === false) {
+ // Cellular networks are not configurable, so we show a disabled 'Connect'
+ // button when not connectable.
+ if (managedProperties.type == mojom.NetworkType.kCellular &&
+ !managedProperties.connectable) {
return false;
}
- if ((networkProperties.Type == CrOnc.Type.CELLULAR) &&
- (CrOnc.isSimLocked(networkProperties) ||
- this.get('Cellular.Scanning', networkProperties))) {
- return false;
- }
- if (networkProperties.Type == CrOnc.Type.VPN && !defaultNetwork) {
+ if (managedProperties.type == mojom.NetworkType.kVPN && !defaultNetwork) {
return false;
}
return true;
},
- /**
- * @param {!CrOnc.NetworkProperties=} networkProperties
- * @return {boolean} Whether or not we are looking at VPN configuration.
- * @private
- */
- isVpn_: function(networkProperties) {
- return !!networkProperties && networkProperties.Type == CrOnc.Type.VPN;
- },
-
/** @private */
updateAlwaysOnVpnPrefValue_: function() {
this.alwaysOnVpn_.value = this.prefs.arc && this.prefs.arc.vpn &&
@@ -953,14 +987,14 @@ Polymer({
// Only mark VPN networks as enforced. This fake pref also controls the
// policy indicator on the connect/disconnect buttons, so it shouldn't be
// shown on non-VPN networks.
- if (this.isVpn_(this.networkProperties_) && this.prefs &&
+ if (this.managedProperties_ &&
+ this.managedProperties_.type == mojom.NetworkType.kVPN && this.prefs &&
this.prefs.vpn_config_allowed && !this.prefs.vpn_config_allowed.value) {
fakeAlwaysOnVpnEnforcementPref.enforcement =
chrome.settingsPrivate.Enforcement.ENFORCED;
fakeAlwaysOnVpnEnforcementPref.controlledBy =
this.prefs.vpn_config_allowed.controlledBy;
}
-
return fakeAlwaysOnVpnEnforcementPref;
},
@@ -976,15 +1010,14 @@ Polymer({
* @private
*/
getTetherDialog_: function() {
- return /** @type {!TetherConnectionDialogElement} */ (this.$.tetherDialog);
+ return /** @type {!TetherConnectionDialogElement} */ (
+ this.$$('#tetherDialog'));
},
/** @private */
onConnectTap_: function() {
- // For Tether networks that have not connected to a host, show a dialog.
- if (this.networkProperties_.Type == CrOnc.Type.TETHER &&
- (!this.networkProperties_.Tether ||
- !this.networkProperties_.Tether.HasConnectedToHost)) {
+ if (this.managedProperties_.type == mojom.NetworkType.kTether &&
+ (!this.managedProperties_.tether.hasConnectedToHost)) {
this.showTetherDialog_();
return;
}
@@ -1002,9 +1035,9 @@ Polymer({
* @private
*/
fireNetworkConnect_: function(bypassDialog) {
- assert(this.networkProperties_);
+ assert(this.managedProperties_);
const networkState =
- OncMojo.oncPropertiesToNetworkState(this.networkProperties_);
+ OncMojo.managedPropertiesToNetworkState(this.managedProperties_);
this.fire(
'network-connect',
{networkState: networkState, bypassConnectionDialog: bypassDialog});
@@ -1012,7 +1045,11 @@ Polymer({
/** @private */
onDisconnectTap_: function() {
- this.networkingPrivate.startDisconnect(this.guid);
+ this.networkConfig_.startDisconnect(this.guid).then(response => {
+ if (!response.success) {
+ console.error('Disconnect failed for: ' + this.guid);
+ }
+ });
},
/** @private */
@@ -1024,29 +1061,29 @@ Polymer({
/** @private */
onActivateTap_: function() {
- this.networkingPrivate.startActivate(this.guid);
+ this.browserProxy_.showCellularSetupUI(this.guid);
},
/** @private */
onConfigureTap_: function() {
- if (this.networkProperties_ &&
- (this.isThirdPartyVpn_(this.networkProperties_) ||
- this.isArcVpn_(this.networkProperties_))) {
+ if (this.managedProperties_ &&
+ (this.isThirdPartyVpn_(this.managedProperties_) ||
+ this.isArcVpn_(this.managedProperties_))) {
this.browserProxy_.configureThirdPartyVpn(this.guid);
return;
}
this.fire('show-config', {
- guid: this.networkProperties_.GUID,
- type: this.networkProperties_.Type,
- name: CrOnc.getNetworkName(this.networkProperties_)
+ guid: this.guid,
+ type: OncMojo.getNetworkTypeString(this.managedProperties_.type),
+ name: OncMojo.getNetworkName(this.managedProperties_)
});
},
/** @private */
onViewAccountTap_: function() {
- // startActivate() will show the account page for activated networks.
- this.networkingPrivate.startActivate(this.guid);
+ // Currently 'Account Details' is the same as the activation UI.
+ this.browserProxy_.showCellularSetupUI(this.guid);
},
/** @type {string} */
@@ -1063,218 +1100,133 @@ Polymer({
*/
showHiddenNetworkWarning_: function() {
return loadTimeData.getBoolean('showHiddenNetworkWarning') &&
- !!this.autoConnect_ && !!this.autoConnect_.value &&
- !!this.networkProperties_ && !!this.networkProperties_.WiFi &&
- !!CrOnc.getActiveValue(this.networkProperties_.WiFi.HiddenSSID);
+ !!this.autoConnectPref_ && !!this.autoConnectPref_.value &&
+ !!this.managedProperties_ &&
+ !!this.managedProperties_.type == mojom.NetworkType.kWiFi &&
+ !!OncMojo.getActiveValue(this.managedProperties_.wifi.hiddenSsid);
},
/**
* Event triggered for elements associated with network properties.
* @param {!CustomEvent<!{
* field: string,
- * value: !CrOnc.NetworkPropertyType
+ * value: (string|number|boolean|!Array<string>)
* }>} e
* @private
*/
onNetworkPropertyChange_: function(e) {
- if (!this.networkProperties_) {
+ if (!this.propertiesReceived_) {
return;
}
const field = e.detail.field;
const value = e.detail.value;
- const onc = this.getEmptyNetworkProperties_();
- if (field == 'APN') {
- CrOnc.setTypeProperty(onc, 'APN', value);
- } else if (field == 'SIMLockStatus') {
- CrOnc.setTypeProperty(onc, 'SIMLockStatus', value);
- } else {
- const valueType = typeof value;
- if (valueType == 'string' || valueType == 'number' ||
- valueType == 'boolean' || Array.isArray(value)) {
- CrOnc.setProperty(onc, field, value);
- // Ensure any required configuration properties are also set.
- if (field.match(/^VPN/)) {
- const vpnType =
- CrOnc.getActiveValue(this.networkProperties_.VPN.Type);
- assert(vpnType);
- CrOnc.setProperty(onc, 'VPN.Type', vpnType);
- }
- } else {
- console.error(
- 'Unexpected property change event, Key: ' + field +
- ' Value: ' + JSON.stringify(value));
- return;
- }
+ const config = {};
+ const valueType = typeof value;
+ if (valueType != 'string' && valueType != 'number' &&
+ valueType != 'boolean' && !Array.isArray(value)) {
+ console.error(
+ 'Unexpected property change event, Key: ' + field +
+ ' Value: ' + JSON.stringify(value));
+ return;
}
- this.setNetworkProperties_(onc);
+ OncMojo.setConfigProperty(config, field, value);
+ // Ensure any required configuration properties are also set.
+ if (this.managedProperties_.vpn && config.vpn &&
+ config.vpn.type === undefined) {
+ config.vpn.type = this.managedProperties_.vpn.type;
+ }
+ this.setMojoNetworkProperties_(config);
},
/**
+ * @param {!CustomEvent<!mojom.ApnProperties>} event
+ * @private
+ */
+ onApnChange_: function(event) {
+ if (!this.propertiesReceived_) {
+ return;
+ }
+ const apn = event.detail;
+ const config = {cellular: {apn: apn}};
+ this.setMojoNetworkProperties_(config);
+ },
+
+
+ /**
* Event triggered when the IP Config or NameServers element changes.
* @param {!CustomEvent<!{
* field: string,
- * value: (string|!CrOnc.IPConfigProperties| !Array<string>)
+ * value: (string|!mojom.IPConfigProperties|!Array<string>)
* }>} event The network-ip-config or network-nameservers change event.
* @private
*/
onIPConfigChange_: function(event) {
- if (!this.networkProperties_) {
+ if (!this.managedProperties_) {
return;
}
- const field = event.detail.field;
- const value = event.detail.value;
- // Get an empty ONC dictionary and set just the IP Config properties that
- // need to change.
- const onc = this.getEmptyNetworkProperties_();
- const ipConfigType =
- /** @type {chrome.networkingPrivate.IPConfigType|undefined} */ (
- CrOnc.getActiveValue(this.networkProperties_.IPAddressConfigType));
- if (field == 'IPAddressConfigType') {
- const newIpConfigType =
- /** @type {chrome.networkingPrivate.IPConfigType} */ (value);
- if (newIpConfigType == ipConfigType) {
- return;
- }
- onc.IPAddressConfigType = newIpConfigType;
- } else if (field == 'NameServersConfigType') {
- const nsConfigType =
- /** @type {chrome.networkingPrivate.IPConfigType|undefined} */ (
- CrOnc.getActiveValue(
- this.networkProperties_.NameServersConfigType));
- const newNsConfigType =
- /** @type {chrome.networkingPrivate.IPConfigType} */ (value);
- if (newNsConfigType == nsConfigType) {
- return;
- }
- onc.NameServersConfigType = newNsConfigType;
- } else if (field == 'StaticIPConfig') {
- if (ipConfigType == CrOnc.IPConfigType.STATIC) {
- const staticIpConfig = this.networkProperties_.StaticIPConfig;
- const ipConfigValue = /** @type {!Object} */ (value);
- if (staticIpConfig &&
- this.allPropertiesMatch_(staticIpConfig, ipConfigValue)) {
- return;
- }
- }
- onc.IPAddressConfigType = CrOnc.IPConfigType.STATIC;
- if (!onc.StaticIPConfig) {
- onc.StaticIPConfig =
- /** @type {!chrome.networkingPrivate.IPConfigProperties} */ ({});
- }
- // Only copy Static IP properties.
- const keysToCopy = ['Type', 'IPAddress', 'RoutingPrefix', 'Gateway'];
- for (let i = 0; i < keysToCopy.length; ++i) {
- const key = keysToCopy[i];
- if (key in value) {
- onc.StaticIPConfig[key] = value[key];
- }
- }
- } else if (field == 'NameServers') {
- // If a StaticIPConfig property is specified and its NameServers value
- // matches the new value, no need to set anything.
- const nameServers = /** @type {!Array<string>} */ (value);
- if (onc.NameServersConfigType == CrOnc.IPConfigType.STATIC &&
- onc.StaticIPConfig && onc.StaticIPConfig.NameServers == nameServers) {
- return;
- }
- onc.NameServersConfigType = CrOnc.IPConfigType.STATIC;
- if (!onc.StaticIPConfig) {
- onc.StaticIPConfig =
- /** @type {!chrome.networkingPrivate.IPConfigProperties} */ ({});
- }
- onc.StaticIPConfig.NameServers = nameServers;
- } else {
- console.error('Unexpected change field: ' + field);
- return;
+ const config = OncMojo.getUpdatedIPConfigProperties(
+ this.managedProperties_, event.detail.field, event.detail.value);
+ if (config) {
+ this.setMojoNetworkProperties_(config);
}
- // setValidStaticIPConfig will fill in any other properties from
- // networkProperties. This is necessary since we update IP Address and
- // NameServers independently.
- CrOnc.setValidStaticIPConfig(onc, this.networkProperties_);
- this.setNetworkProperties_(onc);
},
/**
* Event triggered when the Proxy configuration element changes.
- * @param {!CustomEvent<!{field: string, value: !CrOnc.ProxySettings}>} event
- * The network-proxy change event.
+ * @param {!CustomEvent<!mojom.ProxySettings>} event
* @private
*/
onProxyChange_: function(event) {
- if (!this.networkProperties_) {
- return;
- }
- const field = event.detail.field;
- const value = event.detail.value;
- if (field != 'ProxySettings') {
+ if (!this.propertiesReceived_) {
return;
}
- const onc = this.getEmptyNetworkProperties_();
- CrOnc.setProperty(onc, 'ProxySettings', /** @type {!Object} */ (value));
- this.setNetworkProperties_(onc);
+ this.setMojoNetworkProperties_({proxySettings: event.detail});
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties
- * @param {!chrome.networkingPrivate.GlobalPolicy} globalPolicy
+ * @param {!mojom.ManagedProperties} managedProperties
+ * @param {!mojom.GlobalPolicy} globalPolicy
* @param {boolean} managedNetworkAvailable
* @return {boolean} True if the shared message should be shown.
* @private
*/
showShared_: function(
- networkProperties, globalPolicy, managedNetworkAvailable) {
- return !!networkProperties &&
- (networkProperties.Source == 'Device' ||
- networkProperties.Source == 'DevicePolicy') &&
+ managedProperties, globalPolicy, managedNetworkAvailable) {
+ return !!managedProperties &&
+ (managedProperties.source == mojom.OncSource.kDevice ||
+ managedProperties.source == mojom.OncSource.kDevicePolicy) &&
!this.isBlockedByPolicy_(
- networkProperties, globalPolicy, managedNetworkAvailable);
+ managedProperties, globalPolicy, managedNetworkAvailable);
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties
- * @param {!chrome.networkingPrivate.GlobalPolicy} globalPolicy
+ * @param {!mojom.ManagedProperties} managedProperties
+ * @param {!mojom.GlobalPolicy} globalPolicy
* @param {boolean} managedNetworkAvailable
* @return {boolean} True if the AutoConnect checkbox should be shown.
* @private
*/
showAutoConnect_: function(
- networkProperties, globalPolicy, managedNetworkAvailable) {
- return !!networkProperties &&
- networkProperties.Type != CrOnc.Type.ETHERNET &&
- this.isRemembered_(networkProperties) &&
- !this.isArcVpn_(networkProperties) &&
+ managedProperties, globalPolicy, managedNetworkAvailable) {
+ return !!managedProperties &&
+ managedProperties.type != mojom.NetworkType.kEthernet &&
+ this.isRemembered_(managedProperties) &&
+ !this.isArcVpn_(managedProperties) &&
!this.isBlockedByPolicy_(
- networkProperties, globalPolicy, managedNetworkAvailable);
+ managedProperties, globalPolicy, managedNetworkAvailable);
},
/**
- * @param {!CrOnc.NetworkProperties=} networkProperties
- * @param {!chrome.networkingPrivate.GlobalPolicy=} globalPolicy
- * @return {boolean}
- * @private
- */
- isAutoConnectEnforcedByPolicy: function(networkProperties, globalPolicy) {
- if (!networkProperties || networkProperties.Type != CrOnc.Type.WI_FI) {
- return false;
- }
- if (this.isPolicySource(networkProperties.Source)) {
- return !this.isEditable(CrOnc.getManagedAutoConnect(networkProperties));
- }
- return !!globalPolicy &&
- !!globalPolicy.AllowOnlyPolicyNetworksToAutoconnect;
- },
-
- /**
- * @param {!CrOnc.NetworkProperties} networkProperties
+ * @param {!mojom.ManagedProperties} managedProperties
* @return {boolean} Whether the toggle for the Always-on VPN feature is
* displayed.
* @private
*/
- showAlwaysOnVpn_: function(networkProperties) {
- return this.isArcVpn_(networkProperties) && this.prefs.arc &&
+ showAlwaysOnVpn_: function(managedProperties) {
+ return this.isArcVpn_(managedProperties) && this.prefs.arc &&
this.prefs.arc.vpn && this.prefs.arc.vpn.always_on &&
this.prefs.arc.vpn.always_on.vpn_package &&
- networkProperties.VPN.Host.Active ===
+ OncMojo.getActiveValue(managedProperties.vpn.host) ===
this.prefs.arc.vpn.always_on.vpn_package.value;
},
@@ -1289,27 +1241,28 @@ Polymer({
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties
- * @param {!chrome.networkingPrivate.GlobalPolicy} globalPolicy
+ * @param {!mojom.ManagedProperties} managedProperties
+ * @param {!mojom.GlobalPolicy} globalPolicy
* @param {boolean} managedNetworkAvailable
* @return {boolean} True if the prefer network checkbox should be shown.
* @private
*/
showPreferNetwork_: function(
- networkProperties, globalPolicy, managedNetworkAvailable) {
- if (!networkProperties) {
+ managedProperties, globalPolicy, managedNetworkAvailable) {
+ if (!managedProperties) {
return false;
}
- const type = networkProperties.Type;
- if (type == CrOnc.Type.ETHERNET || type == CrOnc.Type.CELLULAR ||
- this.isArcVpn_(networkProperties)) {
+ const type = managedProperties.type;
+ if (type == mojom.NetworkType.kEthernet ||
+ type == mojom.NetworkType.kCellular ||
+ this.isArcVpn_(managedProperties)) {
return false;
}
- return this.isRemembered_(networkProperties) &&
+ return this.isRemembered_(managedProperties) &&
!this.isBlockedByPolicy_(
- networkProperties, globalPolicy, managedNetworkAvailable);
+ managedProperties, globalPolicy, managedNetworkAvailable);
},
/**
@@ -1336,7 +1289,7 @@ Polymer({
*/
hasVisibleFields_: function(fields) {
for (let i = 0; i < fields.length; ++i) {
- const value = this.get(fields[i], this.networkProperties_);
+ const value = this.get(fields[i], this.managedProperties_);
if (value !== undefined && value !== '') {
return true;
}
@@ -1358,65 +1311,70 @@ Polymer({
* @private
*/
getInfoFields_: function() {
- if (!this.networkProperties_) {
+ if (!this.managedProperties_) {
return [];
}
/** @type {!Array<string>} */ const fields = [];
- const type = this.networkProperties_.Type;
- if (type == CrOnc.Type.CELLULAR && !!this.networkProperties_.Cellular) {
- fields.push(
- 'Cellular.ActivationState', 'RestrictedConnectivity',
- 'Cellular.ServingOperator.Name');
- } else if (type == CrOnc.Type.TETHER && !!this.networkProperties_.Tether) {
+ const type = this.managedProperties_.type;
+ if (type == mojom.NetworkType.kCellular) {
+ fields.push('cellular.activationState', 'cellular.servingOperator.name');
+ if (this.managedProperties_.restrictedConnectivity) {
+ fields.push('restrictedConnectivity');
+ }
+ } else if (type == mojom.NetworkType.kTether) {
fields.push(
- 'Tether.BatteryPercentage', 'Tether.SignalStrength',
- 'Tether.Carrier');
- } else if (type == CrOnc.Type.VPN && !!this.networkProperties_.VPN) {
- const vpnType = CrOnc.getActiveValue(this.networkProperties_.VPN.Type);
+ 'tether.batteryPercentage', 'tether.signalStrength',
+ 'tether.carrier');
+ } else if (type == mojom.NetworkType.kVPN) {
+ const vpnType = this.managedProperties_.vpn.type;
switch (vpnType) {
- case CrOnc.VPNType.THIRD_PARTY_VPN:
- fields.push('VPN.ThirdPartyVPN.ProviderName');
+ case mojom.VpnType.kExtension:
+ fields.push('vpn.providerName');
break;
- case CrOnc.VPNType.ARCVPN:
- fields.push('VPN.Type');
+ case mojom.VpnType.kArc:
+ fields.push('vpn.type');
+ fields.push('vpn.providerName');
break;
- case CrOnc.VPNType.OPEN_VPN:
+ case mojom.VpnType.kOpenVPN:
fields.push(
- 'VPN.Type', 'VPN.Host', 'VPN.OpenVPN.Username',
- 'VPN.OpenVPN.ExtraHosts');
+ 'vpn.type', 'vpn.host', 'vpn.openVpn.username',
+ 'vpn.openVpn.extraHosts');
break;
- case CrOnc.VPNType.L2TP_IPSEC:
- fields.push('VPN.Type', 'VPN.Host', 'VPN.L2TP.Username');
+ case mojom.VpnType.kL2TPIPsec:
+ fields.push('vpn.type', 'vpn.host', 'vpn.l2tp.username');
break;
}
- } else if (type == CrOnc.Type.WI_FI) {
- fields.push('RestrictedConnectivity');
- } else if (type == CrOnc.Type.WI_MAX) {
- fields.push('RestrictedConnectivity', 'WiMAX.EAP.Identity');
+ } else if (type == mojom.NetworkType.kWiFi) {
+ if (this.managedProperties_.restrictedConnectivity) {
+ fields.push('restrictedConnectivity');
+ }
}
return fields;
},
/**
+ * Provides the list of editable fields to <network-property-list>.
+ * NOTE: Entries added to this list must be reflected in ConfigProperties in
+ * chromeos.network_config.mojom and handled in the service implementation.
* @return {!Object} A dictionary of editable fields in the info section.
* @private
*/
getInfoEditFieldTypes_: function() {
- if (!this.networkProperties_) {
+ if (!this.managedProperties_) {
return [];
}
/** @dict */ const editFields = {};
- const type = this.networkProperties_.Type;
- if (type == CrOnc.Type.VPN && !!this.networkProperties_.VPN) {
- const vpnType = CrOnc.getActiveValue(this.networkProperties_.VPN.Type);
- if (vpnType != CrOnc.VPNType.THIRD_PARTY_VPN) {
- editFields['VPN.Host'] = 'String';
+ const type = this.managedProperties_.type;
+ if (type == mojom.NetworkType.kVPN) {
+ const vpnType = this.managedProperties_.vpn.type;
+ if (vpnType != mojom.VpnType.kExtension) {
+ editFields['vpn.host'] = 'String';
}
- if (vpnType == CrOnc.VPNType.OPEN_VPN) {
- editFields['VPN.OpenVPN.Username'] = 'String';
- editFields['VPN.OpenVPN.ExtraHosts'] = 'StringArray';
+ if (vpnType == mojom.VpnType.kOpenVPN) {
+ editFields['vpn.openVpn.username'] = 'String';
+ editFields['vpn.openVpn.extraHosts'] = 'StringArray';
}
}
return editFields;
@@ -1427,26 +1385,21 @@ Polymer({
* @private
*/
getAdvancedFields_: function() {
- if (!this.networkProperties_) {
+ if (!this.managedProperties_) {
return [];
}
/** @type {!Array<string>} */ const fields = [];
- const type = this.networkProperties_.Type;
- if (type != CrOnc.Type.TETHER) {
- fields.push('MacAddress');
- }
- if (type == CrOnc.Type.CELLULAR && !!this.networkProperties_.Cellular) {
+ const type = this.managedProperties_.type;
+ if (type == mojom.NetworkType.kCellular) {
fields.push(
- 'Cellular.Family', 'Cellular.NetworkTechnology',
- 'Cellular.ServingOperator.Code');
- } else if (type == CrOnc.Type.WI_FI) {
+ 'cellular.family', 'cellular.networkTechnology',
+ 'cellular.servingOperator.code');
+ } else if (type == mojom.NetworkType.kWiFi) {
fields.push(
- 'WiFi.SSID', 'WiFi.BSSID', 'WiFi.SignalStrength', 'WiFi.Security',
- 'WiFi.EAP.Outer', 'WiFi.EAP.Inner', 'WiFi.EAP.SubjectMatch',
- 'WiFi.EAP.Identity', 'WiFi.EAP.AnonymousIdentity', 'WiFi.Frequency');
- } else if (type == CrOnc.Type.WI_MAX) {
- fields.push('WiFi.SignalStrength');
+ 'wifi.ssid', 'wifi.bssid', 'wifi.signalStrength', 'wifi.security',
+ 'wifi.eap.outer', 'wifi.eap.inner', 'wifi.eap.subjectMatch',
+ 'wifi.eap.identity', 'wifi.eap.anonymousIdentity', 'wifi.frequency');
}
return fields;
},
@@ -1456,34 +1409,36 @@ Polymer({
* @private
*/
getDeviceFields_: function() {
- if (!this.networkProperties_ ||
- this.networkProperties_.Type !== CrOnc.Type.CELLULAR) {
+ if (!this.managedProperties_ ||
+ this.managedProperties_.type !== mojom.NetworkType.kCellular) {
return [];
}
return [
- 'Cellular.HomeProvider.Name', 'Cellular.HomeProvider.Country',
- 'Cellular.HomeProvider.Code', 'Cellular.Manufacturer', 'Cellular.ModelID',
- 'Cellular.FirmwareRevision', 'Cellular.HardwareRevision', 'Cellular.ESN',
- 'Cellular.ICCID', 'Cellular.IMEI', 'Cellular.IMSI', 'Cellular.MDN',
- 'Cellular.MEID', 'Cellular.MIN', 'Cellular.PRLVersion'
+ 'cellular.homeProvider.name', 'cellular.homeProvider.country',
+ 'cellular.homeProvider.code', 'cellular.manufacturer', 'cellular.modelId',
+ 'cellular.firmwareRevision', 'cellular.hardwareRevision', 'cellular.esn',
+ 'cellular.iccid', 'cellular.imei', 'cellular.imsi', 'cellular.mdn',
+ 'cellular.meid', 'cellular.min'
];
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties
+ * @param {!mojom.ManagedProperties} managedProperties
+ * @param {boolean} propertiesReceived
* @return {boolean}
* @private
*/
- showAdvanced_: function(networkProperties) {
- if (!networkProperties || networkProperties.Type == CrOnc.Type.TETHER) {
+ showAdvanced_: function(managedProperties, propertiesReceived) {
+ if (!managedProperties || !propertiesReceived) {
+ return false;
+ }
+ if (managedProperties.type == mojom.NetworkType.kTether) {
// These settings apply to the underlying WiFi network, not the Tether
// network.
return false;
}
- return this.hasAdvancedFields_() || this.hasDeviceFields_() ||
- (networkProperties.Type != CrOnc.Type.VPN &&
- this.isRememberedOrConnected_(networkProperties));
+ return this.hasAdvancedFields_() || this.hasDeviceFields_();
},
/**
@@ -1511,125 +1466,129 @@ Polymer({
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties
- * @param {!chrome.networkingPrivate.GlobalPolicy} globalPolicy
+ * @param {!mojom.ManagedProperties} managedProperties
+ * @param {!mojom.GlobalPolicy} globalPolicy
* @param {boolean} managedNetworkAvailable
* @return {boolean}
* @private
*/
hasNetworkSection_: function(
- networkProperties, globalPolicy, managedNetworkAvailable) {
- if (!networkProperties || networkProperties.Type == CrOnc.Type.TETHER) {
+ managedProperties, globalPolicy, managedNetworkAvailable) {
+ if (!managedProperties ||
+ managedProperties.type == mojom.NetworkType.kTether) {
// These settings apply to the underlying WiFi network, not the Tether
// network.
return false;
}
if (this.isBlockedByPolicy_(
- networkProperties, globalPolicy, managedNetworkAvailable)) {
+ managedProperties, globalPolicy, managedNetworkAvailable)) {
return false;
}
- if (networkProperties.Type == CrOnc.Type.CELLULAR) {
+ if (managedProperties.type == mojom.NetworkType.kCellular) {
return true;
}
- return this.isRememberedOrConnected_(networkProperties);
+ return this.isRememberedOrConnected_(managedProperties);
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties
- * @param {!chrome.networkingPrivate.GlobalPolicy} globalPolicy
+ * @param {!mojom.ManagedProperties} managedProperties
+ * @param {!mojom.GlobalPolicy} globalPolicy
* @param {boolean} managedNetworkAvailable
* @return {boolean}
* @private
*/
hasProxySection_: function(
- networkProperties, globalPolicy, managedNetworkAvailable) {
- if (!networkProperties || networkProperties.Type == CrOnc.Type.TETHER) {
+ managedProperties, globalPolicy, managedNetworkAvailable) {
+ if (!managedProperties ||
+ managedProperties.type == mojom.NetworkType.kTether) {
// Proxy settings apply to the underlying WiFi network, not the Tether
// network.
return false;
}
if (this.isBlockedByPolicy_(
- networkProperties, globalPolicy, managedNetworkAvailable)) {
+ managedProperties, globalPolicy, managedNetworkAvailable)) {
return false;
}
- return this.isRememberedOrConnected_(networkProperties);
+ return this.isRememberedOrConnected_(managedProperties);
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties
+ * @param {!mojom.ManagedProperties} managedProperties
* @return {boolean}
* @private
*/
- showCellularChooseNetwork_: function(networkProperties) {
- return !!networkProperties &&
- networkProperties.Type == CrOnc.Type.CELLULAR &&
- !!this.get('Cellular.SupportNetworkScan', this.networkProperties_);
+ showCellularChooseNetwork_: function(managedProperties) {
+ return !!managedProperties &&
+ managedProperties.type == mojom.NetworkType.kCellular &&
+ managedProperties.cellular.supportNetworkScan;
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties
* @return {boolean}
* @private
*/
- showScanningSpinner_: function(networkProperties) {
- return !!this.get('Cellular.Scanning', networkProperties);
+ showScanningSpinner_: function() {
+ if (!this.managedProperties_ ||
+ this.managedProperties_.type != mojom.NetworkType.kCellular) {
+ return false;
+ }
+ return !!this.deviceState_ && this.deviceState_.scanning;
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties
+ * @param {!mojom.ManagedProperties} managedProperties
* @return {boolean}
* @private
*/
- showCellularSim_: function(networkProperties) {
- return !!networkProperties &&
- networkProperties.Type == CrOnc.Type.CELLULAR &&
- !!networkProperties.Cellular &&
- networkProperties.Cellular.Family != 'CDMA';
+ showCellularSim_: function(managedProperties) {
+ return !!managedProperties &&
+ managedProperties.type == mojom.NetworkType.kCellular &&
+ managedProperties.cellular.family != 'CDMA';
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties
+ * @param {!mojom.ManagedProperties|undefined} managedProperties
* @return {boolean}
* @private
*/
- isArcVpn_: function(networkProperties) {
- return !!networkProperties && !!networkProperties.VPN &&
- CrOnc.getActiveValue(networkProperties.VPN.Type) ==
- CrOnc.VPNType.ARCVPN;
+ isArcVpn_: function(managedProperties) {
+ return !!managedProperties &&
+ managedProperties.type == mojom.NetworkType.kVPN &&
+ managedProperties.vpn.type == mojom.VpnType.kArc;
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties
+ * @param {!mojom.ManagedProperties|undefined} managedProperties
* @return {boolean}
* @private
*/
- isThirdPartyVpn_: function(networkProperties) {
- return !!networkProperties && !!networkProperties.VPN &&
- CrOnc.getActiveValue(networkProperties.VPN.Type) ==
- CrOnc.VPNType.THIRD_PARTY_VPN;
+ isThirdPartyVpn_: function(managedProperties) {
+ return !!managedProperties &&
+ managedProperties.type == mojom.NetworkType.kVPN &&
+ managedProperties.vpn.type == mojom.VpnType.kExtension;
},
/**
* @param {string} ipAddress
- * @param {!CrOnc.NetworkProperties} networkProperties
+ * @param {!mojom.ManagedProperties} managedProperties
* @return {boolean}
* @private
*/
- showIpAddress_: function(ipAddress, networkProperties) {
+ showIpAddress_: function(ipAddress, managedProperties) {
// Arc Vpn does not currently pass IP configuration to ChromeOS. IP address
// property holds an internal IP address Android uses to talk to ChromeOS.
// TODO(lgcheng@) Show correct IP address when we implement IP configuration
// correctly.
- if (this.isArcVpn_(networkProperties)) {
+ if (this.isArcVpn_(managedProperties)) {
return false;
}
// Cellular IP addresses are shown under the network details section.
- if (this.isCellular_(networkProperties)) {
+ if (this.isCellular_(managedProperties)) {
return false;
}
- return !!ipAddress && this.isConnectedState_(networkProperties);
+ return !!ipAddress && this.isConnectedState_(managedProperties);
},
/**
diff --git a/chromium/chrome/browser/resources/settings/internet_page/internet_known_networks_page.html b/chromium/chrome/browser/resources/settings/internet_page/internet_known_networks_page.html
index 42dcf86aa71..b0d29715c33 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/internet_known_networks_page.html
+++ b/chromium/chrome/browser/resources/settings/internet_page/internet_known_networks_page.html
@@ -5,7 +5,7 @@
<link rel="import" href="chrome://resources/cr_elements/cr_icon_button/cr_icon_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_link_row/cr_link_row.html">
<link rel="import" href="chrome://resources/cr_elements/icons.html">
-<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network_behavior.html">
+<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network_behavior_mojo.html">
<link rel="import" href="../settings_shared_css.html">
<dom-module id="settings-internet-known-networks-page">
@@ -36,10 +36,9 @@
<div class="list-item">
<cr-link-row embedded label="[[getNetworkDisplayName_(item)]]"
on-click="fireShowDetails_">
- <template is="dom-if" if="[[isPolicySourceMojo(item.source))]]">
+ <template is="dom-if" if="[[isPolicySource(item.source))]]">
<cr-policy-indicator on-click="doNothing_"
- indicator-type="[[getIndicatorTypeForSourceMojo(
- item.source)]]">
+ indicator-type="[[getIndicatorTypeForSource(item.source)]]">
</cr-policy-indicator>
</template>
</cr-link-row>
@@ -61,10 +60,9 @@
<div class="list-item">
<cr-link-row embedded label="[[getNetworkDisplayName_(item)]]"
on-click="fireShowDetails_">
- <template is="dom-if" if="[[isPolicySourceMojo(item.source))]]">
+ <template is="dom-if" if="[[isPolicySource(item.source))]]">
<cr-policy-indicator on-click="doNothing_"
- indicator-type="[[getIndicatorTypeForSourceMojo(
- item.source)]]">
+ indicator-type="[[getIndicatorTypeForSource(item.source)]]">
</cr-policy-indicator>
</template>
</cr-link-row>
diff --git a/chromium/chrome/browser/resources/settings/internet_page/internet_known_networks_page.js b/chromium/chrome/browser/resources/settings/internet_page/internet_known_networks_page.js
index 6d613efeda5..2e42c952c87 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/internet_known_networks_page.js
+++ b/chromium/chrome/browser/resources/settings/internet_page/internet_known_networks_page.js
@@ -12,7 +12,7 @@ Polymer({
behaviors: [
CrNetworkListenerBehavior,
- CrPolicyNetworkBehavior,
+ CrPolicyNetworkBehaviorMojo,
],
properties: {
@@ -64,15 +64,14 @@ Polymer({
* This UI will use both the networkingPrivate extension API and the
* networkConfig mojo API until we provide all of the required functionality
* in networkConfig. TODO(stevenjb): Remove use of networkingPrivate api.
- * @private {?chromeos.networkConfig.mojom.CrosNetworkConfigProxy}
+ * @private {?chromeos.networkConfig.mojom.CrosNetworkConfigRemote}
*/
- networkConfigProxy_: null,
+ networkConfig_: null,
/** @override */
created: function() {
- this.networkConfigProxy_ =
- network_config.MojoInterfaceProviderImpl.getInstance()
- .getMojoServiceProxy();
+ this.networkConfig_ = network_config.MojoInterfaceProviderImpl.getInstance()
+ .getMojoServiceRemote();
},
/** CrosNetworkConfigObserver impl */
@@ -99,7 +98,7 @@ Polymer({
limit: chromeos.networkConfig.mojom.kNoLimit,
networkType: OncMojo.getNetworkTypeFromString(this.networkType),
};
- this.networkConfigProxy_.getNetworkStateList(filter).then(response => {
+ this.networkConfig_.getNetworkStateList(filter).then(response => {
this.networkStateList_ = response.result;
});
},
@@ -147,7 +146,7 @@ Polymer({
* @private
*/
getNetworkDisplayName_: function(networkState) {
- return OncMojo.getNetworkDisplayName(networkState);
+ return OncMojo.getNetworkStateDisplayName(networkState);
},
/**
@@ -162,14 +161,15 @@ Polymer({
// We need to make a round trip to Chrome in order to retrieve the managed
// properties for the network. The delay is not noticeable (~5ms) and is
// preferable to initiating a query for every known network at load time.
- this.networkingPrivate.getManagedProperties(
- this.selectedGuid_, properties => {
- if (chrome.runtime.lastError || !properties) {
- console.error(
- 'Unexpected error: ' + chrome.runtime.lastError.message);
+ this.networkConfig_.getManagedProperties(this.selectedGuid_)
+ .then(response => {
+ const properties = response.result;
+ if (!properties) {
+ console.error('Properties not found for: ' + this.selectedGuid_);
return;
}
- if (this.isNetworkPolicyEnforced(properties.Priority)) {
+ if (properties.priority &&
+ this.isNetworkPolicyEnforced(properties.priority)) {
this.showAddPreferred_ = false;
this.showRemovePreferred_ = false;
} else {
@@ -177,22 +177,37 @@ Polymer({
this.showAddPreferred_ = !preferred;
this.showRemovePreferred_ = preferred;
}
- this.enableForget_ = !this.isPolicySource(properties.Source);
+ this.enableForget_ = !this.isPolicySource(networkState.source);
/** @type {!CrActionMenuElement} */ (this.$.dotsMenu)
.showAt(/** @type {!Element} */ (button));
});
event.stopPropagation();
},
+ /**
+ * @param {!chromeos.networkConfig.mojom.ConfigProperties} config
+ * @private
+ */
+ setProperties_: function(config) {
+ this.networkConfig_.setProperties(this.selectedGuid_, config)
+ .then(response => {
+ if (!response.success) {
+ console.error(
+ 'Unable to set properties for: ' + this.selectedGuid_ + ': ' +
+ JSON.stringify(config));
+ }
+ });
+ },
+
/** @private */
onRemovePreferredTap_: function() {
- this.networkingPrivate.setProperties(this.selectedGuid_, {Priority: 0});
+ this.setProperties_({priority: {value: 0}});
/** @type {!CrActionMenuElement} */ (this.$.dotsMenu).close();
},
/** @private */
onAddPreferredTap_: function() {
- this.networkingPrivate.setProperties(this.selectedGuid_, {Priority: 1});
+ this.setProperties_({priority: {value: 1}});
/** @type {!CrActionMenuElement} */ (this.$.dotsMenu).close();
},
diff --git a/chromium/chrome/browser/resources/settings/internet_page/internet_page.html b/chromium/chrome/browser/resources/settings/internet_page/internet_page.html
index 3727b4dad9a..10eeff05b0a 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/internet_page.html
+++ b/chromium/chrome/browser/resources/settings/internet_page/internet_page.html
@@ -9,6 +9,7 @@
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
+<link rel="import" href="../i18n_setup.html">
<link rel="import" href="../prefs/prefs.html">
<link rel="import" href="../route.html">
<link rel="import" href="../settings_page/settings_animated_pages.html">
@@ -65,7 +66,7 @@
<cr-icon-button class$="[[getAddNetworkClass_('VPN')]]"
aria-label="$i18n{internetAddVPN}"></cr-icon-button>
</div>
- <template is="dom-repeat" items="[[thirdPartyVpnProviders_]]">
+ <template is="dom-repeat" items="[[vpnProviders_]]">
<div actionable class="list-item"
on-click="onAddThirdPartyVpnTap_">
<div class="start settings-box-text">
@@ -76,16 +77,6 @@
</cr-icon-button>
</div>
</template>
- <template is="dom-if" if="[[arcVpnProviders_.length]]">
- <div actionable class="list-item" id="addArcVpn"
- on-click="onAddArcVpnTap_">
- <div class="setting-box-text">
- $i18n{internetAddArcVPN}
- </div>
- <cr-icon-button class="icon-external"
- aria-label$="$i18n{internetAddArcVPN}"></cr-icon-button>
- </div>
- </template>
</div>
</template>
</template>
@@ -129,8 +120,7 @@
device-state="[[getDeviceState_(subpageType_, deviceStates)]]"
tether-device-state="[[getTetherDeviceState_(deviceStates)]]"
global-policy="[[globalPolicy_]]"
- third-party-vpn-providers="[[thirdPartyVpnProviders_]]"
- arc-vpn-providers="[[arcVpnProviders_]]"
+ vpn-providers="[[vpnProviders_]]"
show-spinner="{{showSpinner_}}">
</settings-internet-subpage>
</settings-subpage>
diff --git a/chromium/chrome/browser/resources/settings/internet_page/internet_page.js b/chromium/chrome/browser/resources/settings/internet_page/internet_page.js
index bb18ded6ab7..1737c822b40 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/internet_page.js
+++ b/chromium/chrome/browser/resources/settings/internet_page/internet_page.js
@@ -15,6 +15,7 @@ Polymer({
is: 'settings-internet-page',
behaviors: [
+ CrNetworkListenerBehavior,
I18nBehavior,
settings.RouteObserverBehavior,
WebUIListenerBehavior,
@@ -84,11 +85,8 @@ Polymer({
value: false,
},
- /** @private {!chrome.networkingPrivate.GlobalPolicy|undefined} */
- globalPolicy_: {
- type: Object,
- value: null,
- },
+ /** @private {!chromeos.networkConfig.mojom.GlobalPolicy|undefined} */
+ globalPolicy_: Object,
/**
* Whether a managed network is available in the visible network list.
@@ -100,23 +98,11 @@ Polymer({
},
/**
- * List of third party VPN providers.
- * @type {!Array<!chrome.networkingPrivate.ThirdPartyVPNProperties>}
- * @private
- */
- thirdPartyVpnProviders_: {
- type: Array,
- value: function() {
- return [];
- }
- },
-
- /**
- * List of Arc VPN providers.
- * @type {!Array<!settings.ArcVpnProvider>}
+ * List of third party (Extension + Arc) VPN providers.
+ * @type {!Array<!chromeos.networkConfig.mojom.VpnProvider>}
* @private
*/
- arcVpnProviders_: {
+ vpnProviders_: {
type: Array,
value: function() {
return [];
@@ -145,16 +131,6 @@ Polymer({
'show-networks': 'onShowNetworks_',
},
- // chrome.management listeners
- /** @private {Function} */
- onExtensionAddedListener_: null,
-
- /** @private {Function} */
- onExtensionRemovedListener_: null,
-
- /** @private {Function} */
- onExtensionDisabledListener_: null,
-
/** @private {?settings.InternetPageBrowserProxy} */
browserProxy_: null,
@@ -162,58 +138,23 @@ Polymer({
* This UI will use both the networkingPrivate extension API and the
* networkConfig mojo API until we provide all of the required functionality
* in networkConfig. TODO(stevenjb): Remove use of networkingPrivate api.
- * @private {?chromeos.networkConfig.mojom.CrosNetworkConfigProxy}
+ * @private {?chromeos.networkConfig.mojom.CrosNetworkConfigRemote}
*/
- networkConfigProxy_: null,
+ networkConfig_: null,
/** @override */
created: function() {
this.browserProxy_ = settings.InternetPageBrowserProxyImpl.getInstance();
- this.networkConfigProxy_ =
- network_config.MojoInterfaceProviderImpl.getInstance()
- .getMojoServiceProxy();
- },
-
- /** @override */
- ready: function() {
- this.browserProxy_.setUpdateArcVpnProvidersCallback(
- this.onArcVpnProvidersReceived_.bind(this));
- this.browserProxy_.requestArcVpnProviders();
+ this.networkConfig_ = network_config.MojoInterfaceProviderImpl.getInstance()
+ .getMojoServiceRemote();
},
/** @override */
attached: function() {
- this.onExtensionAddedListener_ =
- this.onExtensionAddedListener_ || this.onExtensionAdded_.bind(this);
- chrome.management.onInstalled.addListener(this.onExtensionAddedListener_);
- chrome.management.onEnabled.addListener(this.onExtensionAddedListener_);
-
- this.onExtensionRemovedListener_ =
- this.onExtensionRemovedListener_ || this.onExtensionRemoved_.bind(this);
- chrome.management.onUninstalled.addListener(
- this.onExtensionRemovedListener_);
-
- this.onExtensionDisabledListener_ = this.onExtensionDisabledListener_ ||
- this.onExtensionDisabled_.bind(this);
- chrome.management.onDisabled.addListener(this.onExtensionDisabledListener_);
-
- chrome.management.getAll(this.onGetAllExtensions_.bind(this));
-
- this.networkingPrivate.getGlobalPolicy(policy => {
- this.globalPolicy_ = policy;
+ this.networkConfig_.getGlobalPolicy().then(response => {
+ this.globalPolicy_ = response.result;
});
- },
-
- /** @override */
- detached: function() {
- chrome.management.onInstalled.removeListener(
- assert(this.onExtensionAddedListener_));
- chrome.management.onEnabled.removeListener(
- assert(this.onExtensionAddedListener_));
- chrome.management.onUninstalled.removeListener(
- assert(this.onExtensionRemovedListener_));
- chrome.management.onDisabled.removeListener(
- assert(this.onExtensionDisabledListener_));
+ this.onVpnProvidersChanged();
},
/**
@@ -278,6 +219,15 @@ Polymer({
}
},
+ /** CrosNetworkConfigObserver impl */
+ onVpnProvidersChanged: function() {
+ this.networkConfig_.getVpnProviders().then(response => {
+ const providers = response.providers;
+ providers.sort(this.compareVpnProviders_);
+ this.vpnProviders_ = providers;
+ });
+ },
+
/**
* Event triggered by a device state enabled toggle.
* @param {!CustomEvent<!{
@@ -287,7 +237,7 @@ Polymer({
* @private
*/
onDeviceEnabledToggled_: function(event) {
- this.networkConfigProxy_.setNetworkTypeEnabledState(
+ this.networkConfig_.setNetworkTypeEnabledState(
event.detail.type, event.detail.enabled);
},
@@ -336,7 +286,7 @@ Polymer({
const params = new URLSearchParams;
params.append('guid', networkState.guid);
params.append('type', oncType);
- params.append('name', OncMojo.getNetworkDisplayName(networkState));
+ params.append('name', OncMojo.getNetworkStateDisplayName(networkState));
settings.navigateTo(settings.routes.NETWORK_DETAIL, params);
},
@@ -454,19 +404,12 @@ Polymer({
},
/**
- * @param {!{model:
- * !{item: !chrome.networkingPrivate.ThirdPartyVPNProperties},
- * }} event
+ * @param {!{model: !{item: !mojom.VpnProvider}}} event
* @private
*/
onAddThirdPartyVpnTap_: function(event) {
const provider = event.model.item;
- this.browserProxy_.addThirdPartyVpn(provider.ExtensionID);
- },
-
- /** @private */
- onAddArcVpnTap_: function() {
- this.showNetworksSubpage_(mojom.NetworkType.kVPN);
+ this.browserProxy_.addThirdPartyVpn(provider.appId);
},
/**
@@ -483,101 +426,31 @@ Polymer({
},
/**
- * chrome.management.getAll callback.
- * @param {!Array<!chrome.management.ExtensionInfo>} extensions
- * @private
+ * @param {!mojom.VpnProvider} vpnProvider1
+ * @param {!mojom.VpnProvider} vpnProvider2
+ * @return {number}
*/
- onGetAllExtensions_: function(extensions) {
- const vpnProviders = [];
- for (let i = 0; i < extensions.length; ++i) {
- this.addVpnProvider_(vpnProviders, extensions[i]);
- }
- this.thirdPartyVpnProviders_ = vpnProviders;
- },
-
- /**
- * If |extension| is a third-party VPN provider, add it to |vpnProviders|.
- * @param {!Array<!chrome.networkingPrivate.ThirdPartyVPNProperties>}
- * vpnProviders
- * @param {!chrome.management.ExtensionInfo} extension
- * @private
- */
- addVpnProvider_: function(vpnProviders, extension) {
- if (!extension.enabled ||
- extension.permissions.indexOf('vpnProvider') == -1) {
- return;
- }
- if (vpnProviders.find(function(provider) {
- return provider.ExtensionID == extension.id;
- })) {
- return;
+ compareVpnProviders_: function(vpnProvider1, vpnProvider2) {
+ // Show Extension VPNs before Arc VPNs.
+ if (vpnProvider1.type < vpnProvider2.type) {
+ return -1;
}
- const newProvider = {
- ExtensionID: extension.id,
- ProviderName: extension.name,
- };
- vpnProviders.push(newProvider);
- },
-
- /**
- * chrome.management.onInstalled or onEnabled event.
- * @param {!chrome.management.ExtensionInfo} extension
- * @private
- */
- onExtensionAdded_: function(extension) {
- this.addVpnProvider_(this.thirdPartyVpnProviders_, extension);
- },
-
- /**
- * chrome.management.onUninstalled event.
- * @param {string} extensionId
- * @private
- */
- onExtensionRemoved_: function(extensionId) {
- for (let i = 0; i < this.thirdPartyVpnProviders_.length; ++i) {
- const provider = this.thirdPartyVpnProviders_[i];
- if (provider.ExtensionID == extensionId) {
- this.splice('thirdPartyVpnProviders_', i, 1);
- break;
- }
+ if (vpnProvider1.type > vpnProvider2.type) {
+ return 1;
}
- },
-
- /**
- * Compares Arc VPN Providers based on LastlauchTime
- * @param {!settings.ArcVpnProvider} arcVpnProvider1
- * @param {!settings.ArcVpnProvider} arcVpnProvider2
- * @private
- */
- compareArcVpnProviders_: function(arcVpnProvider1, arcVpnProvider2) {
- if (arcVpnProvider1.LastLaunchTime > arcVpnProvider2.LastLaunchTime) {
+ // Show VPNs of the same type by lastLaunchTime.
+ if (vpnProvider1.lastLaunchTime.internalValue >
+ vpnProvider2.lastLaunchTime.internalValue) {
return -1;
}
- if (arcVpnProvider1.LastLaunchTime < arcVpnProvider2.LastLaunchTime) {
+ if (vpnProvider1.lastLaunchTime.internalValue <
+ vpnProvider2.lastLaunchTime.internalValue) {
return 1;
}
return 0;
},
/**
- * @param {?Array<!settings.ArcVpnProvider>} arcVpnProviders
- * @private
- */
- onArcVpnProvidersReceived_: function(arcVpnProviders) {
- arcVpnProviders.sort(this.compareArcVpnProviders_);
- this.arcVpnProviders_ = arcVpnProviders;
- },
-
- /**
- * chrome.management.onDisabled event.
- * @param {{id: string}} extension
- * @private
- */
- onExtensionDisabled_: function(extension) {
- this.onExtensionRemoved_(extension.id);
- },
-
- /**
* @param {!Array<!OncMojo.DeviceStateProperties>} deviceStates
* @param {string} type
* @return {boolean}
@@ -591,7 +464,7 @@ Polymer({
},
/**
- * @param {!chrome.networkingPrivate.GlobalPolicy} globalPolicy
+ * @param {!mojom.GlobalPolicy} globalPolicy
* @param {boolean} managedNetworkAvailable
* @return {boolean}
*/
@@ -600,17 +473,17 @@ Polymer({
return true;
}
- return !globalPolicy.AllowOnlyPolicyNetworksToConnect &&
- (!globalPolicy.AllowOnlyPolicyNetworksToConnectIfAvailable ||
+ return !globalPolicy.allowOnlyPolicyNetworksToConnect &&
+ (!globalPolicy.allowOnlyPolicyNetworksToConnectIfAvailable ||
!managedNetworkAvailable);
},
/**
- * @param {!chrome.networkingPrivate.ThirdPartyVPNProperties} provider
+ * @param {!mojom.VpnProvider} provider
* @return {string}
*/
getAddThirdPartyVpnLabel_: function(provider) {
- return this.i18n('internetAddThirdPartyVPN', provider.ProviderName || '');
+ return this.i18n('internetAddThirdPartyVPN', provider.providerName || '');
},
/**
@@ -625,7 +498,7 @@ Polymer({
onNetworkConnect_: function(event) {
const networkState = event.detail.networkState;
const oncType = OncMojo.getNetworkTypeString(networkState.type);
- const displayName = OncMojo.getNetworkDisplayName(networkState);
+ const displayName = OncMojo.getNetworkStateDisplayName(networkState);
if (!event.detail.bypassConnectionDialog &&
networkState.type == mojom.NetworkType.kTether &&
@@ -647,24 +520,32 @@ Polymer({
return;
}
- this.networkingPrivate.startConnect(networkState.guid, () => {
- if (chrome.runtime.lastError) {
- const message = chrome.runtime.lastError.message;
- if (message == 'connecting' || message == 'connect-canceled' ||
- message == 'connected' || message == 'Error.InvalidNetworkGuid') {
+ this.networkConfig_.startConnect(networkState.guid).then(response => {
+ switch (response.result) {
+ case mojom.StartConnectResult.kSuccess:
+ return;
+ case mojom.StartConnectResult.kInvalidGuid:
+ case mojom.StartConnectResult.kInvalidState:
+ case mojom.StartConnectResult.kCanceled:
+ // TODO(stevenjb/khorimoto): Consider handling these cases.
+ return;
+ case mojom.StartConnectResult.kNotConfigured:
+ if (!isMobile) {
+ this.showConfig_(
+ true /* configAndConnect */, oncType, networkState.guid,
+ displayName);
+ }
+ return;
+ case mojom.StartConnectResult.kBlocked:
+ // This shouldn't happen, the UI should prevent this, fall through and
+ // show the error.
+ case mojom.StartConnectResult.kUnknown:
+ console.error(
+ 'startConnect failed for: ' + networkState.guid +
+ ' Error: ' + response.message);
return;
- }
- console.error(
- 'networkingPrivate.startConnect error: ' + message +
- ' For: ' + networkState.guid);
-
- // There is no configuration flow for Mobile Networks.
- if (!isMobile) {
- this.showConfig_(
- true /* configAndConnect */, oncType, networkState.guid,
- displayName);
- }
}
+ assertNotReached();
});
},
});
diff --git a/chromium/chrome/browser/resources/settings/internet_page/internet_page_browser_proxy.js b/chromium/chrome/browser/resources/settings/internet_page/internet_page_browser_proxy.js
index 42473ab988b..f39bf9141c8 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/internet_page_browser_proxy.js
+++ b/chromium/chrome/browser/resources/settings/internet_page/internet_page_browser_proxy.js
@@ -5,20 +5,16 @@
/** @fileoverview A helper object used for Internet page. */
cr.exportPath('settings');
-/**
- * @typedef {{
- * PackageName: string,
- * ProviderName: string,
- * AppID: string,
- * LastLaunchTime: number,
- * }}
- */
-settings.ArcVpnProvider;
-
cr.define('settings', function() {
/** @interface */
class InternetPageBrowserProxy {
/**
+ * Shows the Cellular activation UI.
+ * @param {string} guid
+ */
+ showCellularSetupUI(guid) {}
+
+ /**
* Shows configuration for external VPNs. Includes ThirdParty (extension
* configured) VPNs, and Arc VPNs.
* @param {string} guid
@@ -33,18 +29,6 @@ cr.define('settings', function() {
addThirdPartyVpn(appId) {}
/**
- * Requests Chrome to send list of Arc VPN providers.
- */
- requestArcVpnProviders() {}
-
- /**
- * |callback| is run when there is update of Arc VPN providers.
- * Available after |requestArcVpnProviders| has been called.
- * @param {function(?Array<settings.ArcVpnProvider>):void} callback
- */
- setUpdateArcVpnProvidersCallback(callback) {}
-
- /**
* Requests that Chrome send the list of devices whose "Google Play
* Services" notifications are disabled (these notifications must be enabled
* to utilize Instant Tethering). The names will be provided via
@@ -67,6 +51,11 @@ cr.define('settings', function() {
*/
class InternetPageBrowserProxyImpl {
/** @override */
+ showCellularSetupUI(guid) {
+ chrome.send('showCellularSetupUI', [guid]);
+ }
+
+ /** @override */
configureThirdPartyVpn(guid) {
chrome.send('configureThirdPartyVpn', [guid]);
}
@@ -77,16 +66,6 @@ cr.define('settings', function() {
}
/** @override */
- requestArcVpnProviders() {
- chrome.send('requestArcVpnProviders');
- }
-
- /** @override */
- setUpdateArcVpnProvidersCallback(callback) {
- cr.addWebUIListener('sendArcVpnProviders', callback);
- }
-
- /** @override */
requestGmsCoreNotificationsDisabledDeviceNames() {
chrome.send('requestGmsCoreNotificationsDisabledDeviceNames');
}
diff --git a/chromium/chrome/browser/resources/settings/internet_page/internet_subpage.html b/chromium/chrome/browser/resources/settings/internet_page/internet_subpage.html
index 3516ce9f4de..3307caa6c8e 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/internet_subpage.html
+++ b/chromium/chrome/browser/resources/settings/internet_page/internet_subpage.html
@@ -5,12 +5,15 @@
<link rel="import" href="chrome://resources/cr_elements/cr_icon_button/cr_icon_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_link_row/cr_link_row.html">
<link rel="import" href="chrome://resources/cr_elements/cr_toggle/cr_toggle.html">
+<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network_behavior_mojo.html">
<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html">
<link rel="import" href="chrome://resources/html/chromeos/onc_mojo.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
<link rel="import" href="internet_page_browser_proxy.html">
+<link rel="import" href="../i18n_setup.html">
+<link rel="import" href="../route.html">
<link rel="import" href="../settings_shared_css.html">
<dom-module id="settings-internet-subpage">
@@ -154,16 +157,17 @@
<!-- Text shown if no networks exist. -->
<div hidden="[[shouldShowNetworkList_(networkStateList_)]]"
inner-h-t-m-l=
- "[[getNoNetworksString_(deviceState, tetherDeviceState)]]"
+ "[[getNoNetworksInnerHtml_(deviceState, tetherDeviceState)]]"
class="no-networks">
</div>
<template is="dom-if" if="[[matchesType_('VPN', deviceState)]]">
<!-- Third party VPNs. -->
- <template is="dom-repeat" items="[[thirdPartyVpnProviders]]">
- <div id="[[item.ProviderName]]"
+ <template is="dom-repeat"
+ items="[[getVpnProviders_(vpnProviders, thirdPartyVpns_)]]">
+ <div id="[[item.providerName]]"
class="vpn-header layout horizontal center">
- <div class="flex settings-box-text">[[item.ProviderName]]</div>
+ <div class="flex settings-box-text">[[item.providerName]]</div>
<cr-icon-button class="icon-add-circle"
aria-label$="[[getAddThirdPartyVpnA11yString_(item)]]"
on-click="onAddThirdPartyVpnTap_" tabindex$="[[tabindex]]">
@@ -179,26 +183,6 @@
$i18n{internetNoNetworks}
</div>
</template>
- <!-- Arc VPNs. -->
- <template is="dom-repeat" items="[[arcVpnProviders]]">
- <div id="[[item.ProviderName]]"
- class="vpn-header layout horizontal center">
- <div class="flex settings-box-text">[[item.ProviderName]]</div>
- <cr-icon-button class="icon-add-circle"
- aria-label$="[[getAddArcVpnAllyString_(item)]]"
- on-click="onAddArcVpnTap_" tabindex$="[[tabindex]]">
- </cr-icon-button>
- </div>
- <cr-network-list show-buttons
- hidden$="[[!haveArcVpnNetwork_(arcVpns_, item)]]"
- networks="[[getArcVpnNetworks_(arcVpns_, item)]]"
- on-selected="onNetworkSelected_">
- </cr-network-list>
- <div hidden$="[[haveArcVpnNetwork_(arcVpns_, item)]]"
- class="no-networks">
- $i18n{internetNoNetworks}
- </div>
- </template>
</template>
</div>
diff --git a/chromium/chrome/browser/resources/settings/internet_page/internet_subpage.js b/chromium/chrome/browser/resources/settings/internet_page/internet_subpage.js
index 0b5b7863c2f..9996d3b6538 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/internet_subpage.js
+++ b/chromium/chrome/browser/resources/settings/internet_page/internet_subpage.js
@@ -4,7 +4,7 @@
/**
* @fileoverview Polymer element for displaying information about WiFi,
- * WiMAX, or virtual networks.
+ * Cellular, or virtual networks.
*/
(function() {
@@ -16,7 +16,7 @@ Polymer({
behaviors: [
CrNetworkListenerBehavior,
- CrPolicyNetworkBehavior,
+ CrPolicyNetworkBehaviorMojo,
settings.RouteObserverBehavior,
I18nBehavior,
],
@@ -44,21 +44,14 @@ Polymer({
*/
tetherDeviceState: Object,
- /** @type {!chrome.networkingPrivate.GlobalPolicy|undefined} */
+ /** @type {!chromeos.networkConfig.mojom.GlobalPolicy|undefined} */
globalPolicy: Object,
/**
- * List of third party VPN providers.
- * @type
- * {!Array<!chrome.networkingPrivate.ThirdPartyVPNProperties>|undefined}
+ * List of third party (Extension + Arc) VPN providers.
+ * @type {!Array<!chromeos.networkConfig.mojom.VpnProvider>}
*/
- thirdPartyVpnProviders: Array,
-
- /**
- * List of Arc VPN providers.
- * @type {!Array<!settings.ArcVpnProvider>|undefined}
- */
- arcVpnProviders: Array,
+ vpnProviders: Array,
showSpinner: {
type: Boolean,
@@ -89,17 +82,6 @@ Polymer({
},
/**
- * Dictionary of lists of network states for Arc VPNs.
- * @private {!Object<!Array<!OncMojo.NetworkStateProperties>>}
- */
- arcVpns_: {
- type: Object,
- value: function() {
- return {};
- }
- },
-
- /**
* List of potential Tether hosts whose "Google Play Services" notifications
* are disabled (these notifications are required to use Instant Tethering).
* @private {!Array<string>}
@@ -122,6 +104,12 @@ Polymer({
loadTimeData.getBoolean('showTechnologyBadge');
}
},
+
+ /** @private */
+ hasCompletedScanSinceLastEnabled_: {
+ type: Boolean,
+ value: false,
+ },
},
observers: ['deviceStateChanged_(deviceState)'],
@@ -136,16 +124,15 @@ Polymer({
* This UI will use both the networkingPrivate extension API and the
* networkConfig mojo API until we provide all of the required functionality
* in networkConfig. TODO(stevenjb): Remove use of networkingPrivate api.
- * @private {?chromeos.networkConfig.mojom.CrosNetworkConfigProxy}
+ * @private {?chromeos.networkConfig.mojom.CrosNetworkConfigRemote}
*/
- networkConfigProxy_: null,
+ networkConfig_: null,
/** @override */
created: function() {
this.browserProxy_ = settings.InternetPageBrowserProxyImpl.getInstance();
- this.networkConfigProxy_ =
- network_config.MojoInterfaceProviderImpl.getInstance()
- .getMojoServiceProxy();
+ this.networkConfig_ = network_config.MojoInterfaceProviderImpl.getInstance()
+ .getMojoServiceRemote();
},
/** @override */
@@ -170,32 +157,52 @@ Polymer({
this.stopScanning_();
return;
}
+ this.init();
+ },
+
+ init: function() {
// Clear any stale data.
this.networkStateList_ = [];
this.thirdPartyVpns_ = {};
- this.arcVpns_ = {};
+ this.hasCompletedScanSinceLastEnabled_ = false;
+ this.showSpinner = false;
+
// Request the list of networks and start scanning if necessary.
this.getNetworkStateList_();
this.updateScanning_();
},
/**
- * CrosNetworkConfigObserver impl
+ * CrNetworkListenerBehavior override
* @param {!Array<OncMojo.NetworkStateProperties>} networks
*/
onActiveNetworksChanged: function(networks) {
this.getNetworkStateList_();
},
- /** CrosNetworkConfigObserver impl */
+ /** CrNetworkListenerBehavior override */
onNetworkStateListChanged: function() {
this.getNetworkStateList_();
},
+ /** CrNetworkListenerBehavior override */
+ onVpnProvidersChanged: function() {
+ if (this.deviceState.type != mojom.NetworkType.kVPN) {
+ return;
+ }
+ this.getNetworkStateList_();
+ },
+
/** @private */
deviceStateChanged_: function() {
- this.showSpinner =
- this.deviceState !== undefined && !!this.deviceState.scanning;
+ if (this.deviceState !== undefined) {
+ // A scan has completed if the spinner was active (i.e., scanning was
+ // active) and the device is no longer scanning.
+ this.hasCompletedScanSinceLastEnabled_ = this.showSpinner &&
+ !this.deviceState.scanning &&
+ this.deviceState.deviceState == mojom.DeviceStateType.kEnabled;
+ this.showSpinner = !!this.deviceState.scanning;
+ }
// Scans should only be triggered by the "networks" subpage.
if (settings.getCurrentRoute() != settings.routes.INTERNET_NETWORKS) {
@@ -246,9 +253,9 @@ Polymer({
return;
}
const INTERVAL_MS = 10 * 1000;
- this.networkConfigProxy_.requestNetworkScan(this.deviceState.type);
+ this.networkConfig_.requestNetworkScan(this.deviceState.type);
this.scanIntervalId_ = window.setInterval(() => {
- this.networkConfigProxy_.requestNetworkScan(this.deviceState.type);
+ this.networkConfig_.requestNetworkScan(this.deviceState.type);
}, INTERVAL_MS);
},
@@ -271,7 +278,7 @@ Polymer({
limit: chromeos.networkConfig.mojom.kNoLimit,
networkType: this.deviceState.type,
};
- this.networkConfigProxy_.getNetworkStateList(filter).then(response => {
+ this.networkConfig_.getNetworkStateList(filter).then(response => {
this.onGetNetworks_(response.result);
});
},
@@ -294,48 +301,84 @@ Polymer({
limit: chromeos.networkConfig.mojom.kNoLimit,
networkType: mojom.NetworkType.kTether,
};
- this.networkConfigProxy_.getNetworkStateList(filter).then(response => {
+ this.networkConfig_.getNetworkStateList(filter).then(response => {
const tetherNetworkStates = response.result;
this.networkStateList_ = networkStates.concat(tetherNetworkStates);
});
return;
}
- // For VPNs, separate out third party VPNs and Arc VPNs.
+ // For VPNs, separate out third party (Extension + Arc) VPNs.
if (this.deviceState.type == mojom.NetworkType.kVPN) {
const builtinNetworkStates = [];
const thirdPartyVpns = {};
- const arcVpns = {};
networkStates.forEach(state => {
assert(state.type == mojom.NetworkType.kVPN);
switch (state.vpn.type) {
- case mojom.VPNType.kL2TPIPsec:
- case mojom.VPNType.kOpenVPN:
+ case mojom.VpnType.kL2TPIPsec:
+ case mojom.VpnType.kOpenVPN:
builtinNetworkStates.push(state);
break;
- case mojom.VPNType.kThirdPartyVPN:
- const providerName = state.vpn.providerName;
- thirdPartyVpns[providerName] = thirdPartyVpns[providerName] || [];
- thirdPartyVpns[providerName].push(state);
- break;
- case mojom.VPNType.kArcVPN:
- const arcProviderName = this.get('VPN.Host', state);
- if (OncMojo.connectionStateIsConnected(state.connectionState)) {
- arcVpns[arcProviderName] = arcVpns[arcProviderName] || [];
- arcVpns[arcProviderName].push(state);
+ case mojom.VpnType.kArc:
+ // Only show connected Arc VPNs.
+ if (!OncMojo.connectionStateIsConnected(state.connectionState)) {
+ break;
}
+ // Otherwise Arc VPNs are treated the same as Extension VPNs.
+ case mojom.VpnType.kExtension:
+ const providerId = state.vpn.providerId;
+ thirdPartyVpns[providerId] = thirdPartyVpns[providerId] || [];
+ thirdPartyVpns[providerId].push(state);
break;
}
});
networkStates = builtinNetworkStates;
this.thirdPartyVpns_ = thirdPartyVpns;
- this.arcVpns_ = arcVpns;
}
this.networkStateList_ = networkStates;
},
/**
+ * Returns an ordered list of VPN providers for all third party VPNs and any
+ * other known providers.
+ * @param {!Array<!chromeos.networkConfig.mojom.VpnProvider>} vpnProviders
+ * @param {!Object<!Array<!OncMojo.NetworkStateProperties>>} thirdPartyVpns
+ * @return {!Array<!chromeos.networkConfig.mojom.VpnProvider>}
+ * @private
+ */
+ getVpnProviders_(vpnProviders, thirdPartyVpns) {
+ // First add providers for configured thirdPartyVpns. This list will
+ // generally be empty or small.
+ const configuredProviders = [];
+ for (const vpnList of Object.values(thirdPartyVpns)) {
+ assert(vpnList.length > 0);
+ // All vpns in the list will have the same type and provider id.
+ const vpn = vpnList[0].vpn;
+ const provider = {
+ type: vpn.type,
+ providerId: vpn.providerId,
+ providerName: vpn.providerName || vpn.providerId,
+ appId: '',
+ lastLaunchTime: {internalValue: 0}
+ };
+ configuredProviders.push(provider);
+ }
+ // Next update or append known third party providers.
+ const unconfiguredProviders = [];
+ for (const provider of vpnProviders) {
+ const idx = configuredProviders.findIndex(
+ p => p.providerId == provider.providerId);
+ if (idx >= 0) {
+ configuredProviders[idx] = provider;
+ } else {
+ unconfiguredProviders.push(provider);
+ }
+ }
+ return configuredProviders.concat(unconfiguredProviders);
+ },
+
+ /**
* @param {!Array<string>} notificationsDisabledDeviceNames
* @private
*/
@@ -402,43 +445,32 @@ Polymer({
return this.i18n('internetToggleMobileA11yLabel');
case mojom.NetworkType.kWiFi:
return this.i18n('internetToggleWiFiA11yLabel');
- case mojom.NetworkType.kWiMAX:
- return this.i18n('internetToggleWiMAXA11yLabel');
}
assertNotReached();
return '';
},
/**
- * @param {!chrome.networkingPrivate.ThirdPartyVPNProperties} vpnState
- * @return {string}
- * @private
- */
- getAddThirdPartyVpnA11yString_: function(vpnState) {
- return this.i18n('internetAddThirdPartyVPN', vpnState.ProviderName || '');
- },
-
- /**
- * @param {!settings.ArcVpnProvider} arcVpn
+ * @param {!mojom.VpnProvider} provider
* @return {string}
* @private
*/
- getAddArcVpnAllyString_: function(arcVpn) {
- return this.i18n('internetAddArcVPNProvider', arcVpn.ProviderName);
+ getAddThirdPartyVpnA11yString_: function(provider) {
+ return this.i18n('internetAddThirdPartyVPN', provider.providerName || '');
},
/**
- * @param {!chrome.networkingPrivate.GlobalPolicy} globalPolicy
+ * @param {!mojom.GlobalPolicy} globalPolicy
* @return {boolean}
* @private
*/
allowAddConnection_: function(globalPolicy) {
- return globalPolicy && !globalPolicy.AllowOnlyPolicyNetworksToConnect;
+ return globalPolicy && !globalPolicy.allowOnlyPolicyNetworksToConnect;
},
/**
* @param {!OncMojo.DeviceStateProperties|undefined} deviceState
- * @param {!chrome.networkingPrivate.GlobalPolicy} globalPolicy
+ * @param {!mojom.GlobalPolicy} globalPolicy
* @return {boolean}
* @private
*/
@@ -461,22 +493,12 @@ Polymer({
},
/**
- * @param {!{model: !{item:
- * !chrome.networkingPrivate.ThirdPartyVPNProperties}}} event
+ * @param {!{model: !{item: !mojom.VpnProvider}}} event
* @private
*/
onAddThirdPartyVpnTap_: function(event) {
const provider = event.model.item;
- this.browserProxy_.addThirdPartyVpn(provider.ExtensionID);
- },
-
- /**
- * @param {!{model: !{item: !settings.ArcVpnProvider}}} event
- * @private
- */
- onAddArcVpnTap_: function(event) {
- const provider = event.model.item;
- this.browserProxy_.addThirdPartyVpn(provider.AppID);
+ this.browserProxy_.addThirdPartyVpn(provider.appId);
},
/**
@@ -512,43 +534,22 @@ Polymer({
/**
* @param {!Object<!Array<!OncMojo.NetworkStateProperties>>} thirdPartyVpns
- * @param {!chrome.networkingPrivate.ThirdPartyVPNProperties} vpnState
+ * @param {!mojom.VpnProvider} provider
* @return {!Array<!OncMojo.NetworkStateProperties>}
* @private
*/
- getThirdPartyVpnNetworks_: function(thirdPartyVpns, vpnState) {
- return thirdPartyVpns[vpnState.ProviderName] || [];
+ getThirdPartyVpnNetworks_: function(thirdPartyVpns, provider) {
+ return thirdPartyVpns[provider.providerId] || [];
},
/**
* @param {!Object<!Array<!OncMojo.NetworkStateProperties>>} thirdPartyVpns
- * @param {!chrome.networkingPrivate.ThirdPartyVPNProperties} vpnState
+ * @param {!mojom.VpnProvider} provider
* @return {boolean}
* @private
*/
- haveThirdPartyVpnNetwork_: function(thirdPartyVpns, vpnState) {
- const list = this.getThirdPartyVpnNetworks_(thirdPartyVpns, vpnState);
- return !!list.length;
- },
-
- /**
- * @param {!Object<!Array<!OncMojo.NetworkStateProperties>>} arcVpns
- * @param {!settings.ArcVpnProvider} arcVpnProvider
- * @return {!Array<!OncMojo.NetworkStateProperties>}
- * @private
- */
- getArcVpnNetworks_: function(arcVpns, arcVpnProvider) {
- return arcVpns[arcVpnProvider.PackageName] || [];
- },
-
- /**
- * @param {!Object<!Array<!OncMojo.NetworkStateProperties>>} arcVpns
- * @param {!settings.ArcVpnProvider} arcVpnProvider
- * @return {boolean}
- * @private
- */
- haveArcVpnNetwork_: function(arcVpns, arcVpnProvider) {
- const list = this.getArcVpnNetworks_(arcVpns, arcVpnProvider);
+ haveThirdPartyVpnNetwork_: function(thirdPartyVpns, provider) {
+ const list = this.getThirdPartyVpnNetworks_(thirdPartyVpns, provider);
return !!list.length;
},
@@ -562,7 +563,7 @@ Polymer({
assert(this.defaultNetwork !== undefined);
const networkState = e.detail;
e.target.blur();
- if (this.canConnect_(networkState)) {
+ if (this.canAttemptConnection_(networkState)) {
this.fire('network-connect', {networkState: networkState});
return;
}
@@ -576,22 +577,24 @@ Polymer({
*/
isBlockedByPolicy_: function(state) {
if (state.type != mojom.NetworkType.kWiFi ||
- this.isPolicySourceMojo(state.source) || !this.globalPolicy) {
+ this.isPolicySource(state.source) || !this.globalPolicy) {
return false;
}
- return !!this.globalPolicy.AllowOnlyPolicyNetworksToConnect ||
- (!!this.globalPolicy.AllowOnlyPolicyNetworksToConnectIfAvailable &&
+ return !!this.globalPolicy.allowOnlyPolicyNetworksToConnect ||
+ (!!this.globalPolicy.allowOnlyPolicyNetworksToConnectIfAvailable &&
!!this.deviceState && !!this.deviceState.managedNetworkAvailable) ||
- (!!this.globalPolicy.BlacklistedHexSSIDs &&
- this.globalPolicy.BlacklistedHexSSIDs.includes(state.wifi.hexSsid));
+ (!!this.globalPolicy.blockedHexSsids &&
+ this.globalPolicy.blockedHexSsids.includes(state.wifi.hexSsid));
},
/**
- * Determines whether or not a network state can be connected to.
+ * Determines whether or not it is possible to attempt a connection to the
+ * provided network (e.g., whether it's possible to connect or configure the
+ * network for connection).
* @param {!OncMojo.NetworkStateProperties} state The network state.
* @private
*/
- canConnect_: function(state) {
+ canAttemptConnection_: function(state) {
if (state.connectionState != mojom.ConnectionStateType.kNotConnected) {
return false;
}
@@ -604,6 +607,11 @@ Polymer({
this.defaultNetwork.connectionState))) {
return false;
}
+ // Cellular networks do not have a configuration flow, so it's not possible
+ // to attempt a connection if the network is not conncetable.
+ if (state.type == mojom.NetworkType.kCellular && !state.connectable) {
+ return false;
+ }
return true;
},
@@ -669,14 +677,27 @@ Polymer({
* @return {string}
* @private
*/
- getNoNetworksString_: function(deviceState, tetherDeviceState) {
+ getNoNetworksInnerHtml_: function(deviceState, tetherDeviceState) {
const type = deviceState.type;
if (type == mojom.NetworkType.kTether ||
(type == mojom.NetworkType.kCellular && this.tetherDeviceState)) {
return this.i18nAdvanced('internetNoNetworksMobileData');
}
- return this.i18n('internetNoNetworks');
+ if (type == mojom.NetworkType.kVPN) {
+ return this.i18n('internetNoNetworks');
+ }
+
+ // If a scan has not yet completed since the device was last enabled, it may
+ // be the case that scan results are still in the process of arriving, so
+ // display a message stating that scanning is in progress. If a scan has
+ // already completed and there are still no networks present, this implies
+ // that there has been sufficient time to find a network, so display a
+ // messages stating that there are no networks. See https://crbug.com/974169
+ // for more details.
+ return this.hasCompletedScanSinceLastEnabled_ ?
+ this.i18n('internetNoNetworks') :
+ this.i18n('networkScanningLabel');
},
/**
diff --git a/chromium/chrome/browser/resources/settings/internet_page/network_proxy_section.html b/chromium/chrome/browser/resources/settings/internet_page/network_proxy_section.html
index c1e7309b691..a061a6e92ab 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/network_proxy_section.html
+++ b/chromium/chrome/browser/resources/settings/internet_page/network_proxy_section.html
@@ -5,8 +5,8 @@
<link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
<link rel="import" href="chrome://resources/cr_elements/hidden_style_css.html">
-<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network_behavior.html">
-<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network_indicator.html">
+<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network_behavior_mojo.html">
+<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network_indicator_mojo.html">
<link rel="import" href="chrome://resources/html/assert.html">
<link rel="import" href="chrome://resources/html/cr/ui/focus_without_ink.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
@@ -22,7 +22,7 @@
<template>
<style include="internet-shared cr-hidden-style iron-flex
iron-flex-alignment">
- cr-policy-network-indicator {
+ cr-policy-network-indicator-mojo {
margin-inline-end: 10px;
}
@@ -38,19 +38,19 @@
<!-- Policy indicator. Only one dom-if below will be shown. -->
<template is="dom-if"
- if="[[shouldShowNetworkPolicyIndicator_(networkProperties)]]">
+ if="[[shouldShowNetworkPolicyIndicator_(managedProperties)]]">
<div class="settings-box">
<div class="layout horizontal center">
- <cr-policy-network-indicator
- property="[[networkProperties.ProxySettings.Type]]"
+ <cr-policy-network-indicator-mojo
+ property="[[managedProperties.proxySettings.type]]"
no-extension-indicator>
- </cr-policy-network-indicator>
+ </cr-policy-network-indicator-mojo>
<div>$i18n{networkProxyEnforcedPolicy}</div>
</div>
</div>
</template>
<template is="dom-if"
- if="[[shouldShowExtensionIndicator_(networkProperties)]]">
+ if="[[shouldShowExtensionIndicator_(managedProperties)]]">
<div class="settings-box">
<extension-controlled-indicator
extension-id="[[prefs.proxy.extensionId]]"
@@ -62,8 +62,7 @@
<!-- Allow shared proxies -->
<settings-toggle-button id="allowShared" class="continuation indented"
- hidden$="[[!shouldShowAllowShared_(
- networkProperties.ProxySettings.Type)]]"
+ hidden$="[[!shouldShowAllowShared_(managedProperties.source)]]"
pref="{{prefs.settings.use_shared_proxies}}"
label="$i18n{networkProxyAllowShared}"
on-settings-boolean-control-change="onAllowSharedProxiesChange_"
@@ -72,7 +71,7 @@
<div class="settings-box single-column stretch continuation indented">
<network-proxy editable
- network-properties="[[networkProperties]]"
+ managed-properties="[[managedProperties]]"
use-shared-proxies="[[useSharedProxies_]]">
</network-proxy>
</div>
diff --git a/chromium/chrome/browser/resources/settings/internet_page/network_proxy_section.js b/chromium/chrome/browser/resources/settings/internet_page/network_proxy_section.js
index ce61e4f85c9..3827c8cbf37 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/network_proxy_section.js
+++ b/chromium/chrome/browser/resources/settings/internet_page/network_proxy_section.js
@@ -7,23 +7,24 @@
* detail page. This element is responsible for setting 'Allow proxies for
* shared networks'.
*/
+(function() {
+'use strict';
+
+const mojom = chromeos.networkConfig.mojom;
+
Polymer({
is: 'network-proxy-section',
behaviors: [
- CrPolicyNetworkBehavior,
+ CrPolicyNetworkBehaviorMojo,
I18nBehavior,
PrefsBehavior,
settings.RouteObserverBehavior,
],
properties: {
- /**
- * The network properties dictionary containing the proxy properties to
- * display and modify.
- * @type {!CrOnc.NetworkProperties|undefined}
- */
- networkProperties: Object,
+ /** @private {!chromeos.networkConfig.mojom.ManagedProperties|undefined} */
+ managedProperties: Object,
/**
* Reflects prefs.settings.use_shared_proxies for data binding.
@@ -54,17 +55,17 @@ Polymer({
* @private
*/
isShared_: function() {
- return this.networkProperties.Source == 'Device' ||
- this.networkProperties.Source == 'DevicePolicy';
+ return this.managedProperties.source == mojom.OncSource.kDevice ||
+ this.managedProperties.source == mojom.OncSource.kDevicePolicy;
},
/**
- * @return {!CrOnc.ManagedProperty|undefined}
+ * @return {!OncMojo.ManagedProperty|undefined}
* @private
*/
getProxySettingsTypeProperty_: function() {
- return /** @type {!CrOnc.ManagedProperty|undefined} */ (
- this.get('ProxySettings.Type', this.networkProperties));
+ return /** @type {!OncMojo.ManagedProperty|undefined} */ (
+ this.get('proxySettings.type', this.managedProperties));
},
/**
@@ -98,7 +99,7 @@ Polymer({
},
/**
- * @param {!CrOnc.ManagedProperty} property
+ * @param {!OncMojo.ManagedProperty} property
* @return {boolean}
* @private
*/
@@ -148,3 +149,4 @@ Polymer({
this.$.allowShared.focus();
},
});
+})();
diff --git a/chromium/chrome/browser/resources/settings/internet_page/network_summary.html b/chromium/chrome/browser/resources/settings/internet_page/network_summary.html
index 1dfcd0bccaf..2ceba972978 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/network_summary.html
+++ b/chromium/chrome/browser/resources/settings/internet_page/network_summary.html
@@ -1,7 +1,6 @@
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_network_listener_behavior.html">
-<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network_behavior.html">
<link rel="import" href="chrome://resources/html/chromeos/onc_mojo.html">
<link rel="import" href="network_summary_item.html">
diff --git a/chromium/chrome/browser/resources/settings/internet_page/network_summary.js b/chromium/chrome/browser/resources/settings/internet_page/network_summary.js
index 70b08bde47c..ac6a45c2d31 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/network_summary.js
+++ b/chromium/chrome/browser/resources/settings/internet_page/network_summary.js
@@ -4,7 +4,7 @@
/**
* @fileoverview Polymer element for displaying a summary of network states
- * by type: Ethernet, WiFi, Cellular, WiMAX, and VPN.
+ * by type: Ethernet, WiFi, Cellular, and VPN.
*/
(function() {
@@ -16,7 +16,6 @@ Polymer({
behaviors: [
CrNetworkListenerBehavior,
- CrPolicyNetworkBehavior,
],
properties: {
@@ -76,8 +75,8 @@ Polymer({
},
},
- /** @private {?chromeos.networkConfig.mojom.CrosNetworkConfigProxy} */
- networkConfigProxy_: null,
+ /** @private {?chromeos.networkConfig.mojom.CrosNetworkConfigRemote} */
+ networkConfig_: null,
/**
* Set of GUIDs identifying active networks, one for each type.
@@ -87,9 +86,8 @@ Polymer({
/** @override */
created: function() {
- this.networkConfigProxy_ =
- network_config.MojoInterfaceProviderImpl.getInstance()
- .getMojoServiceProxy();
+ this.networkConfig_ = network_config.MojoInterfaceProviderImpl.getInstance()
+ .getMojoServiceRemote();
},
/** @override */
@@ -135,7 +133,7 @@ Polymer({
*/
getNetworkLists_: function() {
// First get the device states.
- this.networkConfigProxy_.getDeviceStateList().then(response => {
+ this.networkConfig_.getDeviceStateList().then(response => {
// Second get the network states.
this.getNetworkStates_(response.result);
});
@@ -154,7 +152,7 @@ Polymer({
limit: chromeos.networkConfig.mojom.kNoLimit,
networkType: mojom.NetworkType.kAll,
};
- this.networkConfigProxy_.getNetworkStateList(filter).then(response => {
+ this.networkConfig_.getNetworkStateList(filter).then(response => {
this.updateNetworkStates_(response.result, deviceStateList);
});
},
@@ -177,7 +175,6 @@ Polymer({
mojom.NetworkType.kWiFi,
mojom.NetworkType.kCellular,
mojom.NetworkType.kTether,
- mojom.NetworkType.kWiMAX,
mojom.NetworkType.kVPN,
];
@@ -223,8 +220,8 @@ Polymer({
for (const type of orderedNetworkTypes) {
const device = newDeviceStates[type];
if (!device) {
- continue;
- } // The technology for this device type is unavailable.
+ continue; // The technology for this device type is unavailable.
+ }
// If both 'Tether' and 'Cellular' technologies exist, merge the network
// lists and do not add an active network for 'Tether' so that there is
@@ -241,7 +238,7 @@ Polymer({
// types are enabled but no Cellular network exists (edge case).
const networkState =
this.getActiveStateForType_(activeNetworkStatesByType, type);
- if (networkState.source === undefined &&
+ if (networkState.source == mojom.OncSource.kNone &&
device.deviceState == mojom.DeviceStateType.kProhibited) {
// Prohibited technologies are enforced by the device policy.
networkState.source =
diff --git a/chromium/chrome/browser/resources/settings/internet_page/network_summary_item.html b/chromium/chrome/browser/resources/settings/internet_page/network_summary_item.html
index 7e6f3f9fbce..5b26c96577a 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/network_summary_item.html
+++ b/chromium/chrome/browser/resources/settings/internet_page/network_summary_item.html
@@ -6,6 +6,7 @@
<link rel="import" href="chrome://resources/cr_elements/cr_icon_button/cr_icon_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_toggle/cr_toggle.html">
<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_indicator.html">
+<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network_behavior_mojo.html">
<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html">
<link rel="import" href="chrome://resources/html/chromeos/onc_mojo.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
@@ -29,15 +30,9 @@
flex: auto;
}
- #networkTitleText {
- color: #333;
- font-weight: 500;
- }
-
#networkState {
color: var(--cr-secondary-text-color);
font-size: inherit;
- font-weight: 400;
}
</style>
<div id="outerBox" class="settings-box two-line">
@@ -60,12 +55,12 @@
</div>
<template is="dom-if" if="[[showSimInfo_(deviceState)]]" restamp>
- <network-siminfo on-click="doNothing_">
+ <network-siminfo device-state="[[deviceState]]" on-click="doNothing_">
</network-siminfo>
</template>
<template is="dom-if" if="[[showPolicyIndicator_(activeNetworkState)]]">
- <cr-policy-indicator indicator-type="[[getIndicatorTypeForSourceMojo(
+ <cr-policy-indicator indicator-type="[[getIndicatorTypeForSource(
activeNetworkState.source)]]" on-click="doNothing_">
</cr-policy-indicator>
</template>
diff --git a/chromium/chrome/browser/resources/settings/internet_page/network_summary_item.js b/chromium/chrome/browser/resources/settings/internet_page/network_summary_item.js
index 326cf06dfa1..09cbcd3965e 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/network_summary_item.js
+++ b/chromium/chrome/browser/resources/settings/internet_page/network_summary_item.js
@@ -16,7 +16,10 @@ const mojom = chromeos.networkConfig.mojom;
Polymer({
is: 'network-summary-item',
- behaviors: [CrPolicyNetworkBehavior, I18nBehavior],
+ behaviors: [
+ CrPolicyNetworkBehaviorMojo,
+ I18nBehavior,
+ ],
properties: {
/**
@@ -24,7 +27,10 @@ Polymer({
* a device becomes unavailable.
* @type {!OncMojo.DeviceStateProperties|undefined}
*/
- deviceState: Object,
+ deviceState: {
+ type: Object,
+ notify: true,
+ },
/**
* If both Cellular and Tether technologies exist, we combine the
@@ -120,12 +126,11 @@ Polymer({
* @private
*/
getConnectionStateText_: function(networkState, deviceState) {
- if (!networkState) {
+ if (!networkState || !networkState.guid) {
return '';
}
const connectionState = networkState.connectionState;
- const name =
- networkState ? OncMojo.getNetworkDisplayName(networkState) : '';
+ const name = OncMojo.getNetworkStateDisplayName(networkState);
if (OncMojo.connectionStateIsConnected(connectionState)) {
return name;
}
@@ -150,7 +155,7 @@ Polymer({
return (activeNetworkState !== undefined &&
OncMojo.connectionStateIsConnected(
activeNetworkState.connectionState)) ||
- this.isPolicySourceMojo(activeNetworkState.source);
+ this.isPolicySource(activeNetworkState.source);
},
/**
@@ -181,8 +186,7 @@ Polymer({
return true;
}
const simLockType = deviceState.simLockStatus.lockType;
- return simLockType == CrOnc.LockType.PIN ||
- simLockType == CrOnc.LockType.PUK;
+ return simLockType == 'sim-pin' || simLockType == 'sim-puk';
},
/**
@@ -211,7 +215,6 @@ Polymer({
case mojom.NetworkType.kTether:
return true;
case mojom.NetworkType.kWiFi:
- case mojom.NetworkType.kWiMAX:
return deviceState.deviceState != mojom.DeviceStateType.kUninitialized;
case mojom.NetworkType.kCellular:
return deviceState.deviceState !=
@@ -248,8 +251,6 @@ Polymer({
return this.i18n('internetToggleMobileA11yLabel');
case mojom.NetworkType.kWiFi:
return this.i18n('internetToggleWiFiA11yLabel');
- case mojom.NetworkType.kWiMAX:
- return this.i18n('internetToggleWiMAXA11yLabel');
}
assertNotReached();
return '';
@@ -324,9 +325,10 @@ Polymer({
activeNetworkState, deviceState, networkStateList) {
if (!this.shouldShowSubpage_(deviceState, networkStateList)) {
if (activeNetworkState.guid) {
- return OncMojo.getNetworkDisplayName(activeNetworkState);
- } else if (networkStateList.length > 0) {
- return OncMojo.getNetworkDisplayName(networkStateList[0]);
+ return OncMojo.getNetworkStateDisplayName(activeNetworkState);
+ }
+ if (networkStateList.length > 0) {
+ return OncMojo.getNetworkStateDisplayName(networkStateList[0]);
}
}
return this.getNetworkTypeString_(deviceState.type);
diff --git a/chromium/chrome/browser/resources/settings/internet_page/tether_connection_dialog.html b/chromium/chrome/browser/resources/settings/internet_page/tether_connection_dialog.html
index 8e8b914c2e6..22d07f9ecb5 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/tether_connection_dialog.html
+++ b/chromium/chrome/browser/resources/settings/internet_page/tether_connection_dialog.html
@@ -1,12 +1,11 @@
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_network_icon.html">
-<link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_onc_types.html">
<link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
-<link rel="import" href="../icons.html">
+<link rel="import" href="../chromeos/os_icons.html">
<link rel="import" href="../route.html">
<link rel="import" href="../settings_shared_css.html">
@@ -75,35 +74,36 @@
</span>
<div id="host-device-container">
<!-- TODO(hsuregan): Add an a11y label. -->
- <iron-icon icon="[[getSignalStrengthIconName_(networkProperties)]]">
+ <iron-icon icon="[[getSignalStrengthIconName_(managedProperties)]]">
</iron-icon>
<div id="host-device-text-container">
<span id="host-device-text-name">
- [[getDeviceName_(networkProperties)]]
+ [[getDeviceName_(managedProperties)]]
</span>
<span id="host-device-text-battery" class="secondary">
- [[getBatteryPercentageString_(networkProperties)]]
+ [[getBatteryPercentageString_(managedProperties)]]
</span>
</div>
<div class="flex"></div>
<div id="host-device-lost-container" hidden$="[[!outOfRange]]">
- <iron-icon icon="settings:alert-device-out-of-range"></iron-icon>
+ <iron-icon icon="os-settings:alert-device-out-of-range">
+ </iron-icon>
$i18n{tetherPhoneOutOfRange}
</div>
</div>
<div id="tether-explanation">
- [[getExplanation_(networkProperties)]]
+ [[getExplanation_(managedProperties)]]
</div>
<div id="tether-carrier-warning">
$i18n{tetherConnectionCarrierWarning}
</div>
<div id="tether-description-title">
- [[getDescriptionTitle_(networkProperties)]]
+ [[getDescriptionTitle_(managedProperties)]]
</div>
<ul id="tether-description-list">
<li>$i18n{tetherConnectionDescriptionMobileData}</li>
- <li>[[getBatteryDescription_(networkProperties)]]</li>
- <li hidden$="[[!shouldShowDisconnectFromWifi_(networkProperties)]]">
+ <li>[[getBatteryDescription_(managedProperties)]]</li>
+ <li hidden$="[[!shouldShowDisconnectFromWifi_(managedProperties)]]">
$i18n{tetherConnectionDescriptionWiFi}
</li>
</ul>
diff --git a/chromium/chrome/browser/resources/settings/internet_page/tether_connection_dialog.js b/chromium/chrome/browser/resources/settings/internet_page/tether_connection_dialog.js
index 775051fab29..5a7c6beff6f 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/tether_connection_dialog.js
+++ b/chromium/chrome/browser/resources/settings/internet_page/tether_connection_dialog.js
@@ -2,15 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-/**
- * @typedef {{
- * tetherHostDeviceName: string,
- * batteryPercentage: number,
- * connectionStrength: number,
- * isTetherHostCurrentlyOnWifi: boolean
- * }}
- */
-let TetherConnectionData;
+(function() {
+'use strict';
+
+const mojom = chromeos.networkConfig.mojom;
Polymer({
is: 'tether-connection-dialog',
@@ -18,13 +13,8 @@ Polymer({
behaviors: [I18nBehavior],
properties: {
- /**
- * The current properties for the network matching |guid|.
- * @type {!CrOnc.NetworkProperties|undefined}
- */
- networkProperties: {
- type: Object,
- },
+ /** @private {!chromeos.networkConfig.mojom.ManagedProperties|undefined} */
+ managedProperties: Object,
/**
* Whether the network has been lost (e.g., has gone out of range).
@@ -71,12 +61,11 @@ Polymer({
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties The network
- * properties.
+ * @param {!mojom.ManagedProperties} managedProperties
* @return {boolean}
* @private
*/
- shouldShowDisconnectFromWifi_: function(networkProperties) {
+ shouldShowDisconnectFromWifi_: function(managedProperties) {
// TODO(khorimoto): Pipe through a new network property which describes
// whether the tether host is currently connected to a Wi-Fi network. Return
// whether it is here.
@@ -84,13 +73,13 @@ Polymer({
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties The network properties.
+ * @param {!mojom.ManagedProperties} managedProperties
* @return {string} The battery percentage integer value converted to a
* string. Note that this will not return a string with a "%" suffix.
* @private
*/
- getBatteryPercentageAsString_: function(networkProperties) {
- const percentage = this.get('Tether.BatteryPercentage', networkProperties);
+ getBatteryPercentageAsString_: function(managedProperties) {
+ const percentage = this.get('tether.batteryPercentage', managedProperties);
if (percentage === undefined) {
return '';
}
@@ -102,69 +91,70 @@ Polymer({
* Custom icons are used here instead of a <cr-network-icon> because this
* dialog uses a special color scheme.
*
- * @param {!CrOnc.NetworkProperties} networkProperties The network properties.
+ * @param {!mojom.ManagedProperties} managedProperties
* @return {string} The name of the icon to be used to represent the network's
* signal strength.
*/
- getSignalStrengthIconName_: function(networkProperties) {
- let signalStrength = this.get('Tether.SignalStrength', networkProperties);
+ getSignalStrengthIconName_: function(managedProperties) {
+ let signalStrength = this.get('tether.signalStrength', managedProperties);
if (signalStrength === undefined) {
signalStrength = 4;
}
- return 'settings:signal-cellular-' +
+ return 'os-settings:signal-cellular-' +
Math.min(4, Math.max(signalStrength, 0)) + '-bar';
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties The network properties.
+ * @param {!mojom.ManagedProperties} managedProperties
* @return {string}
* @private
*/
- getDeviceName_: function(networkProperties) {
- return CrOnc.getNetworkName(networkProperties);
+ getDeviceName_: function(managedProperties) {
+ return managedProperties ? OncMojo.getNetworkName(managedProperties) : '';
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties The network properties.
+ * @param {!mojom.ManagedProperties} managedProperties
* @return {string}
* @private
*/
- getBatteryPercentageString_: function(networkProperties) {
+ getBatteryPercentageString_: function(managedProperties) {
return this.i18n(
'tetherConnectionBatteryPercentage',
- this.getBatteryPercentageAsString_(networkProperties));
+ this.getBatteryPercentageAsString_(managedProperties));
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties The network properties.
+ * @param {!mojom.ManagedProperties} managedProperties
* @return {string}
* @private
*/
- getExplanation_: function(networkProperties) {
+ getExplanation_: function(managedProperties) {
return this.i18n(
'tetherConnectionExplanation',
- CrOnc.getEscapedNetworkName(networkProperties));
+ HTMLEscape(OncMojo.getNetworkName(managedProperties)));
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties The network properties.
+ * @param {!mojom.ManagedProperties} managedProperties
* @return {string}
* @private
*/
- getDescriptionTitle_: function(networkProperties) {
+ getDescriptionTitle_: function(managedProperties) {
return this.i18n(
'tetherConnectionDescriptionTitle',
- CrOnc.getEscapedNetworkName(networkProperties));
+ HTMLEscape(OncMojo.getNetworkName(managedProperties)));
},
/**
- * @param {!CrOnc.NetworkProperties} networkProperties The network properties.
+ * @param {!mojom.ManagedProperties} managedProperties
* @return {string}
* @private
*/
- getBatteryDescription_: function(networkProperties) {
+ getBatteryDescription_: function(managedProperties) {
return this.i18n(
'tetherConnectionDescriptionBattery',
- this.getBatteryPercentageAsString_(networkProperties));
+ this.getBatteryPercentageAsString_(managedProperties));
},
});
+})();
diff --git a/chromium/chrome/browser/resources/settings/languages_page/languages_page.js b/chromium/chrome/browser/resources/settings/languages_page/languages_page.js
index a69c59b8e0c..657239a5971 100644
--- a/chromium/chrome/browser/resources/settings/languages_page/languages_page.js
+++ b/chromium/chrome/browser/resources/settings/languages_page/languages_page.js
@@ -117,6 +117,16 @@ Polymer({
* @type {!LanguagesPageVisibility}
*/
pageVisibility: Object,
+
+ // <if expr="chromeos">
+ /** @private */
+ isGuest_: {
+ type: Boolean,
+ value: function() {
+ return loadTimeData.getBoolean('isGuest');
+ },
+ },
+ // </if>
},
// <if expr="not is_macosx">
@@ -185,6 +195,11 @@ Polymer({
* @private
*/
shouldShowDialogSeparator_: function() {
+ // <if expr="chromeos">
+ if (this.isGuest_) {
+ return false;
+ }
+ // </if>
return this.languages != undefined && this.languages.enabled.length > 1;
},
@@ -268,7 +283,7 @@ Polymer({
}
// The UI language choice doesn't persist for guests.
- if (loadTimeData.getBoolean('isGuest')) {
+ if (this.isGuest_) {
menu.querySelector('#uiLanguageItem').hidden = true;
}
},
@@ -346,6 +361,7 @@ Polymer({
});
return inputMethod ? inputMethod.displayName : '';
},
+
// </if>
// <if expr="chromeos or is_win">
diff --git a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_behavior.html b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_behavior.html
index 12a3bc36e31..adc498c1f7d 100644
--- a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_behavior.html
+++ b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_behavior.html
@@ -1,5 +1,7 @@
<link rel="import" href="chrome://resources/html/cr.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
+<!-- Anyone using this behavior might be using the referenced icons. -->
+<link rel="import" href="../chromeos/os_icons.html">
<link rel="import" href="../i18n_setup.html">
<link rel="import" href="multidevice_constants.html">
<script src="multidevice_feature_behavior.js"></script>
diff --git a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_behavior.js b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_behavior.js
index d4468ab27e9..727822ca512 100644
--- a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_behavior.js
+++ b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_behavior.js
@@ -116,11 +116,11 @@ const MultiDeviceFeatureBehaviorImpl = {
getIconName: function(feature) {
switch (feature) {
case settings.MultiDeviceFeature.BETTER_TOGETHER_SUITE:
- return 'settings:multidevice-better-together-suite';
+ return 'os-settings:multidevice-better-together-suite';
case settings.MultiDeviceFeature.MESSAGES:
- return 'settings:multidevice-messages';
+ return 'os-settings:multidevice-messages';
case settings.MultiDeviceFeature.SMART_LOCK:
- return 'settings:multidevice-smart-lock';
+ return 'os-settings:multidevice-smart-lock';
default:
return '';
}
diff --git a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_item.js b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_item.js
index f0e57fa3a19..1b8b003a81c 100644
--- a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_item.js
+++ b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_item.js
@@ -57,6 +57,11 @@ Polymer({
return;
}
- settings.navigateTo(this.subpageRoute, this.subpageRouteUrlSearchParams);
+ // Remove the search term when navigating to avoid potentially having any
+ // visible search term reappear at a later time. See
+ // https://crbug.com/989119.
+ settings.navigateTo(
+ this.subpageRoute, this.subpageRouteUrlSearchParams,
+ true /* opt_removeSearch */);
},
});
diff --git a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_tether_item.js b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_tether_item.js
index 8dc4cf217eb..fe69ece9bc2 100644
--- a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_tether_item.js
+++ b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_tether_item.js
@@ -56,14 +56,13 @@ Polymer({
},
},
- /** @private {?chromeos.networkConfig.mojom.CrosNetworkConfigProxy} */
- networkConfigProxy_: null,
+ /** @private {?chromeos.networkConfig.mojom.CrosNetworkConfigRemote} */
+ networkConfig_: null,
/** @override */
created: function() {
- this.networkConfigProxy_ =
- network_config.MojoInterfaceProviderImpl.getInstance()
- .getMojoServiceProxy();
+ this.networkConfig_ = network_config.MojoInterfaceProviderImpl.getInstance()
+ .getMojoServiceRemote();
},
/** @override */
@@ -87,7 +86,7 @@ Polymer({
if (!networks.find(network => network.guid == guid)) {
return;
}
- this.networkConfigProxy_.getNetworkState(guid).then(response => {
+ this.networkConfig_.getNetworkState(guid).then(response => {
if (response.result) {
this.activeNetworkState_ = response.result;
}
@@ -113,7 +112,7 @@ Polymer({
* @private
*/
updateTetherDeviceState_: function() {
- this.networkConfigProxy_.getDeviceStateList().then(response => {
+ this.networkConfig_.getDeviceStateList().then(response => {
const kTether = chromeos.networkConfig.mojom.NetworkType.kTether;
const deviceStates = response.result;
const deviceState =
@@ -143,7 +142,7 @@ Polymer({
limit: 1,
networkType: kTether,
};
- this.networkConfigProxy_.getNetworkStateList(filter).then(response => {
+ this.networkConfig_.getNetworkStateList(filter).then(response => {
const networks = response.result;
this.activeNetworkState_ =
networks[0] || OncMojo.getDefaultNetworkState(kTether);
diff --git a/chromium/chrome/browser/resources/settings/os_settings_resources.grd b/chromium/chrome/browser/resources/settings/os_settings_resources.grd
index 8ad9dd094f8..8338d49eb90 100644
--- a/chromium/chrome/browser/resources/settings/os_settings_resources.grd
+++ b/chromium/chrome/browser/resources/settings/os_settings_resources.grd
@@ -19,6 +19,159 @@
file="chromeos/os_a11y_page/os_a11y_page.html"
type="chrome_html"
allowexternalscript="true" />
+ <structure name="IDR_OS_SETTINGS_APPS_PAGE_JS"
+ file="chromeos/os_apps_page/os_apps_page.js"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APPS_PAGE_HTML"
+ file="chromeos/os_apps_page/os_apps_page.html"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_JS"
+ file="chromeos/os_apps_page/app_management_page/app_management_page.js"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_HTML"
+ file="chromeos/os_apps_page/app_management_page/app_management_page.html"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_CONSTANTS_JS"
+ file="chromeos/os_apps_page/app_management_page/constants.js"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_CONSTANTS_HTML"
+ file="chromeos/os_apps_page/app_management_page/constants.html"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_STORE_CLIENT_JS"
+ file="chromeos/os_apps_page/app_management_page/store_client.js"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_STORE_CLIENT_HTML"
+ file="chromeos/os_apps_page/app_management_page/store_client.html"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_STORE_JS"
+ file="chromeos/os_apps_page/app_management_page/store.js"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_STORE_HTML"
+ file="chromeos/os_apps_page/app_management_page/store.html"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_ACTIONS_JS"
+ file="chromeos/os_apps_page/app_management_page/actions.js"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_ACTIONS_HTML"
+ file="chromeos/os_apps_page/app_management_page/actions.html"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_APP_ITEM_JS"
+ file="chromeos/os_apps_page/app_management_page/app_item.js"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_APP_ITEM_HTML"
+ file="chromeos/os_apps_page/app_management_page/app_item.html"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_BROWSER_PROXY_JS"
+ file="chromeos/os_apps_page/app_management_page/browser_proxy.js"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_BROWSER_PROXY_HTML"
+ file="chromeos/os_apps_page/app_management_page/browser_proxy.html"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_FAKE_PAGE_HANDLER_JS"
+ file="chromeos/os_apps_page/app_management_page/fake_page_handler.js"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_MAIN_VIEW_JS"
+ file="chromeos/os_apps_page/app_management_page/main_view.js"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_MAIN_VIEW_HTML"
+ file="chromeos/os_apps_page/app_management_page/main_view.html"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_TYPES_JS"
+ file="chromeos/os_apps_page/app_management_page/types.js"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_UTIL_JS"
+ file="chromeos/os_apps_page/app_management_page/util.js"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_UTIL_HTML"
+ file="chromeos/os_apps_page/app_management_page/util.html"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_SHARED_STYLE_HTML"
+ file="chromeos/os_apps_page/app_management_page/shared_style.html"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_SHARED_VARS_HTML"
+ file="chromeos/os_apps_page/app_management_page/shared_vars.html"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_REDUCERS_JS"
+ file="chromeos/os_apps_page/app_management_page/reducers.js"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_REDUCERS_HTML"
+ file="chromeos/os_apps_page/app_management_page/reducers.html"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_API_LISTENER_JS"
+ file="chromeos/os_apps_page/app_management_page/api_listener.js"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_API_LISTENER_HTML"
+ file="chromeos/os_apps_page/app_management_page/api_listener.html"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_DOM_SWITCH_JS"
+ file="chromeos/os_apps_page/app_management_page/dom_switch.js"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_DOM_SWITCH_HTML"
+ file="chromeos/os_apps_page/app_management_page/dom_switch.html"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_PWA_PERMISSION_VIEW_JS"
+ file="chromeos/os_apps_page/app_management_page/pwa_permission_view.js"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_PWA_PERMISSION_VIEW_HTML"
+ file="chromeos/os_apps_page/app_management_page/pwa_permission_view.html"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_PERMISSION_ITEM_JS"
+ file="chromeos/os_apps_page/app_management_page/permission_item.js"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_PERMISSION_ITEM_HTML"
+ file="chromeos/os_apps_page/app_management_page/permission_item.html"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_PERMISSION_TOGGLE_JS"
+ file="chromeos/os_apps_page/app_management_page/permission_toggle.js"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_PERMISSION_TOGGLE_HTML"
+ file="chromeos/os_apps_page/app_management_page/permission_toggle.html"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_PIN_TO_SHELF_ITEM_JS"
+ file="chromeos/os_apps_page/app_management_page/pin_to_shelf_item.js"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_PIN_TO_SHELF_ITEM_HTML"
+ file="chromeos/os_apps_page/app_management_page/pin_to_shelf_item.html"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_TOGGLE_ROW_JS"
+ file="chromeos/os_apps_page/app_management_page/toggle_row.js"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_TOGGLE_ROW_HTML"
+ file="chromeos/os_apps_page/app_management_page/toggle_row.html"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_APP_PERMISSION_VIEW_JS"
+ file="chromeos/os_apps_page/app_management_page/app_permission_view.js"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_APP_PERMISSION_VIEW_HTML"
+ file="chromeos/os_apps_page/app_management_page/app_permission_view.html"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_ARC_PERMISSION_VIEW_JS"
+ file="chromeos/os_apps_page/app_management_page/arc_permission_view.js"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_ARC_PERMISSION_VIEW_HTML"
+ file="chromeos/os_apps_page/app_management_page/arc_permission_view.html"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_CHROME_APP_PERMISSION_VIEW_JS"
+ file="chromeos/os_apps_page/app_management_page/chrome_app_permission_view.js"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_CHROME_APP_PERMISSION_VIEW_HTML"
+ file="chromeos/os_apps_page/app_management_page/chrome_app_permission_view.html"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_ROUTER_JS"
+ file="chromeos/os_apps_page/app_management_page/router.js"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_ROUTER_HTML"
+ file="chromeos/os_apps_page/app_management_page/router.html"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_ICONS_HTML"
+ file="chromeos/os_apps_page/app_management_page/icons.html"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_UNINSTALL_BUTTON_JS"
+ file="chromeos/os_apps_page/app_management_page/uninstall_button.js"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_APP_UNINSTALL_BUTTON_HTML"
+ file="chromeos/os_apps_page/app_management_page/uninstall_button.html"
+ type="chrome_html" />
<structure name="IDR_OS_SETTINGS_MANAGE_A11Y_PAGE_JS"
file="a11y_page/manage_a11y_page.js"
type="chrome_html" />
@@ -125,12 +278,6 @@
file="settings_page/settings_animated_pages.js"
type="chrome_html"
preprocess="true" />
- <structure name="IDR_OS_SETTINGS_PERSONALIZATION_BROWSER_PROXY_HTML"
- file="chromeos/personalization_page/personalization_browser_proxy.html"
- type="chrome_html" />
- <structure name="IDR_OS_SETTINGS_PERSONALIZATION_BROWSER_PROXY_JS"
- file="chromeos/personalization_page/personalization_browser_proxy.js"
- type="chrome_html" />
<structure name="IDR_OS_SETTINGS_PERSONALIZATION_PAGE_HTML"
file="chromeos/personalization_page/personalization_page.html"
type="chrome_html"
@@ -394,6 +541,12 @@
<structure name="IDR_OS_SETTINGS_DEVICE_STORAGE_JS"
file="device_page/storage.js"
type="chrome_html" />
+ <structure name="IDR_SETTINGS_DEVICE_STORAGE_EXTERNAL_ENTRY_HTML"
+ file="device_page/storage_external_entry.html"
+ type="chrome_html" />
+ <structure name="IDR_SETTINGS_DEVICE_STORAGE_EXTERNAL_ENTRY_JS"
+ file="device_page/storage_external_entry.js"
+ type="chrome_html" />
<structure name="IDR_SETTINGS_DEVICE_STORAGE_EXTERNAL_HTML"
file="device_page/storage_external.html"
type="chrome_html" />
@@ -456,6 +609,10 @@
file="icons.html"
type="chrome_html"
preprocess="true" />
+ <structure name="IDR_OS_SETTINGS_OS_ICONS"
+ file="chromeos/os_icons.html"
+ type="chrome_html"
+ preprocess="true" />
<structure name="IDR_OS_SETTINGS_POWERWASH_DIALOG_HTML"
file="chromeos/os_reset_page/os_powerwash_dialog.html"
type="chrome_html" />
@@ -468,11 +625,11 @@
<structure name="IDR_OS_SETTINGS_RESET_PAGE_JS"
file="chromeos/os_reset_page/os_reset_page.js"
type="chrome_html" />
- <structure name="IDR_OS_SETTINGS_RESET_OS_PROXY_JS"
- file="chromeos/os_reset_page/reset_os_proxy.js"
+ <structure name="IDR_OS_SETTINGS_RESET_BROWSER_PROXY_JS"
+ file="chromeos/os_reset_page/os_reset_browser_proxy.js"
type="chrome_html" />
- <structure name="IDR_OS_SETTINGS_RESET_OS_PROXY_HTML"
- file="chromeos/os_reset_page/reset_os_proxy.html"
+ <structure name="IDR_OS_SETTINGS_RESET_BROWSER_PROXY_HTML"
+ file="chromeos/os_reset_page/os_reset_browser_proxy.html"
type="chrome_html" />
<structure name="IDR_OS_SETTINGS_LANGUAGES_HTML"
file="languages_page/languages.html"
@@ -523,6 +680,12 @@
<structure name="IDR_OS_SETTINGS_MEDIA_PICKER_JS"
file="site_settings/media_picker.js"
type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_OS_TOOLBAR_JS"
+ file="chromeos/os_toolbar/os_toolbar.js"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_OS_TOOLBAR_HTML"
+ file="chromeos/os_toolbar/os_toolbar.html"
+ type="chrome_html" />
<structure name="IDR_OS_SETTINGS_PEOPLE_PAGE_HTML"
file="chromeos/os_people_page/os_people_page.html"
type="chrome_html"
@@ -950,12 +1113,6 @@
<structure name="IDR_OS_SETTINGS_ZOOM_LEVELS_JS"
file="site_settings/zoom_levels.js"
type="chrome_html" />
- <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_HTML"
- file="app_management_page/app_management_page.html"
- type="chrome_html" />
- <structure name="IDR_OS_SETTINGS_APP_MANAGEMENT_PAGE_JS"
- file="app_management_page/app_management_page.js"
- type="chrome_html" />
<structure name="IDR_OS_SETTINGS_ANDROID_APPS_PAGE_HTML"
file="android_apps_page/android_apps_page.html"
type="chrome_html" />
@@ -1347,6 +1504,12 @@
type="chrome_html"
preprocess="true"
allowexternalscript="true" />
+ <structure name="IDR_OS_SETTINGS_WALLPAPER_BROWSER_PROXY_HTML"
+ file="appearance_page/wallpaper_browser_proxy.html"
+ type="chrome_html" />
+ <structure name="IDR_OS_SETTINGS_WALLPAPER_BROWSER_PROXY_JS"
+ file="appearance_page/wallpaper_browser_proxy.js"
+ type="chrome_html" />
</structures>
</release>
</grit>
diff --git a/chromium/chrome/browser/resources/settings/page_visibility.js b/chromium/chrome/browser/resources/settings/page_visibility.js
index fc8d51f2e10..6096033fafd 100644
--- a/chromium/chrome/browser/resources/settings/page_visibility.js
+++ b/chromium/chrome/browser/resources/settings/page_visibility.js
@@ -37,6 +37,7 @@ let PageVisibility;
let A11yPageVisibility;
/**
+ * TODO(crbug.com/950007): Remove setWallpaper after SplitSettings launch.
* @typedef {{
* bookmarksBar: boolean,
* homeButton: boolean,
@@ -98,6 +99,11 @@ cr.define('settings', function() {
let pageVisibility;
const showOSSettings = loadTimeData.getBoolean('showOSSettings');
+ const isAccountManagerEnabled =
+ loadTimeData.valueExists('isAccountManagerEnabled') &&
+ loadTimeData.getBoolean('isAccountManagerEnabled');
+ const isKerberosEnabled = loadTimeData.valueExists('isKerberosEnabled') &&
+ loadTimeData.getBoolean('isKerberosEnabled');
if (loadTimeData.getBoolean('isGuest')) {
// "if not chromeos" and "if chromeos" in two completely separate blocks
@@ -167,8 +173,8 @@ cr.define('settings', function() {
autofill: true,
people: {
lockScreen: showOSSettings,
- kerberosAccounts: showOSSettings,
- googleAccounts: showOSSettings,
+ kerberosAccounts: showOSSettings && isKerberosEnabled,
+ googleAccounts: showOSSettings && isAccountManagerEnabled,
manageUsers: showOSSettings,
},
onStartup: true,
diff --git a/chromium/chrome/browser/resources/settings/parental_controls_page/parental_controls_page.html b/chromium/chrome/browser/resources/settings/parental_controls_page/parental_controls_page.html
index 960c4f9f0db..3a55afc70c6 100644
--- a/chromium/chrome/browser/resources/settings/parental_controls_page/parental_controls_page.html
+++ b/chromium/chrome/browser/resources/settings/parental_controls_page/parental_controls_page.html
@@ -15,10 +15,6 @@
<dom-module id="settings-parental-controls-page">
<template>
<style include="settings-shared">
- #parental-controls-setup-section {
- padding-inline-start: 20px;
- }
-
cr-link-row {
--cr-section-padding: 0;
}
@@ -28,16 +24,12 @@
<cr-link-row on-click="handleFamilyLinkButtonClick_"
label="$i18n{parentalControlsPageTitle}"
sub-label="$i18n{parentalControlsPageViewSettingsLabel}"
- start-icon="cr20:kite"
external>
+ <iron-icon icon="cr20:kite" aria-hidden="true"></iron-icon>
</cr-link-row>
</template>
<template is="dom-if" if="[[!isChild_]]">
- <div>
- <iron-icon icon="cr20:kite"></iron-icon>
- </div>
- <div id="parental-controls-setup-section"
- class="start settings-box-text">
+ <div class="start settings-box-text">
<div>
$i18n{parentalControlsPageTitle}
</div>
diff --git a/chromium/chrome/browser/resources/settings/people_page/BUILD.gn b/chromium/chrome/browser/resources/settings/people_page/BUILD.gn
index 799bbfa9a5d..05645882e1b 100644
--- a/chromium/chrome/browser/resources/settings/people_page/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/people_page/BUILD.gn
@@ -222,7 +222,8 @@ js_library("profile_info_browser_proxy") {
js_library("setup_fingerprint_dialog") {
deps = [
":fingerprint_browser_proxy",
- "//ui/webui/resources/cr_elements/chromeos/fingerprint:cr_fingerprint_progress_arc",
+ "//ui/webui/resources/cr_elements/chromeos/cr_lottie:cr_lottie",
+ "//ui/webui/resources/cr_elements/cr_fingerprint:cr_fingerprint_progress_arc",
"//ui/webui/resources/js:i18n_behavior",
"//ui/webui/resources/js:web_ui_listener_behavior",
]
diff --git a/chromium/chrome/browser/resources/settings/people_page/account_manager.html b/chromium/chrome/browser/resources/settings/people_page/account_manager.html
index b4687fedb68..3addbf6027c 100644
--- a/chromium/chrome/browser/resources/settings/people_page/account_manager.html
+++ b/chromium/chrome/browser/resources/settings/people_page/account_manager.html
@@ -17,6 +17,10 @@
<dom-module id="settings-account-manager">
<template>
<style include="settings-shared iron-flex iron-flex-alignment">
+ :host {
+ --add-account-margin-top: 16px;
+ }
+
.profile-icon {
background: center / cover no-repeat;
border-radius: 20px;
@@ -40,16 +44,17 @@
margin-inline-start: 60px;
}
- cr-policy-indicator {
- margin-inline-end: 1em;
- }
-
#account-list-header {
padding-bottom: 8px;
}
+ cr-policy-indicator {
+ margin-inline-end: 1em;
+ margin-top: var(--add-account-margin-top);
+ }
+
#add-account-button {
- margin-top: 16px;
+ margin-top: var(--add-account-margin-top);
}
#add-account-icon {
diff --git a/chromium/chrome/browser/resources/settings/people_page/account_manager.js b/chromium/chrome/browser/resources/settings/people_page/account_manager.js
index c4364f4ea11..8613c1262a3 100644
--- a/chromium/chrome/browser/resources/settings/people_page/account_manager.js
+++ b/chromium/chrome/browser/resources/settings/people_page/account_manager.js
@@ -169,8 +169,7 @@ Polymer({
* @private
*/
refreshAccounts_: function() {
- const includeImages = true;
- this.browserProxy_.getAccounts(includeImages).then(accounts => {
+ this.browserProxy_.getAccounts().then(accounts => {
this.set('accounts_', accounts);
});
},
diff --git a/chromium/chrome/browser/resources/settings/people_page/account_manager_browser_proxy.js b/chromium/chrome/browser/resources/settings/people_page/account_manager_browser_proxy.js
index 87826f732a5..b08b02268b5 100644
--- a/chromium/chrome/browser/resources/settings/people_page/account_manager_browser_proxy.js
+++ b/chromium/chrome/browser/resources/settings/people_page/account_manager_browser_proxy.js
@@ -19,7 +19,7 @@ cr.exportPath('settings');
* unmigrated: boolean,
* fullName: string,
* email: string,
- * pic: (string|undefined),
+ * pic: string,
* organization: (string|undefined),
* }}
*/
@@ -30,11 +30,9 @@ cr.define('settings', function() {
class AccountManagerBrowserProxy {
/**
* Returns a Promise for the list of GAIA accounts held in AccountManager.
- * @param {boolean} includeImages Include the profile icon images in
- * settings.Account.pic field, which increases IPC data from the browser.
* @return {!Promise<!Array<settings.Account>>}
*/
- getAccounts(includeImages) {}
+ getAccounts() {}
/**
* Triggers the 'Add account' flow.
@@ -72,8 +70,8 @@ cr.define('settings', function() {
*/
class AccountManagerBrowserProxyImpl {
/** @override */
- getAccounts(includeImages) {
- return cr.sendWithPromise('getAccounts', includeImages);
+ getAccounts() {
+ return cr.sendWithPromise('getAccounts');
}
/** @override */
diff --git a/chromium/chrome/browser/resources/settings/people_page/fingerprint_list.js b/chromium/chrome/browser/resources/settings/people_page/fingerprint_list.js
index 92cfb70ecef..657e219e3dd 100644
--- a/chromium/chrome/browser/resources/settings/people_page/fingerprint_list.js
+++ b/chromium/chrome/browser/resources/settings/people_page/fingerprint_list.js
@@ -117,9 +117,10 @@ Polymer({
// Flash the background.
listItem.animate(
- {
- backgroundColor: ['var(--google-grey-300)', 'white'],
- },
+ [
+ {backgroundColor: ['var(--google-grey-300)']},
+ {backgroundColor: ['white']}
+ ],
FLASH_DURATION_MS);
});
},
diff --git a/chromium/chrome/browser/resources/settings/people_page/kerberos_accounts.html b/chromium/chrome/browser/resources/settings/people_page/kerberos_accounts.html
index da29870c4e8..66f41e87954 100644
--- a/chromium/chrome/browser/resources/settings/people_page/kerberos_accounts.html
+++ b/chromium/chrome/browser/resources/settings/people_page/kerberos_accounts.html
@@ -169,11 +169,9 @@
</cr-action-menu>
</div>
- <cr-toast id="account-removed-toast" duration="3000">
+ <cr-toast id="account-toast" duration="3000">
<!-- Gets displayed with black font without div and id :-/ -->
- <div id="account-removed-toast-label">
- $i18n{kerberosAccountsAccountRemovedTip}
- </div>
+ <div id="account-toast-label">[[accountToastText_]]</div>
</cr-toast>
<template is="dom-if" if="[[showAddAccountDialog_]]" restamp>
diff --git a/chromium/chrome/browser/resources/settings/people_page/kerberos_accounts.js b/chromium/chrome/browser/resources/settings/people_page/kerberos_accounts.js
index aec55ed61e7..4f45f060ed1 100644
--- a/chromium/chrome/browser/resources/settings/people_page/kerberos_accounts.js
+++ b/chromium/chrome/browser/resources/settings/people_page/kerberos_accounts.js
@@ -46,6 +46,12 @@ Polymer({
return loadTimeData.getBoolean('kerberosAddAccountsAllowed');
},
},
+
+ /** @private */
+ accountToastText_: {
+ type: String,
+ value: '',
+ },
},
/** @private {?settings.KerberosAccountsBrowserProxy} */
@@ -106,7 +112,12 @@ Polymer({
/** @private */
onAddAccountDialogClosed_: function() {
+ if (this.$$('kerberos-add-account-dialog').accountWasRefreshed) {
+ this.showToast_('kerberosAccountsAccountRefreshedTip');
+ }
+
this.showAddAccountDialog_ = false;
+
// In case it was opened by the 'Refresh now' action menu.
this.closeActionMenu_();
},
@@ -152,7 +163,7 @@ Polymer({
/** @type {!settings.KerberosAccount} */ (this.selectedAccount_))
.then(error => {
if (error == settings.KerberosErrorType.kNone) {
- this.$$('#account-removed-toast').show();
+ this.showToast_('kerberosAccountsAccountRemovedTip');
} else {
console.error('Unexpected error removing account: ' + error);
}
@@ -176,5 +187,15 @@ Polymer({
*/
onRefreshNowClick_: function() {
this.showAddAccountDialog_ = true;
+ },
+
+ /**
+ * Pops up a toast with localized text |label|.
+ * @param {string} label Name of the localized label string.
+ * @private
+ */
+ showToast_: function(label) {
+ this.accountToastText_ = this.i18n(label);
+ this.$$('#account-toast').show();
}
});
diff --git a/chromium/chrome/browser/resources/settings/people_page/kerberos_add_account_dialog.html b/chromium/chrome/browser/resources/settings/people_page/kerberos_add_account_dialog.html
index b6f3fd769cd..45f8f74a85a 100644
--- a/chromium/chrome/browser/resources/settings/people_page/kerberos_add_account_dialog.html
+++ b/chromium/chrome/browser/resources/settings/people_page/kerberos_add_account_dialog.html
@@ -28,15 +28,21 @@
margin-inline-start: 1em;
}
+ #credentials {
+ margin-top: 16px;
+ }
+
#credentials > *:not(:last-child) {
margin-bottom: var(--cr-form-field-bottom-spacing);
}
#general-error-container {
+ display: flex;
height: 56px;
}
#config-error-container {
+ display: flex;
height: 40px;
margin-top: 16px;
}
@@ -46,10 +52,6 @@
color: var(--settings-error-color);
}
- .inner-error-container {
- display: flex;
- }
-
iron-icon[icon='cr:error'] {
fill: var(--settings-error-color);
margin-inline-end: 8px;
@@ -74,13 +76,12 @@
$i18n{addKerberosAccountDescription}
</h2>
- <div id="general-error-container">
- <div class="inner-error-container"
- hidden="[[!showError_(generalErrorText_)]]">
- <iron-icon id="error-icon" icon="cr:error"></iron-icon>
- <div id="general-error-message">[[generalErrorText_]]</div>
- </div>
+ <div id="general-error-container"
+ hidden="[[!showError_(generalErrorText_)]]">
+ <iron-icon id="error-icon" icon="cr:error"></iron-icon>
+ <div id="general-error-message">[[generalErrorText_]]</div>
</div>
+
<div id="credentials">
<cr-input id="username" label="$i18n{kerberosUsername}"
value="{{username_}}" invalid="[[showError_(usernameErrorText_)]]"
@@ -143,12 +144,10 @@
spellcheck="false" disabled="[[isManaged_]]">
</settings-textarea>
- <div id="config-error-container">
- <div class="inner-error-container"
- hidden="[[!showError_(configErrorText_)]]">
- <iron-icon id="error-icon" icon="cr:error"></iron-icon>
- <div id="config-error-message">[[configErrorText_]]</div>
- </div>
+ <div id="config-error-container"
+ hidden="[[!showError_(configErrorText_)]]">
+ <iron-icon id="error-icon" icon="cr:error"></iron-icon>
+ <div id="config-error-message">[[configErrorText_]]</div>
</div>
</div>
diff --git a/chromium/chrome/browser/resources/settings/people_page/kerberos_add_account_dialog.js b/chromium/chrome/browser/resources/settings/people_page/kerberos_add_account_dialog.js
index 295a14d087a..5bb16f8daf9 100644
--- a/chromium/chrome/browser/resources/settings/people_page/kerberos_add_account_dialog.js
+++ b/chromium/chrome/browser/resources/settings/people_page/kerberos_add_account_dialog.js
@@ -20,6 +20,15 @@ Polymer({
*/
presetAccount: Object,
+ /**
+ * Whether an existing |presetAccount| was successfully authenticated.
+ * Always false if |presetAccount| is null (new accounts).
+ */
+ accountWasRefreshed: {
+ type: Boolean,
+ value: false,
+ },
+
/** @private */
username_: {
type: String,
@@ -170,7 +179,11 @@ Polymer({
onAdd_: function() {
assert(!this.inProgress_);
this.inProgress_ = true;
- this.updateErrorMessages_(settings.KerberosErrorType.kNone);
+
+ // Keep the general error, wiping it might cause the error to disappear and
+ // immediately reappear, causing 2 resizings of the dialog.
+ this.usernameErrorText_ = '';
+ this.passwordErrorText_ = '';
// An empty password triggers the Kerberos daemon to use the remembered one.
const passwordToSubmit = this.useRememberedPassword_ ? '' : this.password_;
@@ -187,6 +200,7 @@ Polymer({
// Success case. Close dialog.
if (error == settings.KerberosErrorType.kNone) {
+ this.accountWasRefreshed = this.presetAccount != null;
this.$.addDialog.close();
return;
}
@@ -331,8 +345,8 @@ Polymer({
/**
* @param {!settings.KerberosConfigErrorCode} code Error code
- * @param {!string} errorLine Line where the error occurred
- * @return {!string} Localized error string that corresponds to code
+ * @param {string} errorLine Line where the error occurred
+ * @return {string} Localized error string that corresponds to code
* @private
*/
getConfigErrorString_: function(code, errorLine) {
@@ -363,8 +377,8 @@ Polymer({
/**
* Selects a line in a text area and scrolls to it.
* @param {!Element} textArea A textarea element
- * @param {!number} lineIndex 0-based index of the line to select
- * @return {!string} The line at lineIndex.
+ * @param {number} lineIndex 0-based index of the line to select
+ * @return {string} The line at lineIndex.
* @private
*/
selectAndScrollTo_: function(textArea, lineIndex) {
diff --git a/chromium/chrome/browser/resources/settings/people_page/lock_screen.html b/chromium/chrome/browser/resources/settings/people_page/lock_screen.html
index a2ce568a87d..56fa177dc1d 100644
--- a/chromium/chrome/browser/resources/settings/people_page/lock_screen.html
+++ b/chromium/chrome/browser/resources/settings/people_page/lock_screen.html
@@ -66,12 +66,6 @@
label="$i18n{enableScreenlock}">
</settings-toggle-button>
- <settings-toggle-button id="enableLockScreenMediaKeys"
- hidden="[[!lockScreenMediaKeysPreferenceEnabled_]]"
- pref="{{prefs.ash.lock_screen_media_keys_enabled}}"
- label="$i18n{lockScreenMediaKeys}">
- </settings-toggle-button>
-
<template is="dom-if" if="[[quickUnlockEnabled_]]">
<div id="lockOptionsDiv">
<div class="settings-box">
diff --git a/chromium/chrome/browser/resources/settings/people_page/lock_screen.js b/chromium/chrome/browser/resources/settings/people_page/lock_screen.js
index 6780493980f..f0584fee7e4 100644
--- a/chromium/chrome/browser/resources/settings/people_page/lock_screen.js
+++ b/chromium/chrome/browser/resources/settings/people_page/lock_screen.js
@@ -130,19 +130,6 @@ Polymer({
readOnly: true,
},
- /**
- * Whether the lock screen media keys preference is enabled by the
- * feature flag.
- * @private
- */
- lockScreenMediaKeysPreferenceEnabled_: {
- type: Boolean,
- value: function() {
- return loadTimeData.getBoolean('lockScreenMediaKeysEnabled');
- },
- readOnly: true,
- },
-
/** @private */
showPasswordPromptDialog_: Boolean,
diff --git a/chromium/chrome/browser/resources/settings/people_page/people_page.html b/chromium/chrome/browser/resources/settings/people_page/people_page.html
index f2a605bb946..d6891e8da93 100644
--- a/chromium/chrome/browser/resources/settings/people_page/people_page.html
+++ b/chromium/chrome/browser/resources/settings/people_page/people_page.html
@@ -28,6 +28,7 @@
<if expr="chromeos">
<link rel="import" href="account_manager.html">
+<link rel="import" href="account_manager_browser_proxy.html">
<link rel="import" href="change_picture.html">
<link rel="import" href="chrome://resources/cr_elements/chromeos/cr_picture/cr_png_behavior.html">
<link rel="import" href="fingerprint_list.html">
@@ -52,6 +53,11 @@
margin-inline-start: 20px;
}
+ .sync-row {
+ align-items: center;
+ flex: auto;
+ }
+
#profile-icon {
background: center / cover no-repeat;
border-radius: 20px;
@@ -60,29 +66,29 @@
width: 40px;
}
- iron-icon[icon='cr:sync'] {
- --iron-icon-fill-color: var(--google-green-refresh-700);
+ #sync-status.no-error {
+ --cr-link-row-start-icon-color: var(--google-green-refresh-700);
}
@media (prefers-color-scheme: dark) {
- iron-icon[icon='cr:sync'] {
- --iron-icon-fill-color: var(--google-green-refresh-300);
+ #sync-status.no-error {
+ --cr-link-row-start-icon-color: var(--google-green-refresh-300);
}
}
- #sync-status[actionable] iron-icon[icon='settings:sync-problem'] {
- --iron-icon-fill-color: var(--settings-error-color);
+ #sync-setup {
+ --cr-secondary-text: {
+ color: var(--settings-error-color);
+ }
}
- #sync-status[actionable].auth-error
- iron-icon[icon='settings:sync-disabled'] {
- --iron-icon-fill-color: var(--google-blue-500);
+ #sync-status[actionable].auth-error {
+ --cr-link-row-start-icon-color: var(--google-blue-500);
}
@media (prefers-color-scheme: dark) {
- #sync-status[actionable].auth-error
- iron-icon[icon='settings:sync-disabled'] {
- --iron-icon-fill-color: var(--google-blue-refresh-300);
+ #sync-status[actionable].auth-error {
+ --cr-link-row-start-icon-color: var(--google-blue-refresh-300);
}
}
@@ -95,8 +101,11 @@
border-top: var(--cr-separator-line);
}
- .settings-box[actionable].sync-error #syncSecondary {
- color: var(--settings-error-color);
+ #sync-status[actionable].sync-error {
+ --cr-link-row-start-icon-color: var(--settings-error-color);
+ --cr-secondary-text: {
+ color: var(--settings-error-color);
+ }
}
.icon-container {
@@ -151,12 +160,15 @@
</if>
<div id="picture-subpage-trigger" class="settings-box first two-line">
<template is="dom-if" if="[[syncStatus]]">
- <div id="profile-icon" on-click="onProfileTap_" actionable
+ <div id="profile-icon" on-click="onProfileTap_"
+ actionable$="[[isProfileActionable_]]"
style="background-image: [[getIconImageSet_(
profileIconUrl_)]]">
</div>
- <div class="middle two-line no-min-width" on-click="onProfileTap_"
- actionable>
+ <div class="middle two-line no-min-width"
+ id="profile-row"
+ on-click="onProfileTap_"
+ actionable$="[[isProfileActionable_]]">
<div class="flex text-elide settings-box-text">
<span id="profile-name">[[profileName_]]</span>
<div class="secondary" hidden="[[!syncStatus.signedIn]]">
@@ -169,8 +181,10 @@
aria-describedby="profile-name"></cr-icon-button>
</if>
<if expr="chromeos">
- <cr-icon-button class="subpage-arrow"
- aria-label="$i18n{changePictureTitle}"
+ <cr-icon-button class$="[[profileRowIconClass_]]"
+ id="profile-subpage-arrow"
+ hidden="[[!isProfileActionable_]]"
+ aria-label$="[[profileRowIconAriaLabel_]]"
aria-describedby="profile-name"></cr-icon-button>
</if>
</div>
@@ -217,29 +231,21 @@
<template is="dom-if"
if="[[isPreUnifiedConsentAdvancedSyncSettingsVisible_(
syncStatus, unifiedConsentEnabled_)]]">
- <div class$="settings-box two-line
- [[getSyncStatusClass_(syncStatus)]]"
- on-click="onSyncTap_" id="sync-status"
+ <cr-link-row id="sync-status"
+ class$="[[getSyncStatusClass_(syncStatus)]]"
+ label="$i18n{syncAndNonPersonalizedServices}"
+ sub-label="[[getSyncAndGoogleServicesSubtext_(syncStatus)]]"
+ on-click="onSyncTap_" start-icon="[[getSyncIcon_(syncStatus)]]"
actionable$="[[isSyncStatusActionable_(syncStatus)]]">
- <div class="icon-container">
- <iron-icon id="sync-icon" icon$="[[getSyncIcon_(syncStatus)]]">
- </iron-icon>
- </div>
- <div class="middle settings-box-text">
- $i18n{sync}
- <div class="secondary" id="syncSecondary">
- [[syncStatus.statusText]]
- </div>
- </div>
- <cr-icon-button class="subpage-arrow" aria-label="$i18n{sync}"
- aria-describedby="syncSecondary"></cr-icon-button>
- </div>
+ </cr-link-row>
</template>
<template is="dom-if" if="[[unifiedConsentEnabled_]]">
<cr-link-row id="sync-setup"
label="$i18n{syncAndNonPersonalizedServices}"
- on-click="onSyncTap_"></cr-link-row>
+ sub-label="[[getSyncAndGoogleServicesSubtext_(syncStatus)]]"
+ on-click="onSyncTap_">
+ </cr-link-row>
</template>
<if expr="not chromeos">
@@ -268,8 +274,7 @@
prefs.settings.enable_screen_lock.value)]]"
hidden="[[!pageVisibility.people.lockScreen]]"></cr-link-row>
- <template is="dom-if" if="[[shouldShowAccountManager_(
- isAccountManagerEnabled_, pageVisibility.people.googleAccounts)]]">
+ <template is="dom-if" if="[[pageVisibility.people.googleAccounts]]">
<cr-link-row id="account-manager-subpage-trigger" class="hr"
on-click="onAccountManagerTap_"
label="$i18n{accountManagerSubMenuLabel}"></cr-link-row>
@@ -283,8 +288,7 @@
hidden="[[!pageVisibility.people.manageUsers]]">
</cr-link-row>
- <template is="dom-if" if="[[shouldShowKerberos_(
- isKerberosEnabled_, pageVisibility.people.kerberosAccounts)]]">
+ <template is="dom-if" if="[[pageVisibility.people.kerberosAccounts]]">
<cr-link-row id="kerberos-accounts-subpage-trigger" class="hr"
on-click="onKerberosAccountsTap_"
label="$i18n{kerberosAccountsSubMenuLabel}">
@@ -371,8 +375,7 @@
<settings-change-picture></settings-change-picture>
</settings-subpage>
</template>
- <template is="dom-if" if="[[shouldShowAccountManager_(
- isAccountManagerEnabled_, pageVisibility.people.googleAccounts)]]">
+ <template is="dom-if" if="[[pageVisibility.people.googleAccounts]]">
<template is="dom-if" route-path="/accountManager">
<settings-subpage
associated-control="[[$$('#account-manager-subpage-trigger')]]"
@@ -381,8 +384,7 @@
</settings-subpage>
</template>
</template>
- <template is="dom-if" if="[[shouldShowKerberos_(
- isKerberosEnabled_, pageVisibility.people.kerberosAccounts)]]">
+ <template is="dom-if" if="[[pageVisibility.people.kerberosAccounts]]">
<template is="dom-if" route-path="/kerberosAccounts">
<settings-subpage
associated-control="[[$$('#kerberos-accounts-subpage-trigger')]]"
diff --git a/chromium/chrome/browser/resources/settings/people_page/people_page.js b/chromium/chrome/browser/resources/settings/people_page/people_page.js
index cce39871d20..ec7591d62f6 100644
--- a/chromium/chrome/browser/resources/settings/people_page/people_page.js
+++ b/chromium/chrome/browser/resources/settings/people_page/people_page.js
@@ -91,11 +91,67 @@ Polymer({
profileIconUrl_: String,
/**
+ * Whether the profile row is clickable. The behavior depends on the
+ * platform.
+ * @private
+ */
+ isProfileActionable_: {
+ type: Boolean,
+ value: function() {
+ if (!cr.isChromeOS) {
+ // Opens profile manager.
+ return true;
+ }
+ if (loadTimeData.getBoolean('showOSSettings')) {
+ // Pre-SplitSettings opens change picture.
+ return true;
+ }
+ // Post-SplitSettings links out to account manager if it is available.
+ return loadTimeData.getBoolean('isAccountManagerEnabled');
+ },
+ readOnly: true,
+ },
+
+ /**
* The current profile name.
* @private
*/
profileName_: String,
+ // <if expr="chromeos">
+ /** @private {string} */
+ profileRowIconClass_: {
+ type: String,
+ value: function() {
+ if (loadTimeData.getBoolean('showOSSettings')) {
+ // Pre-SplitSettings links internally to the change picture subpage.
+ return 'subpage-arrow';
+ } else {
+ // Post-SplitSettings links externally to account manager. If account
+ // manager isn't available the icon will be hidden.
+ return 'icon-external';
+ }
+ },
+ readOnly: true,
+ },
+
+ /** @private {string} */
+ profileRowIconAriaLabel_: {
+ type: String,
+ value: function() {
+ if (loadTimeData.getBoolean('showOSSettings')) {
+ // Pre-SplitSettings.
+ return this.i18n('changePictureTitle');
+ } else {
+ // Post-SplitSettings. If account manager isn't available the icon
+ // will be hidden so the label doesn't matter.
+ return this.i18n('accountManagerSubMenuLabel');
+ }
+ },
+ readOnly: true,
+ },
+ // </if>
+
// <if expr="not chromeos">
/** @private {boolean} */
shouldShowGoogleAccount_: {
@@ -128,30 +184,6 @@ Polymer({
readOnly: true,
},
- /**
- * True if Chrome OS Account Manager is enabled.
- * @private
- */
- isAccountManagerEnabled_: {
- type: Boolean,
- value: function() {
- return loadTimeData.getBoolean('isAccountManagerEnabled');
- },
- readOnly: true,
- },
-
- /**
- * True if Chrome OS Kerberos support is enabled.
- * @private
- */
- isKerberosEnabled_: {
- type: Boolean,
- value: function() {
- return loadTimeData.getBoolean('isKerberosEnabled');
- },
- readOnly: true,
- },
-
/** @private */
showParentalControls_: {
type: Boolean,
@@ -219,10 +251,24 @@ Polymer({
/** @override */
attached: function() {
- const profileInfoProxy = settings.ProfileInfoBrowserProxyImpl.getInstance();
- profileInfoProxy.getProfileInfo().then(this.handleProfileInfo_.bind(this));
- this.addWebUIListener(
- 'profile-info-changed', this.handleProfileInfo_.bind(this));
+ let useProfileNameAndIcon = true;
+ // <if expr="chromeos">
+ if (!loadTimeData.getBoolean('showOSSettings') &&
+ loadTimeData.getBoolean('isAccountManagerEnabled')) {
+ // If this is SplitSettings and we have the Google Account manager,
+ // prefer the GAIA name and icon.
+ useProfileNameAndIcon = false;
+ this.addWebUIListener(
+ 'accounts-changed', this.updateAccounts_.bind(this));
+ this.updateAccounts_();
+ }
+ // </if>
+ if (useProfileNameAndIcon) {
+ settings.ProfileInfoBrowserProxyImpl.getInstance().getProfileInfo().then(
+ this.handleProfileInfo_.bind(this));
+ this.addWebUIListener(
+ 'profile-info-changed', this.handleProfileInfo_.bind(this));
+ }
this.syncBrowserProxy_ = settings.SyncBrowserProxyImpl.getInstance();
this.syncBrowserProxy_.getSyncStatus().then(
@@ -283,6 +329,18 @@ Polymer({
// </if>
/**
+ * @return {string}
+ * @private
+ */
+ getSyncAndGoogleServicesSubtext_: function() {
+ if (this.syncStatus && this.syncStatus.hasError &&
+ this.syncStatus.statusText) {
+ return this.syncStatus.statusText;
+ }
+ return '';
+ },
+
+ /**
* Handler for when the profile's icon and name is updated.
* @private
* @param {!settings.ProfileInfo} info
@@ -304,6 +362,27 @@ Polymer({
this.profileIconUrl_ = info.iconUrl;
},
+ // <if expr="chromeos">
+ /**
+ * @private
+ * @suppress {checkTypes} The types only exists in Chrome OS builds, but
+ * Closure doesn't understand the <if> above.
+ */
+ updateAccounts_: async function() {
+ const /** @type {!Array<{settings.Account}>} */ accounts =
+ await settings.AccountManagerBrowserProxyImpl.getInstance()
+ .getAccounts();
+ // The user might not have any GAIA accounts (e.g. guest mode, Kerberos,
+ // Active Directory). In these cases the profile row is hidden, so there's
+ // nothing to do.
+ if (accounts.length == 0) {
+ return;
+ }
+ this.profileName_ = accounts[0].fullName;
+ this.profileIconUrl_ = accounts[0].pic;
+ },
+ // </if>
+
/**
* Handler for when the sync state is pushed from the browser.
* @param {?settings.SyncStatus} syncStatus
@@ -342,7 +421,14 @@ Polymer({
/** @private */
onProfileTap_: function() {
// <if expr="chromeos">
- settings.navigateTo(settings.routes.CHANGE_PICTURE);
+ if (loadTimeData.getBoolean('showOSSettings')) {
+ // Pre-SplitSettings.
+ settings.navigateTo(settings.routes.CHANGE_PICTURE);
+ } else if (loadTimeData.getBoolean('isAccountManagerEnabled')) {
+ // Post-SplitSettings. The browser C++ code loads OS settings in a window.
+ // Don't use window.open() because that creates an extra empty tab.
+ window.location.href = 'chrome://os-settings/accountManager';
+ }
// </if>
// <if expr="not chromeos">
settings.navigateTo(settings.routes.MANAGE_PROFILE);
@@ -459,18 +545,6 @@ Polymer({
onManageOtherPeople_: function() {
settings.navigateTo(settings.routes.ACCOUNTS);
},
-
- /** @private */
- shouldShowAccountManager_: function() {
- return this.isAccountManagerEnabled_ &&
- this.pageVisibility.people.googleAccounts;
- },
-
- /** @private */
- shouldShowKerberos_: function() {
- return this.isKerberosEnabled_ &&
- this.pageVisibility.people.kerberosAccounts;
- },
// </if>
// <if expr="not chromeos">
@@ -590,7 +664,7 @@ Polymer({
'sync-error';
}
- return '';
+ return 'no-error';
},
/**
diff --git a/chromium/chrome/browser/resources/settings/people_page/setup_fingerprint_dialog.html b/chromium/chrome/browser/resources/settings/people_page/setup_fingerprint_dialog.html
index 6636a96d3eb..298e790f814 100644
--- a/chromium/chrome/browser/resources/settings/people_page/setup_fingerprint_dialog.html
+++ b/chromium/chrome/browser/resources/settings/people_page/setup_fingerprint_dialog.html
@@ -1,6 +1,7 @@
<link rel="import" href="chrome://resources/html/polymer.html">
-<link rel="import" href="chrome://resources/cr_elements/chromeos/fingerprint/cr_fingerprint_progress_arc.html">
+<link rel="import" href="chrome://resources/cr_elements/chromeos/cr_lottie/cr_lottie.html">
+<link rel="import" href="chrome://resources/cr_elements/cr_fingerprint/cr_fingerprint_progress_arc.html">
<link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
<link rel="import" href="chrome://resources/cr_elements/icons.html">
@@ -21,11 +22,6 @@
width: 500px;
}
- .fingerprint-scanner-tablet-power-button {
- background:
- url(chrome://theme/IDR_LOGIN_FINGERPRINT_SCANNER_TABLET_POWER_BUTTON_ANIMATION);
- }
-
.fingerprint-scanner-laptop-bottom-right {
background:
url(chrome://theme/IDR_LOGIN_FINGERPRINT_SCANNER_LAPTOP_BOTTOM_RIGHT_ANIMATION);
@@ -43,6 +39,11 @@
height: 240px;
}
+ #scannerLocationLottie {
+ height: 220px;
+ padding: 10px 0;
+ }
+
#messageDiv {
height: 20px;
}
@@ -67,11 +68,21 @@
aria-live="polite">
<span>[[getInstructionMessage_(step_, problemMessage_)]]</span>
</div>
- <div id="scannerLocation" hidden="[[!showScannerLocation_(step_)]]"
- class$="[[fingerprintScannerAnimationClass_]]"
- aria-label="$i18n{configureFingerprintScannerStepAriaLabel}"
- aria-live="polite" >
- </div>
+ <template is="dom-if" if="[[shouldUseLottieAnimation_]]">
+ <div id="scannerLocationLottie"
+ hidden="[[!showScannerLocation_(step_)]]" aria-live="polite"
+ aria-label="$i18n{configureFingerprintScannerStepAriaLabel}">
+ <cr-lottie animation-url="finger_print.json" autoplay>
+ </cr-lottie>
+ </div>
+ </template>
+ <template is="dom-if" if="[[!shouldUseLottieAnimation_]]">
+ <div id="scannerLocation" hidden="[[!showScannerLocation_(step_)]]"
+ class$="[[fingerprintScannerAnimationClass_]]"
+ aria-label="$i18n{configureFingerprintScannerStepAriaLabel}"
+ aria-live="polite" >
+ </div>
+ </template>
<cr-fingerprint-progress-arc id="arc" circle-radius="100"
hidden="[[!showArc_(step_)]]">
</cr-fingerprint-progress-arc>
diff --git a/chromium/chrome/browser/resources/settings/people_page/setup_fingerprint_dialog.js b/chromium/chrome/browser/resources/settings/people_page/setup_fingerprint_dialog.js
index 57168253b54..d0d6d0ec42b 100644
--- a/chromium/chrome/browser/resources/settings/people_page/setup_fingerprint_dialog.js
+++ b/chromium/chrome/browser/resources/settings/people_page/setup_fingerprint_dialog.js
@@ -101,7 +101,7 @@ Polymer({
loadTimeData.getInteger('fingerprintReaderLocation');
switch (fingerprintLocation) {
case settings.FingerprintLocation.TABLET_POWER_BUTTON:
- return 'fingerprint-scanner-tablet-power-button';
+ return '';
case settings.FingerprintLocation.KEYBOARD_TOP_RIGHT:
return 'fingerprint-scanner-laptop-top-right';
case settings.FingerprintLocation.KEYBOARD_BOTTOM_RIGHT:
@@ -111,6 +111,28 @@ Polymer({
},
readOnly: true,
},
+
+ /**
+ * True lottie animation file should be used instead of a png animation
+ * image sequence.
+ * @private {boolean}
+ */
+ shouldUseLottieAnimation_: {
+ type: Boolean,
+ value: function() {
+ if (!loadTimeData.getBoolean('fingerprintUnlockEnabled')) {
+ return false;
+ }
+
+ const fingerprintLocation =
+ loadTimeData.getInteger('fingerprintReaderLocation');
+ const isTabletPowerButton =
+ settings.FingerprintLocation.TABLET_POWER_BUTTON ==
+ fingerprintLocation;
+ return isTabletPowerButton;
+ },
+ readOnly: true,
+ }
},
/**
@@ -344,6 +366,5 @@ Polymer({
this.$.arc.setProgress(oldValue, newValue, newValue === 100);
},
-
});
})();
diff --git a/chromium/chrome/browser/resources/settings/people_page/sync_browser_proxy.js b/chromium/chrome/browser/resources/settings/people_page/sync_browser_proxy.js
index 1b17c57b2ec..340398c2a47 100644
--- a/chromium/chrome/browser/resources/settings/people_page/sync_browser_proxy.js
+++ b/chromium/chrome/browser/resources/settings/people_page/sync_browser_proxy.js
@@ -96,6 +96,9 @@ settings.StatusAction = {
* typedUrlsEnforced: boolean,
* typedUrlsRegistered: boolean,
* typedUrlsSynced: boolean,
+ * wifiConfigurationsEnforced: boolean,
+ * wifiConfigurationsRegistered: boolean,
+ * wifiConfigurationsSynced: boolean,
* }}
*/
settings.SyncPrefs;
@@ -211,6 +214,13 @@ cr.define('settings', function() {
* Opens the Google Activity Controls url in a new tab.
*/
openActivityControlsUrl() {}
+
+ /**
+ * Function to dispatch event sync-prefs-changed even without a change.
+ * This is used to decide whether we should show the link to password
+ * manager in passwords section on page load.
+ */
+ sendSyncPrefsChanged() {}
}
/**
@@ -298,6 +308,11 @@ cr.define('settings', function() {
chrome.metricsPrivate.recordUserAction(
'Signin_AccountSettings_GoogleActivityControlsClicked');
}
+
+ /** @override */
+ sendSyncPrefsChanged() {
+ chrome.send('SyncPrefsDispatch');
+ }
}
cr.addSingletonGetter(SyncBrowserProxyImpl);
diff --git a/chromium/chrome/browser/resources/settings/people_page/sync_controls.html b/chromium/chrome/browser/resources/settings/people_page/sync_controls.html
index 29466647fec..85151dcf0e4 100644
--- a/chromium/chrome/browser/resources/settings/people_page/sync_controls.html
+++ b/chromium/chrome/browser/resources/settings/people_page/sync_controls.html
@@ -135,6 +135,22 @@
</cr-toggle>
</div>
+<if expr="chromeos">
+ <div class="list-item"
+ hidden="[[!syncPrefs.wifiConfigurationsRegistered]]">
+ <div id="wifiConfigurationsCheckboxLabel">
+ $i18n{wifiConfigurationsCheckboxLabel}
+ </div>
+ <cr-toggle checked="{{syncPrefs.wifiConfigurationsSynced}}"
+ on-change="onSingleSyncDataTypeChanged_"
+ disabled="[[shouldSyncCheckboxBeDisabled_(
+ syncPrefs.syncAllDataTypes,
+ syncPrefs.wifiConfigurationsEnforced)]]"
+ aria-labelledby="wifiConfigurationsCheckboxLabel">
+ </cr-toggle>
+ </div>
+</if>
+
<div class="list-item" hidden="[[!syncPrefs.autofillRegistered]]">
<div id="autofillCheckboxLabel">
$i18n{autofillCheckboxLabel}
diff --git a/chromium/chrome/browser/resources/settings/people_page/users_page.html b/chromium/chrome/browser/resources/settings/people_page/users_page.html
index 47c03a09a34..3b94c83970a 100644
--- a/chromium/chrome/browser/resources/settings/people_page/users_page.html
+++ b/chromium/chrome/browser/resources/settings/people_page/users_page.html
@@ -55,19 +55,19 @@
disabled="[[isEditingDisabled_(isOwner_, isWhitelistManaged_)]]"
inverted>
</settings-toggle-button>
- <div class="list-frame">
- <settings-user-list prefs="[[prefs]]"
- disabled="[[isEditingUsersDisabled_(isOwner_, isWhitelistManaged_,
- prefs.cros.accounts.allowGuest.value)]]">
- </settings-user-list>
- <div id="add-user-button" class="list-item"
- hidden="[[isEditingUsersDisabled_(isOwner_, isWhitelistManaged_,
- prefs.cros.accounts.allowGuest.value)]]">
- <a is="action-link" class="list-button" on-click="openAddUserDialog_">
- $i18n{addUsers}
- </a>
+ <template is="dom-if"
+ if="[[isEditingUsersEnabled_(isOwner_, isWhitelistManaged_,
+ prefs.cros.accounts.allowGuest.value, isChild_)]]">
+ <div class="list-frame" >
+ <settings-user-list prefs="[[prefs]]">
+ </settings-user-list>
+ <div id="add-user-button" class="list-item">
+ <a is="action-link" class="list-button" on-click="openAddUserDialog_">
+ $i18n{addUsers}
+ </a>
+ </div>
</div>
- </div>
+ </template>
<settings-users-add-user-dialog id="addUserDialog"
on-close="onAddUserDialogClose_">
</settings-users-add-user-dialog>
diff --git a/chromium/chrome/browser/resources/settings/people_page/users_page.js b/chromium/chrome/browser/resources/settings/people_page/users_page.js
index f8f19f31ff6..4a3ff206056 100644
--- a/chromium/chrome/browser/resources/settings/people_page/users_page.js
+++ b/chromium/chrome/browser/resources/settings/people_page/users_page.js
@@ -30,6 +30,14 @@ Polymer({
type: Boolean,
value: false,
},
+
+ /** @private */
+ isChild_: {
+ type: Boolean,
+ value: function() {
+ return loadTimeData.getBoolean('isSupervised');
+ },
+ },
},
/** @override */
@@ -71,11 +79,13 @@ Polymer({
* @param {boolean} isOwner
* @param {boolean} isWhitelistManaged
* @param {boolean} allowGuest
+ * @param {boolean} isChild
* @private
* @return {boolean}
*/
- isEditingUsersDisabled_: function(isOwner, isWhitelistManaged, allowGuest) {
- return !isOwner || isWhitelistManaged || allowGuest;
+ isEditingUsersEnabled_: function(
+ isOwner, isWhitelistManaged, allowGuest, isChild) {
+ return isOwner && !isWhitelistManaged && !allowGuest && !isChild;
},
/** @return {boolean} */
diff --git a/chromium/chrome/browser/resources/settings/printing_page/BUILD.gn b/chromium/chrome/browser/resources/settings/printing_page/BUILD.gn
index 0f0acd7af8e..e7619959244 100644
--- a/chromium/chrome/browser/resources/settings/printing_page/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/printing_page/BUILD.gn
@@ -103,6 +103,7 @@ if (is_chromeos) {
":cups_nearby_printers",
":cups_printers_browser_proxy",
":cups_saved_printers",
+ "..:route",
"//ui/webui/resources/cr_components/chromeos/network:mojo_interface_provider",
"//ui/webui/resources/cr_elements/chromeos/network:cr_network_listener_behavior",
"//ui/webui/resources/cr_elements/cr_toast:cr_toast",
diff --git a/chromium/chrome/browser/resources/settings/printing_page/OWNERS b/chromium/chrome/browser/resources/settings/printing_page/OWNERS
new file mode 100644
index 00000000000..1100e9746d7
--- /dev/null
+++ b/chromium/chrome/browser/resources/settings/printing_page/OWNERS
@@ -0,0 +1,2 @@
+khorimoto@chromium.org
+stevenjb@chromium.org
diff --git a/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.html b/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.html
index 55b32a67b00..7c9a314bf87 100644
--- a/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.html
+++ b/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.html
@@ -139,7 +139,8 @@
</cr-button>
<cr-button id="addPrinterButton" class="action-button"
on-click="addPressed_"
- disabled="[[!canAddPrinter_(newPrinter.*, inProgress_)]]">
+ disabled="[[!canAddPrinter_(newPrinter.*,
+ addPrinterInProgress_)]]">
$i18n{addPrinterButtonText}
</cr-button>
</div>
@@ -216,7 +217,8 @@
<cr-button class="action-button" id="addPrinterButton"
disabled="[[!canAddPrinter_(activePrinter.ppdManufacturer,
activePrinter.ppdModel,
- activePrinter.printerPPDPath)]]"
+ activePrinter.printerPPDPath,
+ addPrinterInProgress_)]]"
on-click="addPrinter_">
$i18n{addPrinterButtonText}
</cr-button>
diff --git a/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js b/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js
index c63057baedb..74f6940dfbb 100644
--- a/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js
+++ b/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js
@@ -387,6 +387,12 @@ Polymer({
value: '',
},
+ /** @private */
+ addPrinterInProgress_: {
+ type: Boolean,
+ value: false,
+ },
+
/**
* The error text to be displayed on the dialog.
* @private
@@ -431,6 +437,7 @@ Polymer({
* @private
* */
onPrinterAddedFailed_: function(result) {
+ this.addPrinterInProgress_ = false;
this.errorText_ = settings.printing.getErrorText(
/** @type {PrinterSetupResult} */ (result));
},
@@ -548,6 +555,7 @@ Polymer({
/** @private */
addPrinter_: function() {
+ this.addPrinterInProgress_ = true;
settings.CupsPrintersBrowserProxyImpl.getInstance()
.addCupsPrinter(this.activePrinter)
.then(
@@ -563,8 +571,9 @@ Polymer({
* @private
*/
canAddPrinter_: function(ppdManufacturer, ppdModel, printerPPDPath) {
- return settings.printing.isPPDInfoValid(
- ppdManufacturer, ppdModel, printerPPDPath);
+ return !this.addPrinterInProgress_ &&
+ settings.printing.isPPDInfoValid(
+ ppdManufacturer, ppdModel, printerPPDPath);
},
});
diff --git a/chromium/chrome/browser/resources/settings/printing_page/cups_edit_printer_dialog.html b/chromium/chrome/browser/resources/settings/printing_page/cups_edit_printer_dialog.html
index 793770fd6dc..ab4137cfd86 100644
--- a/chromium/chrome/browser/resources/settings/printing_page/cups_edit_printer_dialog.html
+++ b/chromium/chrome/browser/resources/settings/printing_page/cups_edit_printer_dialog.html
@@ -59,22 +59,26 @@
on-change="onProtocolChange_"
disabled="[[!protocolSelectEnabled(isOnline_,
networkProtocolActive_)]]">
- <option value="ipp" disabled="[[!networkProtocolActive_]]">
+ <option value="ipp">
$i18n{printerProtocolIpp}
</option>
- <option value="ipps" disabled="[[!networkProtocolActive_]]">
+ <option value="ipps">
$i18n{printerProtocolIpps}
</option>
- <option value="http" disabled="[[!networkProtocolActive_]]">
+ <option value="http"
+ disabled="[[isAutoconfPrinter_(pendingPrinter_.*)]]">
$i18n{printerProtocolHttp}
</option>
- <option value="https" disabled="[[!networkProtocolActive_]]">
+ <option value="https"
+ disabled="[[isAutoconfPrinter_(pendingPrinter_.*)]]">
$i18n{printerProtocolHttps}
</option>
- <option value="socket" disabled="[[!networkProtocolActive_]]">
+ <option value="socket"
+ disabled="[[isAutoconfPrinter_(pendingPrinter_.*)]]">
$i18n{printerProtocolAppSocket}
</option>
- <option value="lpd" disabled="[[!networkProtocolActive_]]">
+ <option value="lpd"
+ disabled="[[isAutoconfPrinter_(pendingPrinter_.*)]]">
$i18n{printerProtocolLpd}
</option>
<option value="usb" disabled="[[networkProtocolActive_]]">
@@ -101,42 +105,45 @@
value="[[getPrinterURI_(pendingPrinter_)]]">
</cr-input>
</div>
- <div class="settings-box two-line">
- <cr-searchable-drop-down items="[[manufacturerList]]"
- id="printerPPDManufacturer"
- label="$i18n{printerManufacturer}"
- value="{{pendingPrinter_.ppdManufacturer}}"
- readonly="[[!isOnline_]]">
- </cr-searchable-drop-down>
- </div>
- <div class="settings-box two-line">
- <cr-searchable-drop-down items="[[modelList]]"
- id="printerPPDModel"
- label="$i18n{printerModel}"
- value="{{pendingPrinter_.ppdModel}}"
- readonly="[[!isOnline_]]">
- </cr-searchable-drop-down>
- </div>
- <div id="ppdLabel" class="cr-form-field-label">
- <span>$i18n{selectDriver}</span>
- <a href="$i18n{printingCUPSPrintPpdLearnMoreUrl}" target="_blank">
- $i18n{learnMore}
- </a>
- </div>
- <div class="settings-box two-line">
- <cr-input class="browse-file-input" readonly tabindex="-1"
- value="[[userPPD_]]" aria-labelledby="ppdLabel"
- error-message="$i18n{selectDriverErrorMessage}"
- invalid="[[invalidPPD_]]">
- </cr-input>
- <cr-button class="browse-button" on-click="onBrowseFile_"
- disabled="[[!isOnline_]]">
- $i18n{selectDriverButtonText}
- </cr-button>
- </div>
- <div class="eula" id="eulaUrl" hidden="[[!eulaUrl_]]">
- <a href="[[eulaUrl_]]" target="_blank">$i18n{printerEulaNotice}</a>
- </div>
+ <template id="makeAndModelSection" is="dom-if"
+ if="[[!isAutoconfPrinter_(pendingPrinter_.*)]]">
+ <div class="settings-box two-line">
+ <cr-searchable-drop-down items="[[manufacturerList]]"
+ id="printerPPDManufacturer"
+ label="$i18n{printerManufacturer}"
+ value="{{pendingPrinter_.ppdManufacturer}}"
+ readonly="[[!isOnline_]]">
+ </cr-searchable-drop-down>
+ </div>
+ <div class="settings-box two-line">
+ <cr-searchable-drop-down items="[[modelList]]"
+ id="printerPPDModel"
+ label="$i18n{printerModel}"
+ value="{{pendingPrinter_.ppdModel}}"
+ readonly="[[!isOnline_]]">
+ </cr-searchable-drop-down>
+ </div>
+ <div id="ppdLabel" class="cr-form-field-label">
+ <span>$i18n{selectDriver}</span>
+ <a href="$i18n{printingCUPSPrintPpdLearnMoreUrl}" target="_blank">
+ $i18n{learnMore}
+ </a>
+ </div>
+ <div class="settings-box two-line">
+ <cr-input class="browse-file-input" readonly tabindex="-1"
+ value="[[userPPD_]]" aria-labelledby="ppdLabel"
+ error-message="$i18n{selectDriverErrorMessage}"
+ invalid="[[invalidPPD_]]">
+ </cr-input>
+ <cr-button class="browse-button" on-click="onBrowseFile_"
+ disabled="[[!isOnline_]]">
+ $i18n{selectDriverButtonText}
+ </cr-button>
+ </div>
+ <div class="eula" id="eulaUrl" hidden="[[!eulaUrl_]]">
+ <a href="[[eulaUrl_]]" target="_blank">$i18n{printerEulaNotice}</a>
+ </div>
+ </template>
</div>
<div slot="dialog-buttons">
<cr-button class="cancel-button" on-click="onCancelTap_">
diff --git a/chromium/chrome/browser/resources/settings/printing_page/cups_edit_printer_dialog.js b/chromium/chrome/browser/resources/settings/printing_page/cups_edit_printer_dialog.js
index 2832048cf28..7f78d1dfb77 100644
--- a/chromium/chrome/browser/resources/settings/printing_page/cups_edit_printer_dialog.js
+++ b/chromium/chrome/browser/resources/settings/printing_page/cups_edit_printer_dialog.js
@@ -125,14 +125,13 @@ Polymer({
'onModelChanged_(pendingPrinter_.ppdModel)',
],
- /** @private {?chromeos.networkConfig.mojom.CrosNetworkConfigProxy} */
- networkConfigProxy_: null,
+ /** @private {?chromeos.networkConfig.mojom.CrosNetworkConfigRemote} */
+ networkConfig_: null,
/** @override */
created: function() {
- this.networkConfigProxy_ =
- network_config.MojoInterfaceProviderImpl.getInstance()
- .getMojoServiceProxy();
+ this.networkConfig_ = network_config.MojoInterfaceProviderImpl.getInstance()
+ .getMojoServiceRemote();
},
/** @override */
@@ -291,12 +290,20 @@ Polymer({
},
/**
+ * @return {boolean} Whether the current printer was auto configured.
+ * @private
+ */
+ isAutoconfPrinter_: function() {
+ return this.pendingPrinter_.printerPpdReference.autoconf;
+ },
+
+ /**
* @return {boolean} Whether the Save button is enabled.
* @private
*/
canSavePrinter_: function() {
return this.printerInfoChanged_ &&
- (this.isPrinterValid() || !this.isOnline_);
+ (this.isPrinterConfigured_() || !this.isOnline_);
},
/**
@@ -397,17 +404,20 @@ Polymer({
},
/**
- * Returns true if the printer has valid name, address, and PPD.
+ * Returns true if the printer has valid name, address, and valid PPD or was
+ * auto-configured.
* @return {boolean}
+ * @private
*/
- isPrinterValid: function() {
+ isPrinterConfigured_: function() {
return settings.printing.isNameAndAddressValid(this.pendingPrinter_) &&
- settings.printing.isPPDInfoValid(
- this.pendingPrinter_.ppdManufacturer, this.pendingPrinter_.ppdModel,
- this.pendingPrinter_.printerPPDPath);
+ (this.isAutoconfPrinter_() ||
+ settings.printing.isPPDInfoValid(
+ this.pendingPrinter_.ppdManufacturer,
+ this.pendingPrinter_.ppdModel,
+ this.pendingPrinter_.printerPPDPath));
},
-
/**
* Helper function to copy over modified fields to activePrinter.
* @private
@@ -431,7 +441,7 @@ Polymer({
* @private
*/
refreshNetworks_: function() {
- this.networkConfigProxy_
+ this.networkConfig_
.getNetworkStateList({
filter: chromeos.networkConfig.mojom.FilterType.kActive,
networkType: chromeos.networkConfig.mojom.NetworkType.kAll,
diff --git a/chromium/chrome/browser/resources/settings/printing_page/cups_nearby_printers.html b/chromium/chrome/browser/resources/settings/printing_page/cups_nearby_printers.html
index 428055b1b0f..7d6bf1824d2 100644
--- a/chromium/chrome/browser/resources/settings/printing_page/cups_nearby_printers.html
+++ b/chromium/chrome/browser/resources/settings/printing_page/cups_nearby_printers.html
@@ -8,10 +8,20 @@
<dom-module id="settings-cups-nearby-printers">
<template>
- <style include="settings-shared"></style>
+ <style include="settings-shared">
+ #noPrinterMessage {
+ margin-inline-start: 60px;
+ margin-top: 20px;
+ }
+ </style>
<settings-cups-printers-entry-list printers="[[nearbyPrinters_]]"
search-term="[[searchTerm]]">
</settings-cups-printers-entry-list>
+ <div class="secondary" id="noPrinterMessage"
+ hidden="[[!shouldShowNoNearbyPrinterMessage_(searchTerm,
+ nearbyPrinters_)]]">
+ $i18n{noPrinterNearbyMessage}
+ </div>
</template>
<script src="cups_nearby_printers.js"></script>
</dom-module>
diff --git a/chromium/chrome/browser/resources/settings/printing_page/cups_nearby_printers.js b/chromium/chrome/browser/resources/settings/printing_page/cups_nearby_printers.js
index 76652d815cd..aa4912c4010 100644
--- a/chromium/chrome/browser/resources/settings/printing_page/cups_nearby_printers.js
+++ b/chromium/chrome/browser/resources/settings/printing_page/cups_nearby_printers.js
@@ -93,8 +93,10 @@ Polymer({
settings.CupsPrintersBrowserProxyImpl.getInstance()
.addDiscoveredPrinter(item.printerInfo.printerId)
- .then(this.onAddNearbyPrintersSucceeded_.bind(this,
- item.printerInfo.printerName));
+ .then(
+ this.onAddNearbyPrintersSucceeded_.bind(this,
+ item.printerInfo.printerName),
+ this.onAddNearbyPrinterFailed_.bind(this));
},
/**
@@ -114,7 +116,7 @@ Polymer({
},
/**
- * Handler for addDiscoveredPrinter.
+ * Handler for addDiscoveredPrinter success.
* @param {string} printerName
* @param {!PrinterSetupResult} result
* @private
@@ -123,5 +125,25 @@ Polymer({
this.fire(
'show-cups-printer-toast',
{resultCode: result, printerName: printerName});
+ },
+
+ /**
+ * Handler for addDiscoveredPrinter failure.
+ * @param {*} printer
+ * @private
+ */
+ onAddNearbyPrinterFailed_: function(printer) {
+ this.fire(
+ 'show-cups-printer-toast',
+ {resultCode: PrinterSetupResult.PRINTER_UNREACHABLE,
+ printerName: printer.printerName});
+ },
+
+ /**
+ * @return {boolean} Returns true if noPrinterMessage should be visible.
+ * @private
+ */
+ shouldShowNoNearbyPrinterMessage_: function() {
+ return !this.searchTerm && !this.nearbyPrinters_.length;
}
}); \ No newline at end of file
diff --git a/chromium/chrome/browser/resources/settings/printing_page/cups_printer_types.js b/chromium/chrome/browser/resources/settings/printing_page/cups_printer_types.js
index 1d8487bf254..d2367b61c3b 100644
--- a/chromium/chrome/browser/resources/settings/printing_page/cups_printer_types.js
+++ b/chromium/chrome/browser/resources/settings/printing_page/cups_printer_types.js
@@ -15,6 +15,8 @@ let PrinterListEntry;
* These values correspond to the different types of printers available. Refer
* to cups_printer_management.md for more information about the different
* categories of printers.
+ *
+ * The types are numbered in desired sorting order for display.
*/
const PrinterType = {
SAVED: 0,
diff --git a/chromium/chrome/browser/resources/settings/printing_page/cups_printers.html b/chromium/chrome/browser/resources/settings/printing_page/cups_printers.html
index 7f23152c39a..6777282b161 100644
--- a/chromium/chrome/browser/resources/settings/printing_page/cups_printers.html
+++ b/chromium/chrome/browser/resources/settings/printing_page/cups_printers.html
@@ -3,6 +3,7 @@
<link rel="import" href="chrome://resources/cr_components/chromeos/network/mojo_interface_provider.html">
<link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_network_listener_behavior.html">
<link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html">
+<link rel="import" href="chrome://resources/cr_elements/cr_icon_button/cr_icon_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_toast/cr_toast.html">
<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_indicator.html">
<link rel="import" href="chrome://resources/html/action_link.html">
@@ -10,20 +11,22 @@
<link rel="import" href="chrome://resources/html/assert.html">
<link rel="import" href="chrome://resources/html/chromeos/onc_mojo.html">
<link rel="import" href="chrome://resources/html/cr/ui/focus_without_ink.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
<link rel="import" href="cups_add_printer_dialog.html">
<link rel="import" href="cups_edit_printer_dialog.html">
<link rel="import" href="cups_printer_shared_css.html">
<link rel="import" href="cups_printers_list.html">
<link rel="import" href="cups_saved_printers.html">
<link rel="import" href="cups_nearby_printers.html">
+<link rel="import" href="../route.html">
<dom-module id="settings-cups-printers">
<template>
- <style include="cups-printer-shared action-link">
+ <style include="cups-printer-shared action-link iron-flex
+ iron-flex-alignment">
.custom-list-item {
- align-items: center;
border-bottom: var(--cr-separator-line);
- display: flex;
min-height: var(--settings-row-min-height);
}
@@ -42,6 +45,25 @@
flex: 1;
}
+ #addManualPrinterIcon {
+ --iron-icon-fill-color: rgb(138, 180, 248);
+ --cr-icon-button-margin-end: 0;
+ }
+
+ #cloudOffIcon {
+ --iron-icon-fill-color: rgb(95, 99, 104);
+ margin-top: 10px;
+ }
+
+ #connectionMessage {
+ padding-inline-start: 20px;
+ }
+
+ #noConnectivityContentContainer {
+ border-bottom: var(--cr-separator-line);
+ padding-inline-start: 20px;
+ }
+
#noSearchResultsMessage {
color: var(--md-loading-message-color);
font-size: 16px;
@@ -49,6 +71,16 @@
margin-top: 80px;
text-align: center;
}
+
+ #savedPrintersContainer {
+ border-bottom: var(--cr-separator-line);
+ }
+
+ :host(:not([can-add-printer])) #addPrinterSection,
+ :host(:not([can-add-printer])) #nearbyPrinters {
+ opacity: var(--cr-disabled-opacity);
+ pointer-events: none;
+ }
</style>
<template is="dom-if" if="[[!enableUpdatedUi_]]">
@@ -58,11 +90,11 @@
<a href="$i18n{printingCUPSPrintLearnMoreUrl}" target="_blank">
$i18n{learnMore}
</a>
- <div class="secondary" hidden="[[canAddPrinter_]]">
+ <div class="secondary" hidden="[[canAddPrinter]]">
$i18n{requireNetworkMessage}
</div>
</div>
- <template is="dom-if" if="[[!addPrinterButtonActive_(canAddPrinter_,
+ <template is="dom-if" if="[[!addPrinterButtonActive_(canAddPrinter,
prefs.native_printing.user_native_printers_allowed.value)]]">
<cr-policy-pref-indicator
pref="[[prefs.native_printing.user_native_printers_allowed]]"
@@ -71,7 +103,7 @@
</template>
<cr-button class="action-button" id="addPrinter"
on-click="onAddPrinterTap_"
- disabled="[[!addPrinterButtonActive_(canAddPrinter_,
+ disabled="[[!addPrinterButtonActive_(canAddPrinter,
prefs.native_printing.user_native_printers_allowed.value)]]">
$i18n{addCupsPrinter}
</cr-button>
@@ -80,32 +112,52 @@
active-printer="{{activePrinter}}"
search-term="[[searchTerm]]">
</settings-cups-printers-list>
+
+ <div id="noSearchResultsMessage"
+ hidden="[[!showNoSearchResultsMessage_(searchTerm)]]">
+ $i18n{noSearchResults}
+ </div>
</template>
<template is="dom-if" if="[[enableUpdatedUi_]]">
- <div class="settings-box first">
- <div class="start">
- <span>$i18n{savedPrintersTitle}</span>
+ <template is="dom-if" if="[[!canAddPrinter]]">
+ <div id="noConnectivityContentContainer"
+ class="layout horizontal padded">
+ <iron-icon id="cloudOffIcon" icon="settings20:cloud-off"></iron-icon>
+ <div id="connectionMessage" class="layout vertical">
+ <div>$i18n{noInternetConnection}</div>
+ <div class="secondary">$i18n{checkNetworkAndTryAgain}</div>
+ </div>
</div>
- </div>
+ </template>
+
+ <template is="dom-if"
+ if="[[doesAccountHaveSavedPrinters_(savedPrinters_)]]" restamp>
+ <div id="savedPrintersContainer">
+ <div class="settings-box first">
+ <div class="start">
+ <span>$i18n{savedPrintersTitle}</span>
+ </div>
+ </div>
- <settings-cups-saved-printers id="savedPrinters"
- active-printer="{{activePrinter}}"
- search-term="[[searchTerm]]">
- </settings-cups-saved-printers>
+ <settings-cups-saved-printers id="savedPrinters"
+ active-printer="{{activePrinter}}"
+ saved-printers="[[savedPrinters_]]"
+ search-term="[[searchTerm]]">
+ </settings-cups-saved-printers>
+ </div>
+ </template>
<div class="padded first" id="nearbyPrinters">
<div>$i18n{nearbyPrintersListTitle}</div>
<span class="secondary">
$i18n{nearbyPrintersListDescription}
</span>
- <a href="$i18n{printingCUPSPrintLearnMoreUrl}" target="_blank">
+ <a href="$i18n{printingCUPSPrintLearnMoreUrl}"
+ target="_blank">
$i18n{learnMore}
</a>
- <div class="secondary" hidden="[[canAddPrinter_]]">
- $i18n{requireNetworkMessage}
- </div>
- <template is="dom-if" if="[[!addPrinterButtonActive_(canAddPrinter_,
+ <template is="dom-if" if="[[!addPrinterButtonActive_(canAddPrinter,
prefs.native_printing.user_native_printers_allowed.value)]]">
<cr-policy-pref-indicator
pref="[[prefs.native_printing.user_native_printers_allowed]]"
@@ -115,20 +167,22 @@
</div>
<div id="addPrinterSection">
- <div class="custom-list-item">
+ <div class="layout horizontal center custom-list-item">
<div id="addPrinterText">$i18n{addCupsPrinter}</div>
- <cr-button class="action-button" id="addPrinter"
+ <cr-icon-button class="action-button" id="addManualPrinterIcon"
+ iron-icon="settings20:printer-add"
on-click="onAddPrinterTap_"
- disabled="[[!addPrinterButtonActive_(canAddPrinter_,
- prefs.native_printing.user_native_printers_allowed.value)]]">
- $i18n{addCupsPrinter}
- </cr-button>
+ disabled="[[!addPrinterButtonActive_(canAddPrinter,
+ prefs.native_printing.user_native_printers_allowed.value)]]"
+ title="$i18n{addCupsPrinter}">
+ </cr-icon-button>
</div>
</div>
-
- <settings-cups-nearby-printers search-term="[[searchTerm]]"
- active-printer="{{activePrinter}}">
- </settings-cups-nearby-printers>
+ <template is="dom-if" if="[[canAddPrinter]]" restamp>
+ <settings-cups-nearby-printers search-term="[[searchTerm]]"
+ active-printer="{{activePrinter}}">
+ </settings-cups-nearby-printers>
+ </template>
</template>
<settings-cups-add-printer-dialog id="addPrinterDialog"
@@ -143,11 +197,6 @@
</settings-cups-edit-printer-dialog>
</template>
- <div id="noSearchResultsMessage"
- hidden="[[!showNoSearchResultsMessage_(searchTerm)]]">
- $i18n{noSearchResults}
- </div>
-
<cr-toast id="errorToast" duration="3000">
<div class="error-message" id="addPrinterDoneMessage">
[[addPrinterResultText_]]
diff --git a/chromium/chrome/browser/resources/settings/printing_page/cups_printers.js b/chromium/chrome/browser/resources/settings/printing_page/cups_printers.js
index 7e41ed47507..21109350ab6 100644
--- a/chromium/chrome/browser/resources/settings/printing_page/cups_printers.js
+++ b/chromium/chrome/browser/resources/settings/printing_page/cups_printers.js
@@ -14,6 +14,7 @@ Polymer({
behaviors: [
CrNetworkListenerBehavior,
+ settings.RouteObserverBehavior,
WebUIListenerBehavior,
],
@@ -36,8 +37,20 @@ Polymer({
type: String,
},
- /** @private */
- canAddPrinter_: Boolean,
+ /** This is also used as an attribute for css styling. */
+ canAddPrinter: {
+ type: Boolean,
+ reflectToAttribute: true,
+ },
+
+ /**
+ * @type {!Array<!PrinterListEntry>}
+ * @private
+ */
+ savedPrinters_: {
+ type: Array,
+ value: () => [],
+ },
/** @private */
showCupsEditPrinterDialog_: Boolean,
@@ -65,19 +78,19 @@ Polymer({
'openManufacturerModelDialogForSpecifiedPrinter_',
},
- /** @private {?chromeos.networkConfig.mojom.CrosNetworkConfigProxy} */
- networkConfigProxy_: null,
+ /** @private {?chromeos.networkConfig.mojom.CrosNetworkConfigRemote} */
+ networkConfig_: null,
/** @override */
created: function() {
- this.networkConfigProxy_ =
+ this.networkConfig_ =
network_config.MojoInterfaceProviderImpl.getInstance()
- .getMojoServiceProxy();
+ .getMojoServiceRemote();
},
/** @override */
attached: function() {
- this.networkConfigProxy_
+ this.networkConfig_
.getNetworkStateList({
filter: chromeos.networkConfig.mojom.FilterType.kActive,
networkType: chromeos.networkConfig.mojom.NetworkType.kAll,
@@ -90,9 +103,6 @@ Polymer({
if (this.enableUpdatedUi_) {
return;
}
-
- this.addWebUIListener(
- 'on-printers-changed', this.printersChanged_.bind(this));
},
/** @override */
@@ -100,6 +110,21 @@ Polymer({
this.updateCupsPrintersList_();
},
+
+ /**
+ * settings.RouteObserverBehavior
+ * @param {!settings.Route} route
+ * @protected
+ */
+ currentRouteChanged: function(route) {
+ if (route != settings.routes.CUPS_PRINTERS) {
+ cr.removeWebUIListener('on-printers-changed');
+ return;
+ }
+ cr.addWebUIListener(
+ 'on-printers-changed', this.onPrintersChanged_.bind(this));
+ },
+
/**
* CrosNetworkConfigObserver impl
* @param {!Array<chromeos.networkConfig.mojom.NetworkStateProperties>}
@@ -107,8 +132,12 @@ Polymer({
* @private
*/
onActiveNetworksChanged: function(networks) {
- this.canAddPrinter_ = networks.some(function(network) {
- return OncMojo.connectionStateIsConnected(network.connectionState);
+ this.canAddPrinter = networks.some(function(network) {
+ // Note: Check for kOnline rather than using
+ // OncMojo.connectionStateIsConnected() since the latter could return true
+ // for networks without connectivity (e.g., captive portals).
+ return network.connectionState ==
+ chromeos.networkConfig.mojom.ConnectionStateType.kOnline;
});
},
@@ -123,25 +152,23 @@ Polymer({
const printerName = event.detail.printerName;
switch (event.detail.resultCode) {
case PrinterSetupResult.SUCCESS:
- if (this.enableUpdatedUi_) {
- this.$$('#savedPrinters').updateSavedPrintersList();
- } else {
- this.updateCupsPrintersList_();
- }
+ this.updateCupsPrintersList_();
this.addPrinterResultText_ =
loadTimeData.getStringF('printerAddedSuccessfulMessage',
printerName);
break;
case PrinterSetupResult.EDIT_SUCCESS:
- if (this.enableUpdatedUi_) {
- this.$$('#savedPrinters').updateSavedPrintersList();
- } else {
- this.updateCupsPrintersList_();
- }
+ this.updateCupsPrintersList_();
this.addPrinterResultText_ =
loadTimeData.getStringF('printerEditedSuccessfulMessage',
printerName);
break;
+ case PrinterSetupResult.PRINTER_UNREACHABLE:
+ if (this.enableUpdatedUi_) {
+ this.addPrinterResultText_ =
+ loadTimeData.getStringF('printerUnavailableMessage', printerName);
+ break;
+ }
default:
assertNotReached();
}
@@ -163,15 +190,22 @@ Polymer({
updateCupsPrintersList_: function() {
settings.CupsPrintersBrowserProxyImpl.getInstance()
.getCupsPrintersList()
- .then(this.printersChanged_.bind(this));
+ .then(this.onPrintersChanged_.bind(this));
},
/**
* @param {!CupsPrintersList} cupsPrintersList
* @private
*/
- printersChanged_: function(cupsPrintersList) {
- this.printers = cupsPrintersList.printerList;
+ onPrintersChanged_: function(cupsPrintersList) {
+ if (this.enableUpdatedUi_) {
+ this.savedPrinters_ = cupsPrintersList.printerList.map(
+ printer => /** @type {!PrinterListEntry} */({
+ printerInfo: printer,
+ printerType: PrinterType.SAVED}));
+ } else {
+ this.printers = cupsPrintersList.printerList;
+ }
},
/** @private */
@@ -181,7 +215,9 @@ Polymer({
/** @private */
onAddPrinterDialogClose_: function() {
- cr.ui.focusWithoutInk(assert(this.$$('#addPrinter')));
+ cr.ui.focusWithoutInk(assert(
+ this.enableUpdatedUi_ ? this.$$('#addManualPrinterIcon')
+ : this.$$('#addPrinter')));
},
/** @private */
@@ -220,5 +256,13 @@ Polymer({
addPrinterButtonActive_: function(
connectedToNetwork, userNativePrintersAllowed) {
return connectedToNetwork && userNativePrintersAllowed;
+ },
+
+ /**
+ * @return {boolean} Whether |savedPrinters_| is empty.
+ * @private
+ */
+ doesAccountHaveSavedPrinters_: function() {
+ return !!this.savedPrinters_.length;
}
});
diff --git a/chromium/chrome/browser/resources/settings/printing_page/cups_printers_entry.html b/chromium/chrome/browser/resources/settings/printing_page/cups_printers_entry.html
index 164a8c5e637..c8df839a0ee 100644
--- a/chromium/chrome/browser/resources/settings/printing_page/cups_printers_entry.html
+++ b/chromium/chrome/browser/resources/settings/printing_page/cups_printers_entry.html
@@ -1,7 +1,6 @@
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html">
-<link rel="import" href="chrome://resources/cr_elements/cr_icon_button/cr_icon_button.html">
<link rel="import" href="cups_printer_types.html">
<link rel="import" href="cups_printers_browser_proxy.html">
<link rel="import" href="../settings_shared_css.html">
@@ -29,17 +28,16 @@
</template>
<template is="dom-if"
if="[[isDiscoveredPrinter_(printerEntry.printerType)]]">
- <cr-button class="action-button"
+ <cr-button id="setupPrinterButton"
on-click="onOpenManufacturerModelDialogTap_">
- $i18n{configurePrinter}
+ $i18n{setupPrinter}
</cr-button>
</template>
<template is="dom-if"
if="[[isAutomaticPrinter_(printerEntry.printerType)]]">
- <cr-icon-button class="icon-add-circle"
- on-click="onAddAutomaticPrinterTap_"
- title="$i18n{moreActions}">
- </cr-icon-button>
+ <cr-button id="savePrinterButton" on-click="onAddAutomaticPrinterTap_">
+ $i18n{savePrinter}
+ </cr-button>
</template>
</div>
</template>
diff --git a/chromium/chrome/browser/resources/settings/printing_page/cups_printers_entry_list.html b/chromium/chrome/browser/resources/settings/printing_page/cups_printers_entry_list.html
index fdb85be62b1..bf9fbaf1f9f 100644
--- a/chromium/chrome/browser/resources/settings/printing_page/cups_printers_entry_list.html
+++ b/chromium/chrome/browser/resources/settings/printing_page/cups_printers_entry_list.html
@@ -19,6 +19,12 @@
iron-list {
flex: 1 1 auto;
}
+
+ #no-search-results {
+ margin-top: 20px;
+ text-align: center;
+ }
+
</style>
<iron-list class="list-frame vertical-list" id="printerEntryList"
items="[[filteredPrinters_]]">
@@ -27,6 +33,10 @@
</settings-cups-printers-entry>
</template>
</iron-list>
+ <div id="no-search-results"
+ hidden="[[!showNoSearchResultsMessage_]]">
+ $i18n{noSearchResults}
+ </div>
</template>
<script src="cups_printers_entry_list.js"></script>
</dom-module>
diff --git a/chromium/chrome/browser/resources/settings/printing_page/cups_printers_entry_list.js b/chromium/chrome/browser/resources/settings/printing_page/cups_printers_entry_list.js
index 6037c31aecc..3fe5f69bd12 100644
--- a/chromium/chrome/browser/resources/settings/printing_page/cups_printers_entry_list.js
+++ b/chromium/chrome/browser/resources/settings/printing_page/cups_printers_entry_list.js
@@ -37,7 +37,20 @@ Polymer({
* Search term for filtering |printers|.
* @type {string}
*/
- searchTerm: String,
+ searchTerm: {
+ type: String,
+ value: '',
+ },
+
+ /**
+ * Whether to show the no search results message.
+ * @type {boolean}
+ * @private
+ */
+ showNoSearchResultsMessage_: {
+ type: Boolean,
+ value: false,
+ },
},
observers: [
@@ -59,13 +72,30 @@ Polymer({
item =>this.matchesSearchTerm_(item.printerInfo,this.searchTerm)) :
this.printers.slice();
- updatedPrinters.sort((first, second) => {
- return settings.printing.alphabeticalSort(
- first.printerInfo, second.printerInfo);
- });
+ updatedPrinters.sort(this.sortPrinters_);
this.updateList('filteredPrinters_', printer => printer.printerInfo,
updatedPrinters);
+
+ this.showNoSearchResultsMessage_ =
+ !!this.searchTerm && !this.filteredPrinters_.length;
+ },
+
+
+ /**
+ * @param {!PrinterListEntry} first
+ * @param {!PrinterListEntry} second
+ * @return {number}
+ * @private
+ */
+ sortPrinters_: function(first, second) {
+ if (first.printerType == second.printerType) {
+ return settings.printing.alphabeticalSort(
+ first.printerInfo, second.printerInfo);
+ }
+
+ // PrinterType sort order maintained in cups_printer_types.js
+ return first.printerType - second.printerType;
},
/**
diff --git a/chromium/chrome/browser/resources/settings/printing_page/cups_saved_printers.html b/chromium/chrome/browser/resources/settings/printing_page/cups_saved_printers.html
index b343992525d..1bb09c08fc0 100644
--- a/chromium/chrome/browser/resources/settings/printing_page/cups_saved_printers.html
+++ b/chromium/chrome/browser/resources/settings/printing_page/cups_saved_printers.html
@@ -19,7 +19,7 @@
</cr-action-menu>
<style include="settings-shared"></style>
- <settings-cups-printers-entry-list printers="[[savedPrinters_]]"
+ <settings-cups-printers-entry-list printers="[[savedPrinters]]"
search-term="[[searchTerm]]">
</settings-cups-printers-entry-list>
</template>
diff --git a/chromium/chrome/browser/resources/settings/printing_page/cups_saved_printers.js b/chromium/chrome/browser/resources/settings/printing_page/cups_saved_printers.js
index a44b197232f..85ef694f1ec 100644
--- a/chromium/chrome/browser/resources/settings/printing_page/cups_saved_printers.js
+++ b/chromium/chrome/browser/resources/settings/printing_page/cups_saved_printers.js
@@ -14,17 +14,13 @@ Polymer({
],
properties: {
- /**
- * @type {!Array<!PrinterListEntry>}
- * @private
- */
- savedPrinters_: {
+ /** @type {!Array<!PrinterListEntry>} */
+ savedPrinters: {
type: Array,
- value: () => [],
},
/**
- * Search term for filtering |savedPrinters_|.
+ * Search term for filtering |savedPrinters|.
* @type {string}
*/
searchTerm: {
@@ -60,35 +56,6 @@ Polymer({
this.browserProxy_ = settings.CupsPrintersBrowserProxyImpl.getInstance();
},
- /** @override */
- ready: function() {
- this.addWebUIListener(
- 'on-printers-changed', this.printersChanged_.bind(this));
- this.updateSavedPrintersList();
- },
-
- /** Public function to update the printer list. */
- updateSavedPrintersList: function() {
- settings.CupsPrintersBrowserProxyImpl.getInstance()
- .getCupsPrintersList()
- .then(this.printersChanged_.bind(this));
- },
-
- /**
- * @param {!CupsPrintersList} cupsPrintersList
- * @private
- */
- printersChanged_: function(cupsPrintersList) {
- if (!cupsPrintersList) {
- return;
- }
-
- this.savedPrinters_ = cupsPrintersList.printerList.map(
- printer => /** @type {!PrinterListEntry} */({
- printerInfo: printer,
- printerType: PrinterType.SAVED}));
- },
-
/**
* @param {!CustomEvent<{target: !HTMLElement, item: !PrinterListEntry}>} e
* @private
@@ -96,10 +63,10 @@ Polymer({
onOpenActionMenu_: function(e) {
const item = /** @type {!PrinterListEntry} */(e.detail.item);
this.activePrinterListEntryIndex_ =
- this.savedPrinters_.findIndex(
+ this.savedPrinters.findIndex(
printer => printer.printerInfo == item.printerInfo);
this.activePrinter =
- this.get(['savedPrinters_', this.activePrinterListEntryIndex_])
+ this.get(['savedPrinters', this.activePrinterListEntryIndex_])
.printerInfo;
const target = /** @type {!HTMLElement} */ (e.detail.target);
@@ -115,7 +82,6 @@ Polymer({
/** @private */
onRemoveTap_: function() {
- this.splice('savedPrinters_', this.activePrinterListEntryIndex_, 1);
this.browserProxy_.removeCupsPrinter(
this.activePrinter.printerId, this.activePrinter.printerName);
this.activePrinter = null;
diff --git a/chromium/chrome/browser/resources/settings/privacy_page/BUILD.gn b/chromium/chrome/browser/resources/settings/privacy_page/BUILD.gn
index a77c34ad919..028266d95fb 100644
--- a/chromium/chrome/browser/resources/settings/privacy_page/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/privacy_page/BUILD.gn
@@ -9,6 +9,7 @@ js_type_check("closure_compile") {
":personalization_options",
":privacy_page",
":privacy_page_browser_proxy",
+ ":security_keys_bio_enroll_dialog",
":security_keys_credential_management_dialog",
":security_keys_reset_dialog",
":security_keys_set_pin_dialog",
@@ -76,6 +77,7 @@ js_library("security_keys_subpage") {
js_library("security_keys_set_pin_dialog") {
deps = [
":security_keys_browser_proxy",
+ "//third_party/polymer/v1_0/components-chromium/iron-a11y-announcer:iron-a11y-announcer-extracted",
"//ui/webui/resources/js:i18n_behavior",
]
externs_list = [ "$externs_path/settings_private.js" ]
@@ -103,3 +105,13 @@ js_library("security_keys_reset_dialog") {
]
externs_list = [ "$externs_path/settings_private.js" ]
}
+
+js_library("security_keys_bio_enroll_dialog") {
+ deps = [
+ ":security_keys_browser_proxy",
+ ":security_keys_pin_field",
+ "//ui/webui/resources/cr_elements/cr_fingerprint:cr_fingerprint_progress_arc",
+ "//ui/webui/resources/js:i18n_behavior",
+ ]
+ externs_list = [ "$externs_path/settings_private.js" ]
+}
diff --git a/chromium/chrome/browser/resources/settings/privacy_page/privacy_page.html b/chromium/chrome/browser/resources/settings/privacy_page/privacy_page.html
index 283cfb4c790..1ad29354d5c 100644
--- a/chromium/chrome/browser/resources/settings/privacy_page/privacy_page.html
+++ b/chromium/chrome/browser/resources/settings/privacy_page/privacy_page.html
@@ -396,23 +396,21 @@
</category-setting-exceptions>
</settings-subpage>
</template>
- <template is="dom-if" if="[[enableSensorsContentSetting_]]" no-search>
- <template is="dom-if" route-path="/content/sensors" no-search>
- <settings-subpage page-title="$i18n{siteSettingsSensors}"
- search-label="$i18n{siteSettingsAllSitesSearch}"
- search-term="{{searchFilter_}}">
- <category-default-setting
- toggle-off-label="$i18n{siteSettingsSensorsBlock}"
- toggle-on-label="$i18n{siteSettingsSensorsAllow}"
- category="{{ContentSettingsTypes.SENSORS}}">
- </category-default-setting>
- <category-setting-exceptions
- category="{{ContentSettingsTypes.SENSORS}}" read-only-list
- block-header="$i18n{siteSettingsBlock}"
- search-filter="[[searchFilter_]]">
- </category-setting-exceptions>
- </settings-subpage>
- </template>
+ <template is="dom-if" route-path="/content/sensors" no-search>
+ <settings-subpage page-title="$i18n{siteSettingsSensors}"
+ search-label="$i18n{siteSettingsAllSitesSearch}"
+ search-term="{{searchFilter_}}">
+ <category-default-setting
+ toggle-off-label="$i18n{siteSettingsSensorsBlock}"
+ toggle-on-label="$i18n{siteSettingsSensorsAllow}"
+ category="{{ContentSettingsTypes.SENSORS}}">
+ </category-default-setting>
+ <category-setting-exceptions
+ category="{{ContentSettingsTypes.SENSORS}}" read-only-list
+ block-header="$i18n{siteSettingsBlock}"
+ search-filter="[[searchFilter_]]">
+ </category-setting-exceptions>
+ </settings-subpage>
</template>
<template is="dom-if" route-path="/content/notifications" no-search>
<settings-subpage page-title="$i18n{siteSettingsCategoryNotifications}"
@@ -557,6 +555,25 @@
</settings-subpage>
</template>
</template>
+ <template is="dom-if" if="[[enableNativeFileSystemWriteContentSetting_]]">
+ <template is="dom-if" route-path="/content/filesystem" no-search>
+ <settings-subpage
+ page-title="$i18n{siteSettingsNativeFileSystemWrite}">
+ <category-default-setting
+ toggle-off-label="$i18n{siteSettingsNativeFileSystemWriteBlock}"
+ toggle-on-label=
+ "$i18n{siteSettingsNativeFileSystemWriteAskRecommended}"
+ category="{{ContentSettingsTypes.NATIVE_FILE_SYSTEM_WRITE}}">
+ </category-default-setting>
+ <category-setting-exceptions
+ category="{{ContentSettingsTypes.NATIVE_FILE_SYSTEM_WRITE}}"
+ read-only-list
+ block-header="$i18n{siteSettingsBlock}"
+ search-filter="[[searchFilter_]]">
+ </category-setting-exceptions>
+ </settings-subpage>
+ </template>
+ </template>
<template is="dom-if" route-path="/content/siteDetails" no-search>
<settings-subpage page-title="[[pageTitle]]">
<site-details
diff --git a/chromium/chrome/browser/resources/settings/privacy_page/privacy_page.js b/chromium/chrome/browser/resources/settings/privacy_page/privacy_page.js
index 49ea7f9dae2..57b42d06dee 100644
--- a/chromium/chrome/browser/resources/settings/privacy_page/privacy_page.js
+++ b/chromium/chrome/browser/resources/settings/privacy_page/privacy_page.js
@@ -119,15 +119,6 @@ Polymer({
},
/** @private */
- enableSensorsContentSetting_: {
- type: Boolean,
- readOnly: true,
- value: function() {
- return loadTimeData.getBoolean('enableSensorsContentSetting');
- }
- },
-
- /** @private */
enableExperimentalWebPlatformFeatures_: {
type: Boolean,
value: function() {
@@ -152,6 +143,15 @@ Polymer({
}
},
+ /** @private */
+ enableNativeFileSystemWriteContentSetting_: {
+ type: Boolean,
+ value: function() {
+ return loadTimeData.getBoolean(
+ 'enableNativeFileSystemWriteContentSetting');
+ }
+ },
+
/** @private {!Map<string, string>} */
focusConfig_: {
type: Object,
diff --git a/chromium/chrome/browser/resources/settings/privacy_page/security_keys_bio_enroll_dialog.html b/chromium/chrome/browser/resources/settings/privacy_page/security_keys_bio_enroll_dialog.html
new file mode 100644
index 00000000000..7569eead29a
--- /dev/null
+++ b/chromium/chrome/browser/resources/settings/privacy_page/security_keys_bio_enroll_dialog.html
@@ -0,0 +1,118 @@
+<link rel="import" href="chrome://resources/html/polymer.html">
+
+<link rel="import" href="chrome://resources/html/assert.html">
+<link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html">
+<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
+<link rel="import" href="chrome://resources/cr_elements/cr_fingerprint/cr_fingerprint_progress_arc.html">
+<link rel="import" href="chrome://resources/cr_elements/cr_icon_button/cr_icon_button.html">
+<link rel="import" href="chrome://resources/html/i18n_behavior.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/iron-list/iron-list.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/iron-pages/iron-pages.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner-lite.html">
+<link rel="import" href="../i18n_setup.html">
+<link rel="import" href="../settings_shared_css.html">
+<link rel="import" href="../site_favicon.html">
+<link rel="import" href="security_keys_browser_proxy.html">
+<link rel="import" href="security_keys_pin_field.html">
+
+<dom-module id="settings-security-keys-bio-enroll-dialog">
+ <template>
+ <style include="settings-shared">
+ #header {
+ display: flex;
+ }
+
+ iron-icon {
+ padding-inline-end: 12px;
+ }
+
+ .name {
+ flex: 3;
+ }
+
+ #dialog::part(body-container) {
+ overflow-y: hidden;
+ }
+ </style>
+
+ <cr-dialog id="dialog" close-text="$i18n{cancel}" ignore-popstate
+ on-close="onDialogClosed_">
+ <div slot="title">$i18n{securityKeysBioEnrollmentDialogTitle}</div>
+
+ <div slot="body">
+ <iron-pages attr-for-selected="id" selected="[[dialogPage_]]"
+ on-iron-select="onIronSelect_">
+ <div id="initial">
+ <p>$i18n{securityKeysBioEnrollmentTouch}</p>
+ <paper-spinner-lite style="padding-bottom: 16px;" active>
+ </paper-spinner-lite>
+ </div>
+
+ <div id="pinPrompt">
+ <p>$i18n{securityKeysBioEnrollmentPinPrompt}</p>
+ <settings-security-keys-pin-field id="pin">
+ </settings-security-keys-pin-field>
+ </div>
+
+ <div id="enrollments">
+ <div class="settings-box first">
+ <p class="start" hidden="[[hasSome_(enrollments_)]]">
+ $i18n{securityKeysBioEnrollmentNoEnrollments}</p>
+ <p class="start" hidden="[[!hasSome_(enrollments_)]]">
+ $i18n{securityKeysBioEnrollmentLabel}</p>
+ <cr-button id="addButton" on-click="addButtonClick_"
+ hidden="[[!addButtonVisible_]]"
+ class="secondary-button header-aligned-button">
+ $i18n{add}
+ </cr-button>
+ </div>
+ <div id="container">
+ <iron-list id="enrollmentList" items="[[enrollments_]]"
+ class="cr-separators">
+ <template>
+ <div class="list-item">
+ <iron-icon icon="cr-fingerprint-icon:enrollment-done">
+ </iron-icon>
+ <div class="name" aria-label="[[item.name]]">
+ [[item.name]]
+ </div>
+ <cr-icon-button class="icon-clear"
+ aria-label="i18n{securityKeysBioEnrollmentDelete}"
+ on-click="deleteEnrollment_"
+ disabled="[[deleteInProgress_]]">
+ </cr-icon-button>
+ </div>
+ </template>
+ </iron-list>
+ </div>
+ </div>
+
+ <div id="enroll">
+ <p>$i18n{securityKeysBioEnrollmentEnrollingLabel}</p>
+ <cr-fingerprint-progress-arc id="arc"></cr-fingerprint-progress-arc>
+ </div>
+
+ <div id="error">[[errorMsg_]]</div>
+ </iron-pages>
+ </div>
+
+ <div slot="button-container">
+ <cr-button id="cancelButton" class="cancel-button"
+ on-click="cancel_" hidden="[[!cancelButtonVisible_]]">
+ $i18n{cancel}
+ </cr-button>
+ <cr-button id="okButton" class="action-button"
+ on-click="okButtonClick_" hidden="[[!okButtonVisible_]]">
+ $i18n{ok}
+ </cr-button>
+ <cr-button id="doneButton" class="action-button"
+ on-click="done_" hidden="[[!doneButtonVisible_]]">
+ $i18n{done}
+ </cr-button>
+ </div>
+ </cr-dialog>
+
+ </template>
+ <script src="security_keys_bio_enroll_dialog.js"></script>
+</dom-module>
diff --git a/chromium/chrome/browser/resources/settings/privacy_page/security_keys_bio_enroll_dialog.js b/chromium/chrome/browser/resources/settings/privacy_page/security_keys_bio_enroll_dialog.js
new file mode 100644
index 00000000000..1f251c65aa4
--- /dev/null
+++ b/chromium/chrome/browser/resources/settings/privacy_page/security_keys_bio_enroll_dialog.js
@@ -0,0 +1,273 @@
+// Copyright 2019 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+(function() {
+'use strict';
+
+/**
+ * @fileoverview 'settings-security-keys-bio-enroll-dialog' is a dialog for
+ * listing, adding, renaming, and deleting biometric enrollments stored on a
+ * security key.
+ */
+Polymer({
+ is: 'settings-security-keys-bio-enroll-dialog',
+
+ behaviors: [
+ I18nBehavior,
+ WebUIListenerBehavior,
+ ],
+
+ properties: {
+ /** @private */
+ addButtonVisible_: Boolean,
+
+ /** @private */
+ cancelButtonVisible_: Boolean,
+
+ /** @private */
+ deleteInProgress_: Boolean,
+
+ /**
+ * The ID of the element currently shown in the dialog.
+ * @private
+ */
+ dialogPage_: {
+ type: String,
+ value: 'initial',
+ observer: 'dialogPageChanged_',
+ },
+
+ /** @private */
+ doneButtonVisible_: Boolean,
+
+ /**
+ * The list of enrollments displayed.
+ * @private {!Array<!Enrollment>}
+ */
+ enrollments_: Array,
+
+ /** @private */
+ okButtonVisible_: Boolean,
+ },
+
+ /** @private {?settings.SecurityKeysBioEnrollProxyImpl} */
+ browserProxy_: null,
+
+ /** @private */
+ maxSamples_: Number,
+
+ /** @override */
+ attached: function() {
+ this.$.dialog.showModal();
+ this.addWebUIListener(
+ 'security-keys-bio-enroll-error', this.onError_.bind(this));
+ this.addWebUIListener(
+ 'security-keys-bio-enroll-status', this.onEnrolling_.bind(this));
+ this.browserProxy_ = settings.SecurityKeysBioEnrollProxyImpl.getInstance();
+ this.browserProxy_.startBioEnroll().then(
+ this.collectPIN_.bind(this), () => {});
+ },
+
+ /** @private */
+ collectPIN_: function() {
+ this.dialogPage_ = 'pinPrompt';
+ this.$.pin.focus();
+ },
+
+ /**
+ * @private
+ * @param {string} error
+ */
+ onError_: function(error) {
+ this.errorMsg_ = error;
+ this.dialogPage_ = 'error';
+ },
+
+ /** @private */
+ submitPIN_: function() {
+ if (!this.$.pin.validate()) {
+ return;
+ }
+ this.browserProxy_.providePIN(this.$.pin.value).then((retries) => {
+ if (retries != null) {
+ this.$.pin.showIncorrectPINError(retries);
+ return;
+ }
+
+ this.browserProxy_.enumerateEnrollments().then(
+ this.onEnrollments_.bind(this));
+ }, () => {});
+ },
+
+ /**
+ * @private
+ * @param {!Array<!Enrollment>} enrollments
+ */
+ onEnrollments_: function(enrollments) {
+ this.enrollments_ = enrollments;
+ this.$.enrollmentList.fire('iron-resize');
+ this.dialogPage_ = 'enrollments';
+ },
+
+ /** @private */
+ dialogPageChanged_: function() {
+ switch (this.dialogPage_) {
+ case 'initial':
+ this.addButtonVisible_ = false;
+ this.cancelButtonVisible_ = true;
+ this.okButtonVisible_ = false;
+ this.doneButtonVisible_ = false;
+ break;
+ case 'pinPrompt':
+ this.addButtonVisible_ = false;
+ this.cancelButtonVisible_ = true;
+ this.okButtonVisible_ = true;
+ this.doneButtonVisible_ = false;
+ break;
+ case 'enrollments':
+ this.addButtonVisible_ = true;
+ this.cancelButtonVisible_ = false;
+ this.okButtonVisible_ = false;
+ this.doneButtonVisible_ = true;
+ break;
+ case 'enroll':
+ this.addButtonVisible_ = false;
+ this.cancelButtonVisible_ = true;
+ this.okButtonVisible_ = false;
+ this.doneButtonVisible_ = false;
+ break;
+ case 'error':
+ this.addButtonVisible_ = false;
+ this.cancelButtonVisible_ = false;
+ this.okButtonVisible_ = false;
+ this.doneButtonVisible_ = true;
+ break;
+ default:
+ assertNotReached();
+ }
+ this.fire('bio-enroll-dialog-ready-for-testing');
+ },
+
+ /** @private */
+ addButtonClick_: function() {
+ assert(this.dialogPage_ == 'enrollments');
+
+ this.maxSamples_ = -1; // Reset maxSamples_ before enrolling starts.
+ this.$.arc.reset();
+ this.cancelButtonVisible_ = true;
+ this.okButtonVisible_ = false;
+
+ this.dialogPage_ = 'enroll';
+ this.browserProxy_.startEnrolling().then(
+ this.onEnrolling_.bind(this), () => {});
+ },
+
+ /**
+ * @private
+ * @param {!EnrollmentStatus} response
+ */
+ onEnrolling_: function(response) {
+ if (this.maxSamples_ == -1 && response.status != null) {
+ if (response.status == 0) {
+ // If the first sample is valid, remaining is one less than max samples
+ // required.
+ this.maxSamples_ = response.remaining + 1;
+ } else {
+ // If the first sample failed for any reason (timed out, key full, etc),
+ // the remaining number of samples is the max samples required.
+ this.maxSamples_ = response.remaining;
+ }
+ }
+ // If 0 samples remain, the enrollment has finished in some state.
+ // Currently not checking response['code'] for an error.
+ this.$.arc.setProgress(
+ 100 - (100 * (response.remaining + 1) / this.maxSamples_),
+ 100 - (100 * response.remaining / this.maxSamples_),
+ response.remaining == 0);
+ if (response.remaining == 0) {
+ this.cancelButtonVisible_ = false;
+ this.okButtonVisible_ = true;
+ }
+ this.fire('bio-enroll-dialog-ready-for-testing');
+ },
+
+ /** @private */
+ okButtonClick_: function() {
+ switch (this.dialogPage_) {
+ case 'pinPrompt':
+ this.submitPIN_();
+ break;
+ case 'enroll':
+ this.browserProxy_.enumerateEnrollments().then(
+ this.onEnrollments_.bind(this), () => {});
+ break;
+ default:
+ assertNotReached();
+ }
+ },
+
+ /** @private */
+ cancel_: function() {
+ if (this.dialogPage_ == 'enroll') {
+ this.browserProxy_.cancelEnrollment().then(
+ this.cancelEnroll_.bind(this), () => {});
+ } else {
+ this.done_();
+ }
+ },
+
+ /** @private */
+ cancelEnroll_: function() {
+ // Cancelling from the enrolling screen redirects to the enrollments
+ // list, so request another enumeration to display.
+ this.browserProxy_.enumerateEnrollments().then(
+ this.onEnrollments_.bind(this), () => {});
+ },
+
+ /** @private */
+ done_: function() {
+ this.$.dialog.close();
+ },
+
+ /** @private */
+ onDialogClosed_: function() {
+ this.browserProxy_.close();
+ },
+
+ /**
+ * @private
+ * @param {!Event} e
+ */
+ onIronSelect_: function(e) {
+ // Prevent this event from bubbling since it is unnecessarily triggering the
+ // listener within settings-animated-pages.
+ e.stopPropagation();
+ },
+
+ /**
+ * @private
+ * @param {?Array} list
+ * @return {boolean} true if the list exists and has items.
+ */
+ hasSome_: function(list) {
+ return !!(list && list.length);
+ },
+
+ /**
+ * @private
+ * @param {!DomRepeatEvent} event
+ */
+ deleteEnrollment_: function(event) {
+ if (this.deleteInProgress_) {
+ return;
+ }
+ this.deleteInProgress_ = true;
+ const enrollment = this.enrollments_[event.model.index];
+ this.browserProxy_.deleteEnrollment(enrollment.id).then(enrollments => {
+ this.deleteInProgress_ = false;
+ this.onEnrollments_(enrollments);
+ });
+ }
+});
+})();
diff --git a/chromium/chrome/browser/resources/settings/privacy_page/security_keys_browser_proxy.js b/chromium/chrome/browser/resources/settings/privacy_page/security_keys_browser_proxy.js
index 0d6f5fb4ce3..00a55d9f52d 100644
--- a/chromium/chrome/browser/resources/settings/privacy_page/security_keys_browser_proxy.js
+++ b/chromium/chrome/browser/resources/settings/privacy_page/security_keys_browser_proxy.js
@@ -26,6 +26,31 @@ cr.exportPath('settings');
*/
let Credential;
+/**
+ * EnrollmentStatus represents the current status of an enrollment suboperation,
+ * where 'remaining' indicates the number of samples left, 'status' indicates
+ * the last enrollment status, and 'code' indicates the CtapDeviceResponseCode.
+ * For each enrollment sample, 'status' is set - when the enrollment operation
+ * reaches an end state, 'code' is set. A 'code' of CtapDeviceResponseCode 0
+ * indicates successful enrollment.
+ *
+ * @typedef {{status: ?number,
+ * code: ?number,
+ * remaining: number}}
+ * @see chrome/browser/ui/webui/settings/settings_security_key_handler.cc
+ */
+let EnrollmentStatus;
+
+/**
+ * Enrollment represents a valid fingerprint template stored on a security key,
+ * which can be used in a user verification request.
+ *
+ * @typedef {{name: string,
+ * id: string}}
+ * @see chrome/browser/ui/webui/settings/settings_security_key_handler.cc
+ */
+let Enrollment;
+
cr.define('settings', function() {
/** @interface */
class SecurityKeysPINBrowserProxy {
@@ -118,6 +143,78 @@ cr.define('settings', function() {
close() {}
}
+ /** @interface */
+ class SecurityKeysBioEnrollProxy {
+ /**
+ * Starts a biometric enrollment operation.
+ *
+ * Callers must listen to errors that can occur during this operation via a
+ * 'security-keys-bio-enrollment-error' WebUIListener. Values received via
+ * this listener are localized error strings. The WebListener may fire at
+ * any point during the operation (enrolling, deleting, etc) and when it
+ * fires, the operation must be considered terminated.
+ *
+ * @return {!Promise} resolves when the handler is ready for the
+ * authentcation PIN to be provided.
+ */
+ startBioEnroll() {}
+
+ /**
+ * Provides a PIN for a biometric enrollment operation. The startBioEnroll()
+ * Promise must have resolved before this method may be called.
+ *
+ * @return {!Promise<?number>} resolves with null if the PIN was correct,
+ * the number of retries remaining otherwise.
+ */
+ providePIN(pin) {}
+
+ /**
+ * Enumerates enrollments on the authenticator. A correct PIN must have
+ * previously been supplied via bioEnrollProvidePIN() before this method may
+ * be called.
+ *
+ * @return {!Promise<!Array<!Enrollment>>}
+ */
+ enumerateEnrollments() {}
+
+ /**
+ * Move the operation into enrolling mode, which instructs the authenticator
+ * to start sampling for touches.
+ *
+ * Callers must listen to status updates that will occur during this
+ * suboperation via a 'security-keys-bio-enroll-status' WebListener. Values
+ * received via this listener are DictionaryValues with two elements (see
+ * below). When the WebListener fires, the authenticator has either timed
+ * out waiting for a touch, or has successfully processed a touch. Any
+ * errors will fire the 'security-keys-bio-enrollment-error' WebListener.
+ *
+ * @return {!Promise<!EnrollmentStatus>} resolves when the enrollment
+ * operation is finished successfully.
+ */
+ startEnrolling() {}
+
+ /**
+ * Cancel an ongoing enrollment suboperation. This can safely be called at
+ * any time and only has an impact when the authenticator is currently
+ * sampling.
+ *
+ * @return {!Promise} resolves when the ongoing enrollment suboperation has
+ * been cancelled.
+ */
+ cancelEnrollment() {}
+
+ /**
+ * Deletes the enrollment with the given ID.
+ *
+ * @param {string} id
+ * @return {!Promise<!Array<!Enrollment>>} The remaining enrollments.
+ */
+ deleteEnrollment(id) {}
+
+ /** Cancels all outstanding operations. */
+ close() {}
+ }
+
/** @implements {settings.SecurityKeysPINBrowserProxy} */
class SecurityKeysPINBrowserProxyImpl {
/** @override */
@@ -182,11 +279,50 @@ cr.define('settings', function() {
}
}
+ /** @implements {settings.SecurityKeysBioEnrollProxy} */
+ class SecurityKeysBioEnrollProxyImpl {
+ /** @override */
+ startBioEnroll() {
+ return cr.sendWithPromise('securityKeyBioEnrollStart');
+ }
+
+ /** @override */
+ providePIN(pin) {
+ return cr.sendWithPromise('securityKeyBioEnrollProvidePIN', pin);
+ }
+
+ /** @override */
+ enumerateEnrollments() {
+ return cr.sendWithPromise('securityKeyBioEnrollEnumerate');
+ }
+
+ /** @override */
+ startEnrolling() {
+ return cr.sendWithPromise('securityKeyBioEnrollStartEnrolling');
+ }
+
+ /** @override */
+ cancelEnrollment() {
+ return cr.sendWithPromise('securityKeyBioEnrollCancel');
+ }
+
+ /** @override */
+ deleteEnrollment(id) {
+ return cr.sendWithPromise('securityKeyBioEnrollDelete', id);
+ }
+
+ /** @override */
+ close() {
+ return chrome.send('securityKeyBioEnrollClose');
+ }
+ }
+
// The singleton instance_ is replaced with a test version of this wrapper
// during testing.
cr.addSingletonGetter(SecurityKeysPINBrowserProxyImpl);
cr.addSingletonGetter(SecurityKeysCredentialBrowserProxyImpl);
cr.addSingletonGetter(SecurityKeysResetBrowserProxyImpl);
+ cr.addSingletonGetter(SecurityKeysBioEnrollProxyImpl);
return {
SecurityKeysPINBrowserProxy: SecurityKeysPINBrowserProxy,
@@ -196,5 +332,7 @@ cr.define('settings', function() {
SecurityKeysCredentialBrowserProxyImpl,
SecurityKeysResetBrowserProxy: SecurityKeysResetBrowserProxy,
SecurityKeysResetBrowserProxyImpl: SecurityKeysResetBrowserProxyImpl,
+ SecurityKeysBioEnrollProxy: SecurityKeysBioEnrollProxy,
+ SecurityKeysBioEnrollProxyImpl: SecurityKeysBioEnrollProxyImpl,
};
});
diff --git a/chromium/chrome/browser/resources/settings/privacy_page/security_keys_credential_management_dialog.html b/chromium/chrome/browser/resources/settings/privacy_page/security_keys_credential_management_dialog.html
index a67ac0a89bc..0045f54d6a2 100644
--- a/chromium/chrome/browser/resources/settings/privacy_page/security_keys_credential_management_dialog.html
+++ b/chromium/chrome/browser/resources/settings/privacy_page/security_keys_credential_management_dialog.html
@@ -1,5 +1,6 @@
<link rel="import" href="chrome://resources/html/polymer.html">
+<link rel="import" href="chrome://resources/html/assert.html">
<link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_checkbox/cr_checkbox.html">
<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
diff --git a/chromium/chrome/browser/resources/settings/privacy_page/security_keys_credential_management_dialog.js b/chromium/chrome/browser/resources/settings/privacy_page/security_keys_credential_management_dialog.js
index ce300e509eb..146f22674b3 100644
--- a/chromium/chrome/browser/resources/settings/privacy_page/security_keys_credential_management_dialog.js
+++ b/chromium/chrome/browser/resources/settings/privacy_page/security_keys_credential_management_dialog.js
@@ -166,6 +166,8 @@ Polymer({
this.confirmButtonVisible_ = false;
this.closeButtonVisible_ = true;
break;
+ default:
+ assertNotReached();
}
this.fire('credential-management-dialog-ready-for-testing');
},
diff --git a/chromium/chrome/browser/resources/settings/privacy_page/security_keys_set_pin_dialog.html b/chromium/chrome/browser/resources/settings/privacy_page/security_keys_set_pin_dialog.html
index 2e6c0a4942f..94f201d1cf2 100644
--- a/chromium/chrome/browser/resources/settings/privacy_page/security_keys_set_pin_dialog.html
+++ b/chromium/chrome/browser/resources/settings/privacy_page/security_keys_set_pin_dialog.html
@@ -6,6 +6,7 @@
<link rel="import" href="chrome://resources/cr_elements/cr_icons_css.html">
<link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/iron-a11y-announcer/iron-a11y-announcer.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-pages/iron-pages.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner-lite.html">
<link rel="import" href="../i18n_setup.html">
diff --git a/chromium/chrome/browser/resources/settings/privacy_page/security_keys_set_pin_dialog.js b/chromium/chrome/browser/resources/settings/privacy_page/security_keys_set_pin_dialog.js
index 4cadbca4e28..813d93e51d5 100644
--- a/chromium/chrome/browser/resources/settings/privacy_page/security_keys_set_pin_dialog.js
+++ b/chromium/chrome/browser/resources/settings/privacy_page/security_keys_set_pin_dialog.js
@@ -149,6 +149,10 @@ Polymer({
this.browserProxy_ = settings.SecurityKeysPINBrowserProxyImpl.getInstance();
this.$.dialog.showModal();
+ Polymer.RenderStatus.afterNextRender(this, function() {
+ Polymer.IronA11yAnnouncer.requestAvailability();
+ });
+
this.browserProxy_.startSetPIN().then(([success, errorCode]) => {
if (success) {
// Operation is complete. errorCode is a CTAP error code. See
@@ -335,6 +339,7 @@ Polymer({
this.currentPINError_ = this.isValidPIN_(this.currentPIN_);
if (this.currentPINError_ != '') {
this.focusOn_(this.$.currentPIN);
+ this.fire('iron-announce', {text: this.currentPINError_});
this.fire('ui-ready'); // for test synchronization.
return;
}
@@ -343,6 +348,7 @@ Polymer({
this.newPINError_ = this.isValidPIN_(this.newPIN_);
if (this.newPINError_ != '') {
this.focusOn_(this.$.newPIN);
+ this.fire('iron-announce', {text: this.newPINError_});
this.fire('ui-ready'); // for test synchronization.
return;
}
@@ -350,6 +356,7 @@ Polymer({
if (this.newPIN_ != this.confirmPIN_) {
this.confirmPINError_ = this.i18n('securityKeysPINMismatch');
this.focusOn_(this.$.confirmPIN);
+ this.fire('iron-announce', {text: this.confirmPINError_});
this.fire('ui-ready'); // for test synchronization.
return;
}
@@ -374,6 +381,7 @@ Polymer({
this.currentPINError_ = this.mismatchError_(this.retries_);
this.setPINButtonValid_ = true;
this.focusOn_(this.$.currentPIN);
+ this.fire('iron-announce', {text: this.currentPINError_});
this.fire('ui-ready'); // for test synchronization.
} else {
// Unknown error.
diff --git a/chromium/chrome/browser/resources/settings/privacy_page/security_keys_subpage.html b/chromium/chrome/browser/resources/settings/privacy_page/security_keys_subpage.html
index e1d58b335fd..8f242c43a58 100644
--- a/chromium/chrome/browser/resources/settings/privacy_page/security_keys_subpage.html
+++ b/chromium/chrome/browser/resources/settings/privacy_page/security_keys_subpage.html
@@ -6,6 +6,7 @@
<link rel="import" href="../settings_shared_css.html">
<link rel="import" href="security_keys_credential_management_dialog.html">
+<link rel="import" href="security_keys_bio_enroll_dialog.html">
<link rel="import" href="security_keys_set_pin_dialog.html">
<link rel="import" href="security_keys_reset_dialog.html">
@@ -32,6 +33,14 @@
label="$i18n{securityKeysReset}"
sub-label="$i18n{securityKeysResetDesc}"
on-click="onReset_"></cr-link-row>
+ <template is="dom-if" if="[[enableBioEnrollment_]]">
+ <cr-link-row
+ id="bioEnrollButton"
+ class="hr"
+ label="$i18n{securityKeysBioEnrollmentDialogTitle}"
+ sub-label="$i18n{securityKeysBioEnrollmentSubpageDescription}"
+ on-click="onBioEnroll_"></cr-link-row>
+ </template>
<template is="dom-if" if="[[showSetPINDialog_]]" restamp>
<settings-security-keys-set-pin-dialog on-close="onSetPINDialogClosed_">
@@ -49,6 +58,12 @@
</settings-security-keys-reset-dialog>
</template>
+ <template is="dom-if" if="[[showBioEnrollDialog_]]" restamp>
+ <settings-security-keys-bio-enroll-dialog
+ on-close="onBioEnrollDialogClosed_">
+ </settings-security-keys-bio-enroll-dialog>
+ </template>
+
</template>
<script src="security_keys_subpage.js"></script>
</dom-module>
diff --git a/chromium/chrome/browser/resources/settings/privacy_page/security_keys_subpage.js b/chromium/chrome/browser/resources/settings/privacy_page/security_keys_subpage.js
index b0eee4155a2..414f10740ec 100644
--- a/chromium/chrome/browser/resources/settings/privacy_page/security_keys_subpage.js
+++ b/chromium/chrome/browser/resources/settings/privacy_page/security_keys_subpage.js
@@ -21,6 +21,15 @@ Polymer({
},
/** @private */
+ enableBioEnrollment_: {
+ type: Boolean,
+ readOnly: true,
+ value: function() {
+ return loadTimeData.getBoolean('enableSecurityKeysBioEnrollment');
+ }
+ },
+
+ /** @private */
showSetPINDialog_: {
type: Boolean,
value: false,
@@ -35,6 +44,11 @@ Polymer({
type: Boolean,
value: false,
},
+ /** @private */
+ showBioEnrollDialog_: {
+ type: Boolean,
+ value: false,
+ },
},
/** @private */
@@ -56,7 +70,7 @@ Polymer({
/** @private */
onCredentialManagementDialogClosed_: function() {
this.showCredentialManagementDialog_ = false;
- cr.ui.focusWithoutInk(this.$.credentialManagementButton);
+ cr.ui.focusWithoutInk(assert(this.$$('#credentialManagementButton')));
},
/** @private */
@@ -69,4 +83,15 @@ Polymer({
this.showResetDialog_ = false;
cr.ui.focusWithoutInk(this.$.resetButton);
},
+
+ /** @private */
+ onBioEnroll_: function() {
+ this.showBioEnrollDialog_ = true;
+ },
+
+ /** @private */
+ onBioEnrollDialogClosed_: function() {
+ this.showBioEnrollDialog_ = false;
+ cr.ui.focusWithoutInk(assert(this.$$('#bioEnrollButton')));
+ },
});
diff --git a/chromium/chrome/browser/resources/settings/route.js b/chromium/chrome/browser/resources/settings/route.js
index 808fc7775c4..244cb3be580 100644
--- a/chromium/chrome/browser/resources/settings/route.js
+++ b/chromium/chrome/browser/resources/settings/route.js
@@ -101,6 +101,7 @@
* SITE_SETTINGS_LOCATION: (undefined|!settings.Route),
* SITE_SETTINGS_MICROPHONE: (undefined|!settings.Route),
* SITE_SETTINGS_MIDI_DEVICES: (undefined|!settings.Route),
+ * SITE_SETTINGS_NATIVE_FILE_SYSTEM_WRITE: (undefined|!settings.Route),
* SITE_SETTINGS_NOTIFICATIONS: (undefined|!settings.Route),
* SITE_SETTINGS_PAYMENT_HANDLER: (undefined|!settings.Route),
* SITE_SETTINGS_PDF_DOCUMENTS: (undefined|!settings.Route),
@@ -224,12 +225,10 @@ cr.define('settings', function() {
}
/**
- * Computes and return all available routes based on settings.pageVisibility.
- * @return {!SettingsRoutes}
+ * @return {!SettingsRoutes} Routes that are shared between browser and OS
+ * settings under the same conditions (e.g. in guest mode).
*/
- const computeAvailableRoutes = function() {
- const pageVisibility = settings.pageVisibility || {};
-
+ function computeCommonRoutes() {
/** @type {!SettingsRoutes} */
const r = {};
@@ -237,27 +236,33 @@ cr.define('settings', function() {
r.BASIC = new Route('/');
r.ABOUT = new Route('/help');
- // Navigable dialogs. These are the only non-section children of root
- // pages. These are disfavored. If we add anymore, we should add explicit
- // support.
- r.IMPORT_DATA = r.BASIC.createChild('/importData');
- r.IMPORT_DATA.isNavigableDialog = true;
r.SIGN_OUT = r.BASIC.createChild('/signOut');
r.SIGN_OUT.isNavigableDialog = true;
- // <if expr="chromeos">
- r.INTERNET = r.BASIC.createSection('/internet', 'internet');
- r.INTERNET_NETWORKS = r.INTERNET.createChild('/networks');
- r.NETWORK_DETAIL = r.INTERNET.createChild('/networkDetail');
- r.KNOWN_NETWORKS = r.INTERNET.createChild('/knownNetworks');
- r.BLUETOOTH = r.BASIC.createSection('/bluetooth', 'bluetooth');
- r.BLUETOOTH_DEVICES = r.BLUETOOTH.createChild('/bluetoothDevices');
+ r.SEARCH = r.BASIC.createSection('/search', 'search');
+ if (!loadTimeData.getBoolean('isGuest')) {
+ r.PEOPLE = r.BASIC.createSection('/people', 'people');
+ r.SYNC = r.PEOPLE.createChild('/syncSetup');
+ r.SYNC_ADVANCED = r.SYNC.createChild('/syncSetup/advanced');
+ }
+
+ return r;
+ }
- r.MULTIDEVICE = r.BASIC.createSection('/multidevice', 'multidevice');
- r.MULTIDEVICE_FEATURES = r.MULTIDEVICE.createChild('/multidevice/features');
- r.SMART_LOCK =
- r.MULTIDEVICE_FEATURES.createChild('/multidevice/features/smartLock');
+ /**
+ * Adds Route objects for each path corresponding to browser-only content.
+ * @param {!SettingsRoutes} r Routes to include browser-only content.
+ */
+ function addBrowserSettingsRoutes(r) {
+ const pageVisibility = settings.pageVisibility || {};
+
+ // <if expr="not chromeos">
+ r.IMPORT_DATA = r.BASIC.createChild('/importData');
+ r.IMPORT_DATA.isNavigableDialog = true;
+ if (pageVisibility.people !== false) {
+ r.MANAGE_PROFILE = r.PEOPLE.createChild('/manageProfile');
+ }
// </if>
if (pageVisibility.appearance !== false) {
@@ -277,84 +282,13 @@ cr.define('settings', function() {
r.BASIC.createSection('/defaultBrowser', 'defaultBrowser');
}
- r.SEARCH = r.BASIC.createSection('/search', 'search');
r.SEARCH_ENGINES = r.SEARCH.createChild('/searchEngines');
- // <if expr="chromeos">
- if (loadTimeData.valueExists('assistantEnabled') &&
- loadTimeData.getBoolean('assistantEnabled')) {
- r.GOOGLE_ASSISTANT = r.SEARCH.createChild('/googleAssistant');
- }
-
- if (loadTimeData.valueExists('showApps') &&
- loadTimeData.getBoolean('showApps')) {
- r.APPS = r.BASIC.createSection('/apps', 'apps');
- }
-
- r.ANDROID_APPS = r.BASIC.createSection('/androidApps', 'androidApps');
- r.ANDROID_APPS_DETAILS = r.ANDROID_APPS.createChild('/androidApps/details');
-
- if (loadTimeData.valueExists('showCrostini') &&
- loadTimeData.getBoolean('showCrostini')) {
- r.CROSTINI = r.BASIC.createSection('/crostini', 'crostini');
- r.CROSTINI_DETAILS = r.CROSTINI.createChild('/crostini/details');
- r.CROSTINI_EXPORT_IMPORT =
- r.CROSTINI_DETAILS.createChild('/crostini/exportImport');
- r.CROSTINI_SHARED_PATHS =
- r.CROSTINI_DETAILS.createChild('/crostini/sharedPaths');
- r.CROSTINI_SHARED_USB_DEVICES =
- r.CROSTINI_DETAILS.createChild('/crostini/sharedUsbDevices');
- }
-
- if (loadTimeData.valueExists('showPluginVm') &&
- loadTimeData.getBoolean('showPluginVm')) {
- r.PLUGIN_VM = r.BASIC.createSection('/pluginVm', 'pluginVm');
- r.PLUGIN_VM_DETAILS = r.PLUGIN_VM.createChild('/pluginVm/details');
- r.PLUGIN_VM_SHARED_PATHS =
- r.PLUGIN_VM.createChild('/pluginVm/sharedPaths');
- }
- // </if>
if (pageVisibility.onStartup !== false) {
r.ON_STARTUP = r.BASIC.createSection('/onStartup', 'onStartup');
r.STARTUP_PAGES = r.ON_STARTUP.createChild('/startupPages');
}
- if (pageVisibility.people !== false) {
- r.PEOPLE = r.BASIC.createSection('/people', 'people');
- r.SYNC = r.PEOPLE.createChild('/syncSetup');
- r.SYNC_ADVANCED = r.SYNC.createChild('/syncSetup/advanced');
- // <if expr="not chromeos">
- r.MANAGE_PROFILE = r.PEOPLE.createChild('/manageProfile');
- // </if>
- // <if expr="chromeos">
- // TODO(crbug.com/950007): Remove when SplitSettings is the default.
- if (loadTimeData.getBoolean('isOSSettings')) {
- r.PERSONALIZATION =
- r.BASIC.createSection('/personalization', 'personalization');
- r.CHANGE_PICTURE = r.PERSONALIZATION.createChild('/changePicture');
- } else {
- r.CHANGE_PICTURE = r.PEOPLE.createChild('/changePicture');
- }
- r.ACCOUNTS = r.PEOPLE.createChild('/accounts');
- r.ACCOUNT_MANAGER = r.PEOPLE.createChild('/accountManager');
- r.KERBEROS_ACCOUNTS = r.PEOPLE.createChild('/kerberosAccounts');
- r.LOCK_SCREEN = r.PEOPLE.createChild('/lockScreen');
- r.FINGERPRINT = r.LOCK_SCREEN.createChild('/lockScreen/fingerprint');
- // </if>
- }
-
- // <if expr="chromeos">
- r.DEVICE = r.BASIC.createSection('/device', 'device');
- r.POINTERS = r.DEVICE.createChild('/pointer-overlay');
- r.KEYBOARD = r.DEVICE.createChild('/keyboard-overlay');
- r.STYLUS = r.DEVICE.createChild('/stylus');
- r.DISPLAY = r.DEVICE.createChild('/display');
- r.STORAGE = r.DEVICE.createChild('/storage');
- r.EXTERNAL_STORAGE_PREFERENCES =
- r.DEVICE.createChild('/storage/externalStoragePreferences');
- r.POWER = r.DEVICE.createChild('/power');
- // </if>
-
// Advanced Routes
if (pageVisibility.advancedSettings !== false) {
r.ADVANCED = new Route('/advanced');
@@ -422,48 +356,23 @@ cr.define('settings', function() {
r.SITE_SETTINGS_BLUETOOTH_SCANNING =
r.SITE_SETTINGS.createChild('bluetoothScanning');
}
-
- // <if expr="chromeos">
- if (pageVisibility.dateTime !== false) {
- r.DATETIME = r.ADVANCED.createSection('/dateTime', 'dateTime');
- r.DATETIME_TIMEZONE_SUBPAGE =
- r.DATETIME.createChild('/dateTime/timeZone');
+ if (loadTimeData.getBoolean(
+ 'enableNativeFileSystemWriteContentSetting')) {
+ r.SITE_SETTINGS_NATIVE_FILE_SYSTEM_WRITE =
+ r.SITE_SETTINGS.createChild('filesystem');
}
- // </if>
r.LANGUAGES = r.ADVANCED.createSection('/languages', 'languages');
- // <if expr="chromeos">
- if (loadTimeData.getBoolean('isOSSettings')) {
- r.LANGUAGES_DETAILS = r.LANGUAGES.createChild('/languages/details');
- r.INPUT_METHODS =
- r.LANGUAGES_DETAILS.createChild('/languages/inputMethods');
- } else {
- r.INPUT_METHODS = r.LANGUAGES.createChild('/inputMethods');
- }
- // </if>
// <if expr="not is_macosx">
r.EDIT_DICTIONARY = r.LANGUAGES.createChild('/editDictionary');
// </if>
if (pageVisibility.downloads !== false) {
r.DOWNLOADS = r.ADVANCED.createSection('/downloads', 'downloads');
- // <if expr="chromeos">
- // TODO(crbug.com/950007): Make unconditional and remove 'else' block
- // when SplitSettings is the default.
- if (loadTimeData.getBoolean('isOSSettings')) {
- r.FILES = r.ADVANCED.createSection('/files', 'files');
- r.SMB_SHARES = r.FILES.createChild('/smbShares');
- } else {
- r.SMB_SHARES = r.DOWNLOADS.createChild('/smbShares');
- }
- // </if>
}
r.PRINTING = r.ADVANCED.createSection('/printing', 'printing');
r.CLOUD_PRINTERS = r.PRINTING.createChild('/cloudPrinters');
- // <if expr="chromeos">
- r.CUPS_PRINTERS = r.PRINTING.createChild('/cupsPrinters');
- // </if>
r.ACCESSIBILITY = r.ADVANCED.createSection('/accessibility', 'a11y');
@@ -480,19 +389,9 @@ cr.define('settings', function() {
}
// </if>
- // <if expr="chromeos">
- r.MANAGE_ACCESSIBILITY =
- r.ACCESSIBILITY.createChild('/manageAccessibility');
- if (loadTimeData.getBoolean(
- 'showExperimentalAccessibilitySwitchAccess')) {
- r.MANAGE_SWITCH_ACCESS_SETTINGS = r.MANAGE_ACCESSIBILITY.createChild(
- '/manageAccessibility/switchAccess');
- }
- r.MANAGE_TTS_SETTINGS =
- r.MANAGE_ACCESSIBILITY.createChild('/manageAccessibility/tts');
- // </if>
-
+ // <if expr="not chromeos">
r.SYSTEM = r.ADVANCED.createSection('/system', 'system');
+ // </if>
if (pageVisibility.reset !== false) {
r.RESET = r.ADVANCED.createSection('/reset', 'reset');
@@ -510,28 +409,182 @@ cr.define('settings', function() {
// </if>
}
}
+ }
+
+ // <if expr="chromeos">
+ /**
+ * Adds Route objects for each path corresponding to CrOS-only content.
+ * @param {!SettingsRoutes} r Routes to include CrOS-only content.
+ */
+ function addOSSettingsRoutes(r) {
+ r.INTERNET = r.BASIC.createSection('/internet', 'internet');
+ r.INTERNET_NETWORKS = r.INTERNET.createChild('/networks');
+ r.NETWORK_DETAIL = r.INTERNET.createChild('/networkDetail');
+ r.KNOWN_NETWORKS = r.INTERNET.createChild('/knownNetworks');
+ r.BLUETOOTH = r.BASIC.createSection('/bluetooth', 'bluetooth');
+ r.BLUETOOTH_DEVICES = r.BLUETOOTH.createChild('/bluetoothDevices');
+
+ r.DEVICE = r.BASIC.createSection('/device', 'device');
+ r.POINTERS = r.DEVICE.createChild('/pointer-overlay');
+ r.KEYBOARD = r.DEVICE.createChild('/keyboard-overlay');
+ r.STYLUS = r.DEVICE.createChild('/stylus');
+ r.DISPLAY = r.DEVICE.createChild('/display');
+ r.STORAGE = r.DEVICE.createChild('/storage');
+ r.EXTERNAL_STORAGE_PREFERENCES =
+ r.DEVICE.createChild('/storage/externalStoragePreferences');
+ r.POWER = r.DEVICE.createChild('/power');
- // <if expr="chromeos">
// "About" is the only section in About, but we still need to create the
// route in order to show the subpage on Chrome OS.
r.ABOUT_ABOUT = r.ABOUT.createSection('/help/about', 'about');
- // TODO(aee): Remove once this file is forked.
- if (loadTimeData.getBoolean('showOSSettings')) {
- r.DETAILED_BUILD_INFO = r.ABOUT_ABOUT.createChild('/help/details');
+ r.DETAILED_BUILD_INFO = r.ABOUT_ABOUT.createChild('/help/details');
+
+ if (!loadTimeData.getBoolean('isGuest')) {
+ r.MULTIDEVICE = r.BASIC.createSection('/multidevice', 'multidevice');
+ r.MULTIDEVICE_FEATURES =
+ r.MULTIDEVICE.createChild('/multidevice/features');
+ r.SMART_LOCK =
+ r.MULTIDEVICE_FEATURES.createChild('/multidevice/features/smartLock');
+
+ r.ACCOUNTS = r.PEOPLE.createChild('/accounts');
+ r.ACCOUNT_MANAGER = r.PEOPLE.createChild('/accountManager');
+ r.KERBEROS_ACCOUNTS = r.PEOPLE.createChild('/kerberosAccounts');
+ r.LOCK_SCREEN = r.PEOPLE.createChild('/lockScreen');
+ r.FINGERPRINT = r.LOCK_SCREEN.createChild('/lockScreen/fingerprint');
}
- // </if>
- return r;
- };
+ if (loadTimeData.valueExists('androidAppsVisible') &&
+ loadTimeData.getBoolean('androidAppsVisible')) {
+ r.ANDROID_APPS = r.BASIC.createSection('/androidApps', 'androidApps');
+ r.ANDROID_APPS_DETAILS =
+ r.ANDROID_APPS.createChild('/androidApps/details');
+ }
+
+ if (loadTimeData.valueExists('showCrostini') &&
+ loadTimeData.getBoolean('showCrostini')) {
+ r.CROSTINI = r.BASIC.createSection('/crostini', 'crostini');
+ r.CROSTINI_DETAILS = r.CROSTINI.createChild('/crostini/details');
+ if (loadTimeData.valueExists('showCrostiniExportImport') &&
+ loadTimeData.getBoolean('showCrostiniExportImport')) {
+ r.CROSTINI_EXPORT_IMPORT =
+ r.CROSTINI_DETAILS.createChild('/crostini/exportImport');
+ }
+ r.CROSTINI_SHARED_PATHS =
+ r.CROSTINI_DETAILS.createChild('/crostini/sharedPaths');
+ r.CROSTINI_SHARED_USB_DEVICES =
+ r.CROSTINI_DETAILS.createChild('/crostini/sharedUsbDevices');
+ }
+
+ if (loadTimeData.valueExists('showPluginVm') &&
+ loadTimeData.getBoolean('showPluginVm')) {
+ r.PLUGIN_VM = r.BASIC.createSection('/pluginVm', 'pluginVm');
+ r.PLUGIN_VM_DETAILS = r.PLUGIN_VM.createChild('/pluginVm/details');
+ r.PLUGIN_VM_SHARED_PATHS =
+ r.PLUGIN_VM.createChild('/pluginVm/sharedPaths');
+ }
+
+ r.GOOGLE_ASSISTANT = r.SEARCH.createChild('/googleAssistant');
+
+ // This if/else accounts for sections that were added or refactored in
+ // the settings split (crbug.com/950007) and some routes that were created
+ // in browser settings conditioned on the pageVisibility constant, which is
+ // being decoupled from OS Settings in the split. The 'else' block provides
+ // a section-by-section comparison.
+ // TODO (crbug.com/967861): Make 'if' block unconditional. Remove 'else'
+ // block.
+ if (loadTimeData.getBoolean('isOSSettings')) {
+ r.ADVANCED = new Route('/advanced');
+
+ r.PRIVACY = r.ADVANCED.createSection('/privacy', 'privacy');
+
+ // Languages and input
+ r.LANGUAGES = r.ADVANCED.createSection('/languages', 'languages');
+ r.LANGUAGES_DETAILS = r.LANGUAGES.createChild('/languages/details');
+ r.INPUT_METHODS =
+ r.LANGUAGES_DETAILS.createChild('/languages/inputMethods');
+
+ r.PRINTING = r.ADVANCED.createSection('/printing', 'printing');
+
+ r.ACCESSIBILITY = r.ADVANCED.createSection('/accessibility', 'a11y');
+
+ if (!loadTimeData.getBoolean('isGuest')) {
+ // Personalization
+ r.PERSONALIZATION =
+ r.BASIC.createSection('/personalization', 'personalization');
+ r.CHANGE_PICTURE = r.PERSONALIZATION.createChild('/changePicture');
+
+ // Files (analogous to Downloads)
+ r.FILES = r.ADVANCED.createSection('/files', 'files');
+ r.SMB_SHARES = r.FILES.createChild('/smbShares');
+ }
+
+ // Reset
+ if (loadTimeData.valueExists('allowPowerwash') &&
+ loadTimeData.getBoolean('allowPowerwash')) {
+ r.RESET = r.ADVANCED.createSection('/reset', 'reset');
+ }
+
+ // Apps
+ if (loadTimeData.valueExists('showApps') &&
+ loadTimeData.getBoolean('showApps')) {
+ r.APPS = r.BASIC.createSection('/apps', 'apps');
+ r.APP_MANAGEMENT = r.APPS.createChild('/app-management');
+ r.APP_MANAGEMENT_DETAIL =
+ r.APP_MANAGEMENT.createChild('/app-management/detail');
+ }
+ } else {
+ assert(r.ADVANCED, 'ADVANCED route should exist');
+
+ assert(r.PRIVACY, 'PRIVACY route should exist');
+
+ // Languages and input
+ assert(r.LANGUAGES, 'LANGUAGES route should exist');
+ r.INPUT_METHODS = r.LANGUAGES.createChild('/inputMethods');
+
+ assert(r.PRINTING, 'PRINTING route should exist');
+
+ assert(r.ACCESSIBILITY, 'ACCESSIBILITY route should exist');
+
+ if (!loadTimeData.getBoolean('isGuest')) {
+ // People
+ r.CHANGE_PICTURE = r.PEOPLE.createChild('/changePicture');
+
+ // Downloads (analogous to Files)
+ assert(r.DOWNLOADS, 'DOWNLOADS route should exist');
+ r.SMB_SHARES = r.DOWNLOADS.createChild('/smbShares');
+
+ // Reset
+ assert(r.RESET, 'RESET route should exist');
+ }
+
+ assert(!r.APPS, 'APPS route should not exist');
+ }
+
+ r.DATETIME = r.ADVANCED.createSection('/dateTime', 'dateTime');
+ r.DATETIME_TIMEZONE_SUBPAGE = r.DATETIME.createChild('/dateTime/timeZone');
+
+ r.CUPS_PRINTERS = r.PRINTING.createChild('/cupsPrinters');
+
+ r.MANAGE_ACCESSIBILITY =
+ r.ACCESSIBILITY.createChild('/manageAccessibility');
+ if (loadTimeData.getBoolean('showExperimentalAccessibilitySwitchAccess')) {
+ r.MANAGE_SWITCH_ACCESS_SETTINGS = r.MANAGE_ACCESSIBILITY.createChild(
+ '/manageAccessibility/switchAccess');
+ }
+ r.MANAGE_TTS_SETTINGS =
+ r.MANAGE_ACCESSIBILITY.createChild('/manageAccessibility/tts');
+ }
+ // </if>
class Router {
- constructor() {
+ /** @param {!SettingsRoutes} availableRoutes */
+ constructor(availableRoutes) {
/**
* List of available routes. This is populated taking into account current
* state (like guest mode).
* @private {!SettingsRoutes}
*/
- this.routes_ = computeAvailableRoutes();
+ this.routes_ = availableRoutes;
/**
* The current active route. This updated is only by settings.navigateTo
@@ -710,7 +763,31 @@ cr.define('settings', function() {
}
}
- const routerInstance = new Router();
+ /**
+ * @return {!settings.Router} A router with at least those routes common to OS
+ * and browser settings. If the window is not in OS settings (based on
+ * loadTimeData) then browser specific routes are added. If the window is
+ * OS settings or if Chrome OS is using a consolidated settings page for
+ * OS and browser settings then OS specific routes are added.
+ */
+ function buildRouter() {
+ const availableRoutes = computeCommonRoutes();
+ const isOSSettings = loadTimeData.valueExists('isOSSettings') &&
+ loadTimeData.getBoolean('isOSSettings');
+ if (!isOSSettings) {
+ addBrowserSettingsRoutes(availableRoutes);
+ }
+
+ // <if expr="chromeos">
+ const showOSSettings = loadTimeData.valueExists('showOSSettings') &&
+ loadTimeData.getBoolean('showOSSettings');
+ if (isOSSettings || showOSSettings) {
+ addOSSettingsRoutes(availableRoutes);
+ }
+ // </if>
+ return new Router(availableRoutes);
+ }
+ const routerInstance = buildRouter();
const routeObservers = new Set();
@@ -780,6 +857,7 @@ cr.define('settings', function() {
Route: Route, // The Route class definition.
Router: Router, // The Router class definition.
router: routerInstance, // the singleton.
+ buildRouterForTesting: buildRouter,
routes: routes,
RouteObserverBehavior: RouteObserverBehavior,
getRouteForPath: getRouteForPath,
diff --git a/chromium/chrome/browser/resources/settings/search_engines_page/omnibox_extension_entry.html b/chromium/chrome/browser/resources/settings/search_engines_page/omnibox_extension_entry.html
index 43fcdba764a..fac0773366c 100644
--- a/chromium/chrome/browser/resources/settings/search_engines_page/omnibox_extension_entry.html
+++ b/chromium/chrome/browser/resources/settings/search_engines_page/omnibox_extension_entry.html
@@ -25,7 +25,7 @@
</style>
<div class="list-item" focus-row-container>
<div class="name-column">
- <site-favicon url="[[engine.iconURL]]"></site-favicon>
+ <site-favicon favicon-url="[[engine.iconURL]]"></site-favicon>
<span>[[engine.displayName]]</span>
</div>
<div class="keyword-column">[[engine.keyword]]</div>
diff --git a/chromium/chrome/browser/resources/settings/search_engines_page/search_engine_entry.html b/chromium/chrome/browser/resources/settings/search_engines_page/search_engine_entry.html
index 9715c76b469..83d8b346ed4 100644
--- a/chromium/chrome/browser/resources/settings/search_engines_page/search_engine_entry.html
+++ b/chromium/chrome/browser/resources/settings/search_engines_page/search_engine_entry.html
@@ -41,7 +41,7 @@
<div class="list-item" focus-row-container>
<div id="name-column">
- <site-favicon url="[[engine.iconURL]]"></site-favicon>
+ <site-favicon favicon-url="[[engine.iconURL]]"></site-favicon>
<div>[[engine.displayName]]</div>
</div>
<div id="keyword-column"><div>[[engine.keyword]]</div></div>
diff --git a/chromium/chrome/browser/resources/settings/search_settings.js b/chromium/chrome/browser/resources/settings/search_settings.js
index 98d79796f44..a98f501303f 100644
--- a/chromium/chrome/browser/resources/settings/search_settings.js
+++ b/chromium/chrome/browser/resources/settings/search_settings.js
@@ -153,7 +153,7 @@ cr.define('settings', function() {
parent = parent.nodeType == Node.DOCUMENT_FRAGMENT_NODE ?
parent.host :
parent.parentNode;
- if (parent.nodeName == 'SETTINGS-SUBPAGE') {
+ if (parent && parent.nodeName == 'SETTINGS-SUBPAGE') {
// TODO(dpapad): Cast to SettingsSubpageElement here.
associatedControl = assert(
parent.associatedControl,
diff --git a/chromium/chrome/browser/resources/settings/settings_main/settings_main.html b/chromium/chrome/browser/resources/settings/settings_main/settings_main.html
index d75f667d3c3..b005a754146 100644
--- a/chromium/chrome/browser/resources/settings/settings_main/settings_main.html
+++ b/chromium/chrome/browser/resources/settings/settings_main/settings_main.html
@@ -63,7 +63,6 @@
<template is="dom-if" if="[[showPages_.settings]]">
<settings-basic-page prefs="{{prefs}}"
page-visibility="[[pageVisibility]]"
- show-apps="[[showApps]]"
show-android-apps="[[showAndroidApps]]"
show-crostini="[[showCrostini]]"
show-parental-controls="[[showParentalControls]]"
diff --git a/chromium/chrome/browser/resources/settings/settings_menu/settings_menu.html b/chromium/chrome/browser/resources/settings/settings_menu/settings_menu.html
index 9369f5f5517..4dabc3f833b 100644
--- a/chromium/chrome/browser/resources/settings/settings_menu/settings_menu.html
+++ b/chromium/chrome/browser/resources/settings/settings_menu/settings_menu.html
@@ -10,6 +10,11 @@
<link rel="import" href="../route.html">
<link rel="import" href="../settings_shared_css.html">
+<if expr="chromeos">
+<!-- TODO(crbug.com/986596): Remove OS icons when SplitSettings is complete. -->
+<link rel="import" href="../chromeos/os_icons.html">
+</if>
+
<dom-module id="settings-menu">
<template>
<style include="settings-shared">
@@ -107,7 +112,7 @@
role="navigation" on-click="onLinkClick_">
<if expr="chromeos">
<a href="/internet" hidden="[[!pageVisibility.internet]]">
- <iron-icon icon="settings:network-wifi"></iron-icon>
+ <iron-icon icon="os-settings:network-wifi"></iron-icon>
$i18n{internetPageTitle}
</a>
<a href="/bluetooth" hidden="[[!pageVisibility.bluetooth]]">
@@ -116,7 +121,7 @@
</a>
<a id="multidevice" href="/multidevice"
hidden="[[!pageVisibility.multidevice]]">
- <iron-icon icon="settings:multidevice-better-together-suite">
+ <iron-icon icon="os-settings:multidevice-better-together-suite">
</iron-icon>
$i18n{multidevicePageTitle}
</a>
@@ -137,7 +142,7 @@
</a>
<if expr="chromeos">
<a href="/device" hidden="[[!pageVisibility.device]]">
- <iron-icon icon="settings:laptop-chromebook"></iron-icon>
+ <iron-icon icon="os-settings:laptop-chromebook"></iron-icon>
$i18n{devicePageTitle}
</a>
</if>
@@ -146,20 +151,16 @@
$i18n{searchPageTitle}
</a>
<if expr="chromeos">
- <a href="/apps" hidden="[[!showApps]]">
- <iron-icon icon="settings:apps"></iron-icon>
- $i18n{appsPageTitle}
- </a>
<a href="/androidApps" hidden="[[!showAndroidApps]]">
- <iron-icon icon="settings:play-prism"></iron-icon>
+ <iron-icon icon="os-settings:play-prism"></iron-icon>
$i18n{androidAppsPageTitle}
</a>
<a href="/crostini" hidden="[[!showCrostini]]">
- <iron-icon icon="settings:crostini-mascot"></iron-icon>
+ <iron-icon icon="os-settings:crostini-mascot"></iron-icon>
$i18n{crostiniPageTitle}
</a>
<a href="/pluginVm" hidden="[[!showPluginVm]]">
- <iron-icon icon="settings:plugin-vm"></iron-icon>
+ <iron-icon icon="os-settings:plugin-vm"></iron-icon>
$i18n{pluginVmPageTitle}
</a>
</if>
@@ -187,7 +188,7 @@
role="navigation" on-click="onLinkClick_">
<if expr="chromeos">
<a href="/dateTime" hidden="[[!pageVisibility.dateTime]]">
- <iron-icon icon="settings:access-time"></iron-icon>
+ <iron-icon icon="os-settings:access-time"></iron-icon>
$i18n{dateTimePageTitle}
</a>
</if>
diff --git a/chromium/chrome/browser/resources/settings/settings_page/settings_subpage.html b/chromium/chrome/browser/resources/settings/settings_page/settings_subpage.html
index 4989fb87e41..c48064bcaf2 100644
--- a/chromium/chrome/browser/resources/settings/settings_page/settings_subpage.html
+++ b/chromium/chrome/browser/resources/settings/settings_page/settings_subpage.html
@@ -45,6 +45,13 @@
width: var(--cr-icon-ripple-size);
}
+ #title-icon {
+ height: 36px;
+ margin-inline-end: 12px;
+ margin-inline-start: 2px;
+ width: 36px;
+ }
+
cr-icon-button {
/* Centers the ripple on the icon with appropriate margin on right. */
margin-inline-end: 10px;
@@ -67,6 +74,9 @@
<div class="settings-box first" id="headerLine">
<cr-icon-button class="icon-arrow-back" id="closeButton"
on-click="onTapBack_" aria-label="$i18n{back}"></cr-icon-button>
+ <template is="dom-if" if="[[titleIcon]]">
+ <img id="title-icon" src="[[titleIcon]]">
+ </template>
<h1 class="cr-title-text">[[pageTitle]]</h1>
<slot name="subpage-title-extra"></slot>
<template is="dom-if" if="[[learnMoreUrl]]">
diff --git a/chromium/chrome/browser/resources/settings/settings_page/settings_subpage.js b/chromium/chrome/browser/resources/settings/settings_page/settings_subpage.js
index b33ba416d65..bea0032426f 100644
--- a/chromium/chrome/browser/resources/settings/settings_page/settings_subpage.js
+++ b/chromium/chrome/browser/resources/settings/settings_page/settings_subpage.js
@@ -20,6 +20,8 @@ Polymer({
properties: {
pageTitle: String,
+ titleIcon: String,
+
learnMoreUrl: String,
/** Setting a |searchLabel| will enable search. */
diff --git a/chromium/chrome/browser/resources/settings/settings_resources.grd b/chromium/chrome/browser/resources/settings/settings_resources.grd
index f9f460935ef..14f631a9af7 100644
--- a/chromium/chrome/browser/resources/settings/settings_resources.grd
+++ b/chromium/chrome/browser/resources/settings/settings_resources.grd
@@ -151,6 +151,14 @@
file="appearance_page/appearance_browser_proxy.js"
type="chrome_html"
preprocess="true" />
+ <if expr="chromeos">
+ <structure name="IDR_SETTINGS_WALLPAPER_BROWSER_PROXY_HTML"
+ file="appearance_page/wallpaper_browser_proxy.html"
+ type="chrome_html" />
+ <structure name="IDR_SETTINGS_WALLPAPER_BROWSER_PROXY_JS"
+ file="appearance_page/wallpaper_browser_proxy.js"
+ type="chrome_html" />
+ </if>
<structure name="IDR_SETTINGS_APPEARANCE_FONTS_PAGE_HTML"
file="appearance_page/appearance_fonts_page.html"
type="chrome_html"
@@ -416,6 +424,12 @@
<structure name="IDR_SETTINGS_SECURITY_KEYS_RESET_DIALOG_JS"
file="privacy_page/security_keys_reset_dialog.js"
type="chrome_html"/>
+ <structure name="IDR_SETTINGS_SECURITY_KEYS_BIO_ENROLL_DIALOG_HTML"
+ file="privacy_page/security_keys_bio_enroll_dialog.html"
+ type="chrome_html" />
+ <structure name="IDR_SETTINGS_SECURITY_KEYS_BIO_ENROLL_DIALOG_JS"
+ file="privacy_page/security_keys_bio_enroll_dialog.js"
+ type="chrome_html" />
<structure name="IDR_SETTINGS_SECURITY_KEYS_DIALOG_BROWSER_PROXY_HTML"
file="privacy_page/security_keys_browser_proxy.html"
type="chrome_html" />
@@ -573,6 +587,12 @@
<structure name="IDR_SETTINGS_DEVICE_STORAGE_JS"
file="device_page/storage.js"
type="chrome_html" />
+ <structure name="IDR_SETTINGS_DEVICE_STORAGE_EXTERNAL_ENTRY_HTML"
+ file="device_page/storage_external_entry.html"
+ type="chrome_html" />
+ <structure name="IDR_SETTINGS_DEVICE_STORAGE_EXTERNAL_ENTRY_JS"
+ file="device_page/storage_external_entry.js"
+ type="chrome_html" />
<structure name="IDR_SETTINGS_DEVICE_STORAGE_EXTERNAL_HTML"
file="device_page/storage_external.html"
type="chrome_html" />
@@ -647,6 +667,14 @@
file="icons.html"
type="chrome_html"
preprocess="true" />
+ <if expr="chromeos">
+ <!-- TODO(crbug.com/986596): Remove OS icons when SplitSettings
+ is complete. -->
+ <structure name="IDR_SETTINGS_CHROMEOS_OS_ICONS"
+ file="chromeos/os_icons.html"
+ type="chrome_html"
+ preprocess="true" />
+ </if>
<structure name="IDR_SETTINGS_POWERWASH_DIALOG_HTML"
file="reset_page/powerwash_dialog.html"
type="chrome_html" />
@@ -1300,12 +1328,6 @@
file="site_settings/zoom_levels.js"
type="chrome_html" />
<if expr="chromeos">
- <structure name="IDR_SETTINGS_APP_MANAGEMENT_PAGE_HTML"
- file="app_management_page/app_management_page.html"
- type="chrome_html" />
- <structure name="IDR_SETTINGS_APP_MANAGEMENT_PAGE_JS"
- file="app_management_page/app_management_page.js"
- type="chrome_html" />
<structure name="IDR_SETTINGS_ANDROID_APPS_PAGE_HTML"
file="android_apps_page/android_apps_page.html"
type="chrome_html" />
diff --git a/chromium/chrome/browser/resources/settings/settings_shared_css.html b/chromium/chrome/browser/resources/settings/settings_shared_css.html
index bc22b45af3c..f91bdedd09b 100644
--- a/chromium/chrome/browser/resources/settings/settings_shared_css.html
+++ b/chromium/chrome/browser/resources/settings/settings_shared_css.html
@@ -186,6 +186,13 @@
min-height: inherit;
}
+ /* Link buttons use FocusOutlineManager to only show outlines when focus
+ * was triggered by keyboard. */
+ :host-context(html:not(.focus-outline-visible))
+ .list-button[is='action-link'] {
+ outline: none;
+ }
+
/* A row with two lines of text. Often the lower line will be .secondary.
*/
.two-line {
diff --git a/chromium/chrome/browser/resources/settings/settings_ui/settings_ui.html b/chromium/chrome/browser/resources/settings/settings_ui/settings_ui.html
index 9d42840497d..286257d15ea 100644
--- a/chromium/chrome/browser/resources/settings/settings_ui/settings_ui.html
+++ b/chromium/chrome/browser/resources/settings/settings_ui/settings_ui.html
@@ -43,7 +43,6 @@
cr-toolbar {
@apply --layout-center;
min-height: 56px;
- z-index: 2;
--cr-toolbar-left-spacer-width: var(--settings-menu-width);
--cr-toolbar-center-basis: var(--settings-main-basis);
}
@@ -126,7 +125,6 @@
<div class="drawer-content">
<template is="dom-if" id="drawerTemplate">
<settings-menu page-visibility="[[pageVisibility_]]"
- show-apps="[[showApps_]]"
show-android-apps="[[showAndroidApps_]]"
show-crostini="[[showCrostini_]]"
show-parental-controls="[[showParentalControls_]]"
@@ -141,7 +139,6 @@
<div id="container" class="no-outline">
<div id="left">
<settings-menu page-visibility="[[pageVisibility_]]"
- show-apps="[[showApps_]]"
show-android-apps="[[showAndroidApps_]]"
show-crostini="[[showCrostini_]]"
show-parental-controls="[[showParentalControls_]]"
diff --git a/chromium/chrome/browser/resources/settings/settings_ui/settings_ui.js b/chromium/chrome/browser/resources/settings/settings_ui/settings_ui.js
index f3868ee260e..fdbbef286d5 100644
--- a/chromium/chrome/browser/resources/settings/settings_ui/settings_ui.js
+++ b/chromium/chrome/browser/resources/settings/settings_ui/settings_ui.js
@@ -66,9 +66,6 @@ Polymer({
pageVisibility_: {type: Object, value: settings.pageVisibility},
/** @private */
- showApps_: Boolean,
-
- /** @private */
showAndroidApps_: Boolean,
/** @private */
@@ -147,7 +144,6 @@ Polymer({
OncTypeTether: loadTimeData.getString('OncTypeTether'),
OncTypeVPN: loadTimeData.getString('OncTypeVPN'),
OncTypeWiFi: loadTimeData.getString('OncTypeWiFi'),
- OncTypeWiMAX: loadTimeData.getString('OncTypeWiMAX'),
networkListItemConnected:
loadTimeData.getString('networkListItemConnected'),
networkListItemConnecting:
@@ -169,8 +165,6 @@ Polymer({
// The SplitSettings feature hides OS settings in the browser settings page.
// https://crbug.com/950007
const showOSSettings = loadTimeData.getBoolean('showOSSettings');
- this.showApps_ = showOSSettings && loadTimeData.valueExists('showApps') &&
- loadTimeData.getBoolean('showApps');
this.showAndroidApps_ = showOSSettings &&
loadTimeData.valueExists('androidAppsVisible') &&
loadTimeData.getBoolean('androidAppsVisible');
diff --git a/chromium/chrome/browser/resources/settings/site_favicon.html b/chromium/chrome/browser/resources/settings/site_favicon.html
index 7ff3ca780bd..0b99dc90c3e 100644
--- a/chromium/chrome/browser/resources/settings/site_favicon.html
+++ b/chromium/chrome/browser/resources/settings/site_favicon.html
@@ -5,7 +5,7 @@
<dom-module id="site-favicon">
<template>
<style>
- :host {
+ #favicon {
background-repeat: no-repeat;
background-size: contain;
display: block;
@@ -13,6 +13,10 @@
width: 16px;
}
</style>
+ <div
+ id="favicon"
+ style="background-image: [[getBackgroundImage_(faviconUrl, url)]]">
+ </div>
</template>
<script src="site_favicon.js"></script>
</dom-module>
diff --git a/chromium/chrome/browser/resources/settings/site_favicon.js b/chromium/chrome/browser/resources/settings/site_favicon.js
index 09f30efc673..e905bd54e35 100644
--- a/chromium/chrome/browser/resources/settings/site_favicon.js
+++ b/chromium/chrome/browser/resources/settings/site_favicon.js
@@ -11,18 +11,22 @@ Polymer({
is: 'site-favicon',
properties: {
- url: {
- type: String,
- value: '',
- observer: 'urlChanged_',
- }
+ faviconUrl: String,
+ url: String,
},
/** @private */
- urlChanged_: function() {
- let url = this.removePatternWildcard_(this.url);
- url = this.ensureUrlHasScheme_(url);
- this.style.backgroundImage = cr.icon.getFavicon(url || '', false);
+ getBackgroundImage_: function() {
+ let backgroundImage = 'none';
+ if (this.faviconUrl) {
+ const url = this.ensureUrlHasScheme_(this.faviconUrl);
+ backgroundImage = cr.icon.getFavicon(url);
+ } else if (this.url) {
+ let url = this.removePatternWildcard_(this.url);
+ url = this.ensureUrlHasScheme_(url);
+ backgroundImage = cr.icon.getFaviconForPageURL(url || '', false);
+ }
+ return backgroundImage;
},
/**
diff --git a/chromium/chrome/browser/resources/settings/site_settings/category_default_setting.js b/chromium/chrome/browser/resources/settings/site_settings/category_default_setting.js
index 12f8c830dbc..554bc6992dc 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/category_default_setting.js
+++ b/chromium/chrome/browser/resources/settings/site_settings/category_default_setting.js
@@ -126,6 +126,7 @@ Polymer({
case settings.ContentSettingsTypes.USB_DEVICES:
case settings.ContentSettingsTypes.SERIAL_PORTS:
case settings.ContentSettingsTypes.BLUETOOTH_SCANNING:
+ case settings.ContentSettingsTypes.NATIVE_FILE_SYSTEM_WRITE:
// "Ask" vs "Blocked".
this.browserProxy.setDefaultValueForContentType(
this.category,
diff --git a/chromium/chrome/browser/resources/settings/site_settings/category_setting_exceptions.html b/chromium/chrome/browser/resources/settings/site_settings/category_setting_exceptions.html
index 5164f1ceb8d..01d7cb15355 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/category_setting_exceptions.html
+++ b/chromium/chrome/browser/resources/settings/site_settings/category_setting_exceptions.html
@@ -10,7 +10,8 @@
category-subtype="[[ContentSetting.BLOCK]]"
category-header="[[blockHeader]]"
read-only-list="[[readOnlyList]]"
- search-filter="[[searchFilter]]">
+ search-filter="[[searchFilter]]"
+ hidden$="[[!showBlockSiteList_]]">
</site-list>
<site-list
category="[[category]]"
@@ -24,7 +25,8 @@
category-subtype="[[ContentSetting.ALLOW]]"
category-header="$i18n{siteSettingsAllow}"
read-only-list="[[readOnlyList]]"
- search-filter="[[searchFilter]]">
+ search-filter="[[searchFilter]]"
+ hidden$="[[!showAllowSiteList_]]">
</site-list>
</template>
<script src="category_setting_exceptions.js"></script>
diff --git a/chromium/chrome/browser/resources/settings/site_settings/category_setting_exceptions.js b/chromium/chrome/browser/resources/settings/site_settings/category_setting_exceptions.js
index bff5aae0f21..212204450a9 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/category_setting_exceptions.js
+++ b/chromium/chrome/browser/resources/settings/site_settings/category_setting_exceptions.js
@@ -11,6 +11,14 @@ Polymer({
is: 'category-setting-exceptions',
properties: {
+
+ /**
+ * The string ID of the category that this element is displaying data for.
+ * See site_settings/constants.js for possible values.
+ * @type {!settings.ContentSettingsTypes}
+ */
+ category: String,
+
/**
* Some content types (like Location) do not allow the user to manually
* edit the exception list from within Settings.
@@ -27,10 +35,38 @@ Polymer({
blockHeader: String,
searchFilter: String,
+
+ /**
+ * If true, displays the Allow site list. Defaults to true.
+ * @private
+ */
+ showAllowSiteList_: {
+ type: Boolean,
+ computed: 'computeShowAllowSiteList_(category)',
+ },
+
+ /**
+ * If true, displays the Block site list. Defaults to true.
+ */
+ showBlockSiteList_: {
+ type: Boolean,
+ value: true,
+ },
},
/** @override */
ready: function() {
this.ContentSetting = settings.ContentSetting;
},
+
+ /**
+ * Hides particular category subtypes if |this.category| does not support the
+ * content setting of that type.
+ * @return {boolean}
+ * @private
+ */
+ computeShowAllowSiteList_: function() {
+ return this.category !=
+ settings.ContentSettingsTypes.NATIVE_FILE_SYSTEM_WRITE;
+ },
});
diff --git a/chromium/chrome/browser/resources/settings/site_settings/constants.js b/chromium/chrome/browser/resources/settings/site_settings/constants.js
index 909b06ff3b4..a7cf78b84ad 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/constants.js
+++ b/chromium/chrome/browser/resources/settings/site_settings/constants.js
@@ -37,6 +37,7 @@ settings.ContentSettingsTypes = {
SENSORS: 'sensors',
PAYMENT_HANDLER: 'payment-handler',
BLUETOOTH_SCANNING: 'bluetooth-scanning',
+ NATIVE_FILE_SYSTEM_WRITE: 'native-file-system-write',
};
/**
diff --git a/chromium/chrome/browser/resources/settings/site_settings/cookie_info.js b/chromium/chrome/browser/resources/settings/site_settings/cookie_info.js
index d4aec05be80..91289e40b9e 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/cookie_info.js
+++ b/chromium/chrome/browser/resources/settings/site_settings/cookie_info.js
@@ -53,10 +53,6 @@ const cookieInfo = {
['origin', 'fileSystemOrigin'], ['persistent', 'fileSystemPersistentUsage'],
['temporary', 'fileSystemTemporaryUsage']
],
- 'channel_id': [
- ['serverId', 'channelIdServerId'], ['certType', 'channelIdType'],
- ['created', 'channelIdCreated']
- ],
'service_worker':
[['origin', 'serviceWorkerOrigin'], ['size', 'serviceWorkerSize']],
'shared_worker':
diff --git a/chromium/chrome/browser/resources/settings/site_settings/local_data_browser_proxy.js b/chromium/chrome/browser/resources/settings/site_settings/local_data_browser_proxy.js
index dee64f793b3..56112da2884 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/local_data_browser_proxy.js
+++ b/chromium/chrome/browser/resources/settings/site_settings/local_data_browser_proxy.js
@@ -97,6 +97,14 @@ cr.define('settings', function() {
* @param {string} path The path to the parent cookie.
*/
removeCookie(path) {}
+
+ /**
+ * Removes all SameSite=None cookies, as well as storage available in
+ * third-party contexts.
+ * Note: on-tree-item-removed will not be sent.
+ * @return {!Promise} To signal completion.
+ */
+ removeAllThirdPartyCookies() {}
}
/**
@@ -142,6 +150,11 @@ cr.define('settings', function() {
removeCookie(path) {
chrome.send('localData.removeCookie', [path]);
}
+
+ /** @override */
+ removeAllThirdPartyCookies() {
+ return cr.sendWithPromise('localData.removeThirdPartyCookies');
+ }
}
// The singleton instance_ is replaced with a test version of this wrapper
diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_data.html b/chromium/chrome/browser/resources/settings/site_settings/site_data.html
index b3c8d9bf131..9fc485db610 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/site_data.html
+++ b/chromium/chrome/browser/resources/settings/site_settings/site_data.html
@@ -42,6 +42,11 @@
on-click="onRemoveShowingSitesTap_" hidden$="[[!sites.length]]">
[[computeRemoveLabel_(filter)]]
</cr-button>
+ <cr-button disabled$="[[isLoading_]]" id="removeThirdPartyCookies"
+ on-click="onRemoveThirdPartyCookiesTap_"
+ hidden$="[[!enableRemovingAllThirdPartyCookies_]]">
+ $i18n{siteSettingsCookieRemoveAllThirdParty}
+ </cr-button>
</div>
<iron-list id="list" items="[[sites]]" preserve-focus
scroll-target="[[subpageScrollTarget]]" class="cr-separators">
@@ -71,6 +76,26 @@
</cr-button>
</div>
</cr-dialog>
+
+ <!-- Confirm Delete Third Party Cookies dialog -->
+ <cr-dialog id="confirmDeleteThirdPartyDialog" close-text="$i18n{close}"
+ on-close="onConfirmDeleteThirdPartyDialogClosed_">
+ <div slot="title">
+ $i18n{siteSettingsCookieRemoveThirdPartyDialogTitle}
+ </div>
+ <div slot="body">
+ $i18n{siteSettingsCookieRemoveThirdPartyConfirmation}
+ </div>
+ <div slot="button-container">
+ <cr-button class="cancel-button" on-click="onCloseThirdPartyDialog_">
+ $i18n{cancel}
+ </cr-button>
+ <cr-button class="action-button" on-click="onConfirmThirdPartyDelete_">
+ $i18n{siteSettingsCookiesClearThirdParty}
+ </cr-button>
+ </div>
+ </cr-dialog>
+
</template>
<script src="site_data.js"></script>
</dom-module>
diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_data.js b/chromium/chrome/browser/resources/settings/site_settings/site_data.js
index 06c8e742b30..644aedc4ac0 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/site_data.js
+++ b/chromium/chrome/browser/resources/settings/site_settings/site_data.js
@@ -75,6 +75,15 @@ Polymer({
/** @private */
listBlurred_: Boolean,
+
+ /** @private */
+ enableRemovingAllThirdPartyCookies_: {
+ type: Boolean,
+ value: function() {
+ return loadTimeData.getBoolean('enableRemovingAllThirdPartyCookies') &&
+ (this.sites.length > 0);
+ }
+ },
},
/** @private {settings.LocalDataBrowserProxy} */
@@ -201,10 +210,20 @@ Polymer({
},
/** @private */
+ onCloseThirdPartyDialog_: function() {
+ this.$.confirmDeleteThirdPartyDialog.close();
+ },
+
+ /** @private */
onConfirmDeleteDialogClosed_: function() {
cr.ui.focusWithoutInk(assert(this.$.removeShowingSites));
},
+ /** @private */
+ onConfirmDeleteThirdPartyDialogClosed_: function() {
+ cr.ui.focusWithoutInk(assert(this.$.removeAllThirdPartyCookies));
+ },
+
/**
* Shows a dialog to confirm the deletion of multiple sites.
* @param {!Event} e
@@ -216,6 +235,16 @@ Polymer({
},
/**
+ * Shows a dialog to confirm the deletion of cookies available
+ * in third-party contexts and associated site data.
+ * @private
+ */
+ onRemoveThirdPartyCookiesTap_: function(e) {
+ e.preventDefault();
+ this.$.confirmDeleteThirdPartyDialog.showModal();
+ },
+
+ /**
* Called when deletion for all showing sites has been confirmed.
* @private
*/
@@ -233,6 +262,18 @@ Polymer({
},
/**
+ * Called when deletion of all third-party cookies and site data has been
+ * confirmed.
+ * @private
+ */
+ onConfirmThirdPartyDelete_: function() {
+ this.$.confirmDeleteThirdPartyDialog.close();
+ this.browserProxy_.removeAllThirdPartyCookies().then(() => {
+ this.updateSiteList_();
+ });
+ },
+
+ /**
* @param {!{model: !{item: CookieDataSummaryItem, index: number}}} event
* @private
*/
diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_data_details_subpage.js b/chromium/chrome/browser/resources/settings/site_settings/site_data_details_subpage.js
index f862bba40e6..37ca12214f4 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/site_data_details_subpage.js
+++ b/chromium/chrome/browser/resources/settings/site_settings/site_data_details_subpage.js
@@ -8,7 +8,6 @@
const categoryLabels = {
app_cache: loadTimeData.getString('cookieAppCache'),
cache_storage: loadTimeData.getString('cookieCacheStorage'),
- channel_id: loadTimeData.getString('cookieChannelId'),
database: loadTimeData.getString('cookieDatabaseStorage'),
file_system: loadTimeData.getString('cookieFileSystem'),
flash_lso: loadTimeData.getString('cookieFlashLso'),
diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_details.html b/chromium/chrome/browser/resources/settings/site_settings/site_details.html
index 5b373ff071c..1472652cc9e 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/site_details.html
+++ b/chromium/chrome/browser/resources/settings/site_settings/site_details.html
@@ -178,6 +178,13 @@
label="$i18n{siteSettingsSerialPorts}">
</site-details-permission>
</template>
+ <template is="dom-if" if="[[enableNativeFileSystemWriteContentSetting_]]">
+ <site-details-permission
+ category="{{ContentSettingsTypes.NATIVE_FILE_SYSTEM_WRITE}}"
+ icon="settings:save-original" id="nativeFileSystemWrite"
+ label="$i18n{siteSettingsNativeFileSystemWrite}">
+ </site-details-permission>
+ </template>
<site-details-permission
category="{{ContentSettingsTypes.UNSANDBOXED_PLUGINS}}"
icon="cr:extension" id="unsandboxedPlugins"
diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_details.js b/chromium/chrome/browser/resources/settings/site_settings/site_details.js
index da034ee588f..875533a5f19 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/site_details.js
+++ b/chromium/chrome/browser/resources/settings/site_settings/site_details.js
@@ -69,6 +69,15 @@ Polymer({
return loadTimeData.getBoolean('enableBluetoothScanningContentSetting');
}
},
+
+ /** @private */
+ enableNativeFileSystemWriteContentSetting_: {
+ type: Boolean,
+ value: function() {
+ return loadTimeData.getBoolean(
+ 'enableNativeFileSystemWriteContentSetting');
+ }
+ },
},
listeners: {
diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_details_permission.js b/chromium/chrome/browser/resources/settings/site_settings/site_details_permission.js
index 88b55c9ce59..76f870645d2 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/site_details_permission.js
+++ b/chromium/chrome/browser/resources/settings/site_settings/site_details_permission.js
@@ -230,7 +230,8 @@ Polymer({
return !(
category == settings.ContentSettingsTypes.SERIAL_PORTS ||
category == settings.ContentSettingsTypes.USB_DEVICES ||
- category == settings.ContentSettingsTypes.BLUETOOTH_SCANNING);
+ category == settings.ContentSettingsTypes.BLUETOOTH_SCANNING ||
+ category == settings.ContentSettingsTypes.NATIVE_FILE_SYSTEM_WRITE);
},
/**
@@ -248,8 +249,10 @@ Polymer({
return true;
}
- // For Bluetooth scanning permission 'ask' takes the place of 'allow'.
- if (category == settings.ContentSettingsTypes.BLUETOOTH_SCANNING) {
+ // For Bluetooth scanning permission and Native File System write permission
+ // 'ask' takes the place of 'allow'.
+ if (category == settings.ContentSettingsTypes.BLUETOOTH_SCANNING ||
+ category == settings.ContentSettingsTypes.NATIVE_FILE_SYSTEM_WRITE) {
return true;
}
diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_list.html b/chromium/chrome/browser/resources/settings/site_settings/site_list.html
index a07b8c00068..de095c0574e 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/site_list.html
+++ b/chromium/chrome/browser/resources/settings/site_settings/site_list.html
@@ -33,7 +33,7 @@
<div class="settings-box first">
<h2 class="start">[[categoryHeader]]</h2>
<cr-button id="addSite" class="header-aligned-button"
- hidden="[[readOnlyList]]" on-click="onAddSiteTap_">
+ hidden$="[[!showAddSiteButton_]]" on-click="onAddSiteTap_">
$i18n{add}
</cr-button>
</div>
diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_list.js b/chromium/chrome/browser/resources/settings/site_settings/site_list.js
index 5e9cbba9943..bdc541bd8a9 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/site_list.js
+++ b/chromium/chrome/browser/resources/settings/site_settings/site_list.js
@@ -65,6 +65,16 @@ Polymer({
/** @private */
hasIncognito_: Boolean,
+ /**
+ * Whether to show the Add button next to the header.
+ * @private
+ */
+ showAddSiteButton_: {
+ type: Boolean,
+ computed: 'computeShowAddSiteButton_(readOnlyList, category, ' +
+ 'categorySubtype)',
+ },
+
/** @private */
showAddSiteDialog_: Boolean,
@@ -222,6 +232,20 @@ Polymer({
},
/**
+ * Whether the Add Site button is shown in the header for the current category
+ * and category subtype.
+ * @return {boolean}
+ * @private
+ */
+ computeShowAddSiteButton_: function() {
+ return !(
+ this.readOnlyList ||
+ (this.category ==
+ settings.ContentSettingsTypes.NATIVE_FILE_SYSTEM_WRITE &&
+ this.categorySubtype == settings.ContentSetting.ALLOW));
+ },
+
+ /**
* @return {boolean}
* @private
*/
diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_settings_behavior.js b/chromium/chrome/browser/resources/settings/site_settings/site_settings_behavior.js
index 9b3234d09ff..af45a352e33 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/site_settings_behavior.js
+++ b/chromium/chrome/browser/resources/settings/site_settings/site_settings_behavior.js
@@ -193,8 +193,6 @@ const SiteSettingsBehaviorImpl = {
};
// These categories are gated behind flags.
addOrRemoveSettingWithFlag(
- settings.ContentSettingsTypes.SENSORS, 'enableSensorsContentSetting');
- addOrRemoveSettingWithFlag(
settings.ContentSettingsTypes.SERIAL_PORTS,
'enableExperimentalWebPlatformFeatures');
addOrRemoveSettingWithFlag(
@@ -206,6 +204,9 @@ const SiteSettingsBehaviorImpl = {
addOrRemoveSettingWithFlag(
settings.ContentSettingsTypes.BLUETOOTH_SCANNING,
'enableBluetoothScanningContentSetting');
+ addOrRemoveSettingWithFlag(
+ settings.ContentSettingsTypes.NATIVE_FILE_SYSTEM_WRITE,
+ 'enableNativeFileSystemWriteContentSetting');
return this.contentTypes_.slice(0);
},
diff --git a/chromium/chrome/browser/resources/settings/site_settings_page/site_settings_page.html b/chromium/chrome/browser/resources/settings/site_settings_page/site_settings_page.html
index f2b5e48bdc7..a2adc7f829b 100644
--- a/chromium/chrome/browser/resources/settings/site_settings_page/site_settings_page.html
+++ b/chromium/chrome/browser/resources/settings/site_settings_page/site_settings_page.html
@@ -66,15 +66,13 @@
'$i18nPolymer{siteSettingsAskBeforeAccessing}',
'$i18nPolymer{siteSettingsBlocked}')]]"></cr-link-row>
- <template is="dom-if" if="[[enableSensorsContentSetting_]]">
- <cr-link-row class="hr two-line" data-route="SITE_SETTINGS_SENSORS"
- id="sensors" label="$i18n{siteSettingsSensors}"
- on-click="onTapNavigate_" start-icon="settings:sensors"
- sub-label="[[defaultSettingLabel_(
- default_.sensors,
- '$i18nPolymer{siteSettingsSensorsAllow}',
- '$i18nPolymer{siteSettingsSensorsBlock}')]]"></cr-link-row>
- </template>
+ <cr-link-row class="hr two-line" data-route="SITE_SETTINGS_SENSORS"
+ id="sensors" label="$i18n{siteSettingsSensors}"
+ on-click="onTapNavigate_" start-icon="settings:sensors"
+ sub-label="[[defaultSettingLabel_(
+ default_.sensors,
+ '$i18nPolymer{siteSettingsSensorsAllow}',
+ '$i18nPolymer{siteSettingsSensorsBlock}')]]"></cr-link-row>
<cr-link-row class="hr two-line" data-route="SITE_SETTINGS_NOTIFICATIONS"
id="notifications" label="$i18n{siteSettingsNotifications}"
@@ -207,6 +205,19 @@
</cr-link-row>
</template>
+ <template is="dom-if" if="[[enableNativeFileSystemWriteContentSetting_]]">
+ <cr-link-row class="hr two-line"
+ data-route="SITE_SETTINGS_NATIVE_FILE_SYSTEM_WRITE"
+ icon-class="subpage-arrow" id="native-file-system-write"
+ label="$i18n{siteSettingsNativeFileSystemWrite}"
+ on-click="onTapNavigate_" start-icon="settings:save-original"
+ sub-label="[[defaultSettingLabel_(
+ default_.filesystem,
+ '$i18nPolymer{siteSettingsNativeFileSystemWriteAsk}',
+ '$i18nPolymer{siteSettingsNativeFileSystemWriteBlock}')]]">
+ </cr-link-row>
+ </template>
+
<cr-link-row class="hr" data-route="SITE_SETTINGS_PDF_DOCUMENTS"
id="pdf-documents" label="$i18n{siteSettingsPdfDocuments}"
on-click="onTapNavigate_" start-icon="settings:pdf"></cr-link-row>
diff --git a/chromium/chrome/browser/resources/settings/site_settings_page/site_settings_page.js b/chromium/chrome/browser/resources/settings/site_settings_page/site_settings_page.js
index 85c0349ce7d..25bee399e1c 100644
--- a/chromium/chrome/browser/resources/settings/site_settings_page/site_settings_page.js
+++ b/chromium/chrome/browser/resources/settings/site_settings_page/site_settings_page.js
@@ -44,15 +44,6 @@ Polymer({
},
/** @private */
- enableSensorsContentSetting_: {
- type: Boolean,
- readOnly: true,
- value: function() {
- return loadTimeData.getBoolean('enableSensorsContentSetting');
- }
- },
-
- /** @private */
enableExperimentalWebPlatformFeatures_: {
type: Boolean,
value: function() {
@@ -76,6 +67,15 @@ Polymer({
}
},
+ /** @private */
+ enableNativeFileSystemWriteContentSetting_: {
+ type: Boolean,
+ value: function() {
+ return loadTimeData.getBoolean(
+ 'enableNativeFileSystemWriteContentSetting');
+ }
+ },
+
/** @type {!Map<string, (string|Function)>} */
focusConfig: {
type: Object,
@@ -134,6 +134,12 @@ Polymer({
pairs.push([R.SITE_SETTINGS_BLUETOOTH_SCANNING, 'bluetooth-scanning']);
}
+ if (this.enableNativeFileSystemWriteContentSetting_) {
+ pairs.push([
+ R.SITE_SETTINGS_NATIVE_FILE_SYSTEM_WRITE, 'native-file-system-write'
+ ]);
+ }
+
pairs.forEach(([route, id]) => {
this.focusConfig.set(route.path, () => this.async(() => {
cr.ui.focusWithoutInk(assert(this.$$(`#${id}`)));