Commit 24a2fb78 authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Commit Bot

plugin_vm: use dedicated message when list of shared folders is empty

Instead of showing empty list when there are no shared folders, let's
show dedicated message.

Bug: chromium:1094923
Change-Id: I10a886ba4ce48529a07a2f03e7e7f72f78db4527
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2247160Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Dmitry Torokhov <dtor@chromium.org>
Cr-Commit-Position: refs/heads/master@{#779513}
parent c8367eb6
...@@ -2722,6 +2722,9 @@ ...@@ -2722,6 +2722,9 @@
<message name="IDS_SETTINGS_APPS_PLUGIN_VM_SHARED_PATHS_REMOVE_SHARING" desc="Tooltip to show when hovering on the remove icon for a Plugin VM shared folder."> <message name="IDS_SETTINGS_APPS_PLUGIN_VM_SHARED_PATHS_REMOVE_SHARING" desc="Tooltip to show when hovering on the remove icon for a Plugin VM shared folder.">
Stop sharing Stop sharing
</message> </message>
<message name="IDS_SETTINGS_APPS_PLUGIN_VM_SHARED_PATHS_LIST_EMPTY_MESSAGE" desc="Message shown when the user has not yet shared any folders in Plugin VM.">
Shared folders will appear here
</message>
<!-- Storage --> <!-- Storage -->
<message name="IDS_SETTINGS_STORAGE_TITLE" desc="In Device Settings, the title for storage management."> <message name="IDS_SETTINGS_STORAGE_TITLE" desc="In Device Settings, the title for storage management.">
......
...@@ -17,18 +17,28 @@ ...@@ -17,18 +17,28 @@
</span> </span>
</div> </div>
</div> </div>
<div class="settings-box continuation"> <div class="settings-box secondary continuation"
<h2 class="start">$i18n{pluginVmSharedPathsListHeading}</h2> hidden="[[sharedPaths_.length]]" >
$i18n{pluginVmSharedPathsListEmptyMessage}
</div> </div>
<div class="list-frame vertical-list"> <div id="pluginVmList" hidden="[[!sharedPaths_.length]]">
<template is="dom-repeat" items="[[sharedPaths_]]"> <div class="settings-box continuation">
<div class="list-item"> <h2 id="pluginVmListHeading" class="start">
<div class="start">[[item.pathDisplayText]]</div> $i18n{pluginVmSharedPathsListHeading}
<cr-icon-button class="icon-clear" </h2>
on-click="onRemoveSharedPathClick_" </div>
title="$i18n{pluginVmSharedPathsRemoveSharing}"></cr-icon-button> <div class="list-frame vertical-list" role="list"
</div> aria-labeledby="pluginVmListHeading">
</template> <template is="dom-repeat" items="[[sharedPaths_]]">
<div class="list-item" role="listitem">
<div class="start">[[item.pathDisplayText]]</div>
<cr-icon-button class="icon-clear"
on-click="onRemoveSharedPathClick_"
title="$i18n{pluginVmSharedPathsRemoveSharing}">
</cr-icon-button>
</div>
</template>
</div>
</div> </div>
</template> </template>
<script src="plugin_vm_shared_paths.js"></script> <script src="plugin_vm_shared_paths.js"></script>
......
...@@ -317,6 +317,8 @@ void AppsSection::AddPluginVmLoadTimeData( ...@@ -317,6 +317,8 @@ void AppsSection::AddPluginVmLoadTimeData(
IDS_SETTINGS_APPS_PLUGIN_VM_SHARED_PATHS_INSTRUCTIONS_REMOVE}, IDS_SETTINGS_APPS_PLUGIN_VM_SHARED_PATHS_INSTRUCTIONS_REMOVE},
{"pluginVmSharedPathsRemoveSharing", {"pluginVmSharedPathsRemoveSharing",
IDS_SETTINGS_APPS_PLUGIN_VM_SHARED_PATHS_REMOVE_SHARING}, IDS_SETTINGS_APPS_PLUGIN_VM_SHARED_PATHS_REMOVE_SHARING},
{"pluginVmSharedPathsListEmptyMessage",
IDS_SETTINGS_APPS_PLUGIN_VM_SHARED_PATHS_LIST_EMPTY_MESSAGE},
}; };
AddLocalizedStringsBulk(html_source, kLocalizedStrings); AddLocalizedStringsBulk(html_source, kLocalizedStrings);
......
...@@ -57,7 +57,7 @@ suite('SharedPaths', function() { ...@@ -57,7 +57,7 @@ suite('SharedPaths', function() {
test('Remove', async function() { test('Remove', async function() {
await setPrefs({'path1': ['PvmDefault'], 'path2': ['PvmDefault']}); await setPrefs({'path1': ['PvmDefault'], 'path2': ['PvmDefault']});
assertEquals(2, page.shadowRoot.querySelectorAll('.settings-box').length); assertEquals(3, page.shadowRoot.querySelectorAll('.settings-box').length);
assertEquals(2, page.shadowRoot.querySelectorAll('.list-item').length); assertEquals(2, page.shadowRoot.querySelectorAll('.list-item').length);
assertFalse(page.$.pluginVmInstructionsRemove.hidden); assertFalse(page.$.pluginVmInstructionsRemove.hidden);
assertTrue(!!page.$$('.list-item cr-icon-button')); assertTrue(!!page.$$('.list-item cr-icon-button'));
......
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