Commit 604098c0 authored by Jesse Schettler's avatar Jesse Schettler Committed by Commit Bot

scanning: Support default source type in scan app

When a scanner reports no source options, lorgnette reports a default
source type in the scanner capabilities. Update the scan app to support
this default source type.

Bug: 1059779
Change-Id: Ib666ea8199404666291b5e8ae9fb43601c3c4774
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2443532Reviewed-by: default avatarJimmy Gong <jimmyxgong@chromium.org>
Commit-Queue: Jesse Schettler <jschettler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813464}
parent 4c09dc65
......@@ -253,10 +253,11 @@ suite('SourceSelectTest', () => {
});
test('initializeSourceSelect', () => {
// Before options are added, the dropdown should be disabled.
// Before options are added, the dropdown should be disabled and empty.
const select = sourceSelect.$$('select');
assertTrue(!!select);
assertTrue(select.disabled);
assertEquals(0, select.length);
const firstSource = createSource(SourceType.FLATBED, 'platen');
const secondSource = createSource(SourceType.ADF_SIMPLEX, 'adf simplex');
......
......@@ -19,6 +19,9 @@ export function getSourceTypeString(mojoSourceType) {
return 'Document Feeder (Simplex)';
case chromeos.scanning.mojom.SourceType.kAdfDuplex:
return 'Document Feeder (Duplex)';
case chromeos.scanning.mojom.SourceType.kDefault:
return 'Default';
case chromeos.scanning.mojom.SourceType.kUnknown:
default:
assertNotReached();
return 'Unknown';
......
......@@ -16,13 +16,6 @@
should announce when a new option is focused). -->
<select class="md-select" on-change="onSelectedSourceChange_"
disabled="[[disabled_]]">
<!-- TODO(jschettler): Figure out why hiding/disabling the option doesn't
remove it from the dropdown. -->
<template is="dom-if" if="[[!sources.length]]" restamp>
<!-- TODO(jschettler): Replace default option with finalized i18n
string. -->
<option value="">No sources</option>
</template>
<!-- TODO(jschettler): Determine how the sources should be sorted. -->
<template is="dom-repeat" items="[[sources]]" as="source">
<option value="[[source.name]]">
......
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