Commit cce57b7f authored by Naoki Fukino's avatar Naoki Fukino Committed by Commit Bot

Show "Available devices" for non-empty device list.

The device list header should be "Available devices" instead of
"Available devices will appear here." when there already is one or more
devices in the external storage list.

Bug: 1007202
Test: Manual test
Change-Id: Ib08103236d32ada77b8328f29eacb1ed0a6a7759
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1895252Reviewed-by: default avatarHector Carmona <hcarmona@chromium.org>
Commit-Queue: Naoki Fukino <fukino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712877}
parent 8d90918d
......@@ -4841,9 +4841,12 @@
<message name="IDS_SETTINGS_STORAGE_ANDROID_APPS_ACCESS_EXTERNAL_DRIVES_NOTE" desc="Label for the additional note for the subpage for setting preferences for external storage.">
Apps from Google Play may require full file system access to read and write files on external storage devices. Files and folders created on the device are visible to anyone who uses the external drive. <ph name="LINK_BEGIN">&lt;a target="_blank" href="$1<ex>https://google.com/</ex>"&gt;</ph>Learn more<ph name="LINK_END">&lt;/a&gt;</ph>
</message>
<message name="IDS_SETTINGS_STORAGE_EXTERNAL_STORAGE_LIST_HEADER" desc="Header of the list of external storage devices for the subpage for setting preferences for external storage.">
<message name="IDS_SETTINGS_STORAGE_EXTERNAL_STORAGE_EMPTY_LIST_HEADER" desc="Header of the list of external storage devices for the subpage for setting preferences for external storage. This is shown when the list is empty.">
Available devices will appear here.
</message>
<message name="IDS_SETTINGS_STORAGE_EXTERNAL_STORAGE_LIST_HEADER" desc="Header of the list of external storage devices for the subpage for setting preferences for external storage. This is shown when the list is not empty.">
Available devices
</message>
<!-- Power -->
<message name="IDS_SETTINGS_POWER_TITLE" desc="In Device Settings, the title for power management.">
......
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/html/assert.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="storage_external_entry.html">
<link rel="import" href="../prefs/prefs.html">
<link rel="import" href="../settings_shared_css.html">
......@@ -18,7 +19,7 @@
$i18nRaw{storageAndroidAppsExternalDrivesNote}
</span>
</div>
<h2>$i18n{storageExternalStorageListHeader}</h2>
<h2>[[computeStorageListHeader_(externalStorages_)]]</h2>
<iron-list id="removableDevices" preserve-focus
items="[[externalStorages_]]">
<template>
......
......@@ -11,7 +11,10 @@
Polymer({
is: 'settings-storage-external',
behaviors: [WebUIListenerBehavior],
behaviors: [
I18nBehavior,
WebUIListenerBehavior,
],
properties: {
/**
......@@ -56,4 +59,16 @@ Polymer({
handleExternalStoragesUpdated_: function(storages) {
this.externalStorages_ = storages;
},
/**
* @param {Arrray<!settings.ExternalStorage>} externalStorages
* @return {string}
* @private
*/
computeStorageListHeader_: function(externalStorages) {
return this.i18n(
!externalStorages || externalStorages.length == 0 ?
'storageExternalStorageEmptyListHeader' :
'storageExternalStorageListHeader');
},
});
......@@ -1091,6 +1091,8 @@ void AddDeviceStrings(content::WebUIDataSource* html_source) {
{"storageSpaceCriticallyLowMessageLine2",
IDS_SETTINGS_STORAGE_SPACE_CRITICALLY_LOW_MESSAGE_LINE_2},
{"storageExternal", IDS_SETTINGS_STORAGE_EXTERNAL},
{"storageExternalStorageEmptyListHeader",
IDS_SETTINGS_STORAGE_EXTERNAL_STORAGE_EMPTY_LIST_HEADER},
{"storageExternalStorageListHeader",
IDS_SETTINGS_STORAGE_EXTERNAL_STORAGE_LIST_HEADER}};
AddLocalizedStringsBulk(html_source, kStorageStrings,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment