Commit 66bfc24c authored by Gavin Williams's avatar Gavin Williams Committed by Commit Bot

Use CrOS color variables for printer status icons

These colors are for the CrOS Print Preview printer status icons to
indicate the printer's current status.

Bug: 1059607
Change-Id: I8c5ebd95aba2154b30b9435ceb1c3ec974c4dec1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2227904
Commit-Queue: Gavin Williams <gavinwill@chromium.org>
Reviewed-by: default avatarRebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#775104}
parent 0f88ce29
......@@ -11,6 +11,7 @@ export {PrinterType} from './data/destination_match.js';
// <if expr="chromeos">
export {ColorModeRestriction, DuplexModeRestriction, PinModeRestriction} from './data/destination_policies.js';
export {PrinterStatus, PrinterStatusReason, PrinterStatusSeverity} from './data/printer_status_cros.js';
export {GREEN_PRINTER_STATUS, RED_PRINTER_STATUS} from './ui/destination_select_cros.js';
// </if>
export {DestinationErrorType, DestinationStore} from './data/destination_store.js';
export {PageLayoutInfo} from './data/document_info.js';
......
......@@ -28,6 +28,9 @@ import {getSelectDropdownBackground} from '../print_preview_utils.js';
import {SelectBehavior} from './select_behavior.js';
export const GREEN_PRINTER_STATUS = 'var(--google-green-700)';
export const RED_PRINTER_STATUS = 'var(--google-red-600)';
Polymer({
is: 'print-preview-destination-select-cros',
......@@ -270,12 +273,12 @@ Polymer({
const statusReason = this.getStatusReasonFromPrinterStatus_(printerStatus);
if (statusReason === PrinterStatusReason.NO_ERROR) {
circle.firstChild.style.backgroundColor = 'green';
circle.firstChild.style.backgroundColor = GREEN_PRINTER_STATUS;
return;
}
if (statusReason !== PrinterStatusReason.UNKNOWN_REASON) {
circle.firstChild.style.backgroundColor = 'red';
circle.firstChild.style.backgroundColor = RED_PRINTER_STATUS;
return;
}
},
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import {Destination, DestinationConnectionStatus, DestinationOrigin, DestinationType, getSelectDropdownBackground, NativeLayer, NativeLayerImpl, PrinterStatus, PrinterStatusReason, PrinterStatusSeverity} from 'chrome://print/print_preview.js';
import {Destination, DestinationConnectionStatus, DestinationOrigin, DestinationType, getSelectDropdownBackground, GREEN_PRINTER_STATUS, NativeLayer, NativeLayerImpl, PrinterStatus, PrinterStatusReason, PrinterStatusSeverity, RED_PRINTER_STATUS} from 'chrome://print/print_preview.js';
import {assert} from 'chrome://resources/js/assert.m.js';
import {Base, flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
......@@ -189,27 +189,27 @@ suite(printer_status_test_cros.suiteName, function() {
const dropdown = destinationSelect.$$('#dropdown');
return whenStatusRequestsDone.then(() => {
assertEquals(
'green',
GREEN_PRINTER_STATUS,
dropdown.$$(`#${escapeForwardSlahes(destination1.key)}`)
.firstChild.style.backgroundColor);
assertEquals(
'green',
GREEN_PRINTER_STATUS,
dropdown.$$(`#${escapeForwardSlahes(destination2.key)}`)
.firstChild.style.backgroundColor);
assertEquals(
'green',
GREEN_PRINTER_STATUS,
dropdown.$$(`#${escapeForwardSlahes(destination3.key)}`)
.firstChild.style.backgroundColor);
assertEquals(
'red',
RED_PRINTER_STATUS,
dropdown.$$(`#${escapeForwardSlahes(destination4.key)}`)
.firstChild.style.backgroundColor);
assertEquals(
'red',
RED_PRINTER_STATUS,
dropdown.$$(`#${escapeForwardSlahes(destination5.key)}`)
.firstChild.style.backgroundColor);
assertEquals(
'red',
RED_PRINTER_STATUS,
dropdown.$$(`#${escapeForwardSlahes(destination6.key)}`)
.firstChild.style.backgroundColor);
assertEquals(
......
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