Commit dd0b0ce9 authored by Gavin Williams's avatar Gavin Williams Committed by Commit Bot

Delete printer-status-icon-cros element

Delete printer-status-icon-cros element as it's no longer needed/being
used in print preview.

Replaced with a dedicated printer status icon SVG.

Bug: 1123754
Change-Id: Ie4c2bf0c91c655fdead9a9ecf3387d94a3585502
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2433305
Commit-Queue: Gavin Williams <gavinwill@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#811707}
parent 9d3ed4ff
...@@ -136,7 +136,6 @@ preprocess_grit("preprocess_generated") { ...@@ -136,7 +136,6 @@ preprocess_grit("preprocess_generated") {
"ui/destination_dropdown_cros.js", "ui/destination_dropdown_cros.js",
"ui/destination_select_cros.js", "ui/destination_select_cros.js",
"ui/pin_settings.js", "ui/pin_settings.js",
"ui/printer_status_icon_cros.js",
] ]
} else { } else {
in_files += [ in_files += [
......
...@@ -50,16 +50,6 @@ export const PrinterState = { ...@@ -50,16 +50,6 @@ export const PrinterState = {
UNKNOWN: 2, UNKNOWN: 2,
}; };
/**
* Enumeration used to choose styling based on whether this icon is located in
* the destination display or the destination dropdown.
* @enum {number}
*/
export const IconLocation = {
DISPLAY: 0,
DROPDOWN: 1,
};
/** /**
* A container for the results of a printer status query. A printer status query * A container for the results of a printer status query. A printer status query
* can return multiple error reasons. |timestamp| is set at the time of status * can return multiple error reasons. |timestamp| is set at the time of status
......
...@@ -56,7 +56,6 @@ js_type_check("closure_compile_module") { ...@@ -56,7 +56,6 @@ js_type_check("closure_compile_module") {
":destination_dropdown_cros", ":destination_dropdown_cros",
":destination_select_cros", ":destination_select_cros",
":pin_settings", ":pin_settings",
":printer_status_icon_cros",
] ]
} else { } else {
deps += [ ":destination_select" ] deps += [ ":destination_select" ]
...@@ -187,19 +186,12 @@ if (is_chromeos) { ...@@ -187,19 +186,12 @@ if (is_chromeos) {
js_library("destination_dropdown_cros") { js_library("destination_dropdown_cros") {
deps = [ deps = [
":printer_status_icon_cros",
"..:print_preview_utils", "..:print_preview_utils",
"//third_party/polymer/v3_0/components-chromium/iron-dropdown:iron-dropdown", "//third_party/polymer/v3_0/components-chromium/iron-dropdown:iron-dropdown",
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
"//ui/webui/resources/cr_elements/cr_input:cr_input.m", "//ui/webui/resources/cr_elements/cr_input:cr_input.m",
] ]
} }
js_library("printer_status_icon_cros") {
deps = [
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
]
}
} else { } else {
js_library("destination_select") { js_library("destination_select") {
deps = [ deps = [
...@@ -571,7 +563,6 @@ html_to_js("web_components") { ...@@ -571,7 +563,6 @@ html_to_js("web_components") {
"destination_dropdown_cros.js", "destination_dropdown_cros.js",
"destination_select_cros.js", "destination_select_cros.js",
"pin_settings.js", "pin_settings.js",
"printer_status_icon_cros.js",
] ]
} else { } else {
js_files += [ "destination_select.js" ] js_files += [ "destination_select.js" ]
......
<style include="cr-shared-style">
div {
display: inline;
position: relative;
}
.badge {
border-radius: 50%;
display: inline-block;
position: absolute;
--status-badge-radius: 8px;
--background-badge-radius: 12px;
--background-badge-left: 12px;
--background-badge-top: 6px;
}
:host-context([dir='rtl']) .badge {
--background-badge-left: -4px;
}
#status-badge {
height: var(--status-badge-radius);
left: calc(var(--background-badge-left) + (var(--background-badge-radius) - var(--status-badge-radius))/2);
top: calc(var(--background-badge-top) + (var(--background-badge-radius) - var(--status-badge-radius))/2);
width: var(--status-badge-radius);
}
:host([printer-state='0']) #status-badge {
background-color: var(--google-green-700);
}
:host([printer-state='1']) #status-badge {
background-color: var(--google-red-600);
}
:host([printer-state='2']) #status-badge {
background-color: var(--google-grey-500);
}
:host-context([dir='rtl']) #status-badge {
right: calc(var(--background-badge-left) + (var(--background-badge-radius) - var(--status-badge-radius))/2);
}
#background-badge {
height: var(--background-badge-radius);
left: var(--background-badge-left);
top: var(--background-badge-top);
width: var(--background-badge-radius);
}
:host([icon-location='0']) #background-badge {
background-color: var(--google-grey-refresh-100);
}
:host([icon-location='1']) #background-badge {
background-color: white;
}
:host-context([dir='rtl']) #background-badge {
right: var(--background-badge-left);
}
:host-context(.highlighted) #background-badge {
background-color: var(--google-blue-refresh-100);
}
</style>
<div>
<iron-icon icon="print-preview:print"></iron-icon>
<span id="background-badge" class="badge"></span>
<span id="status-badge" class="badge"></span>
</div>
// Copyright 2020 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 'chrome://resources/cr_elements/shared_vars_css.m.js';
import './icons.js';
import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
import {IconLocation, PrinterState} from '../data/printer_status_cros.js';
Polymer({
is: 'printer-status-icon-cros',
properties: {
/** Determines color of the background badge. */
background: String,
/**
* State of the associated printer. Determines color of the status badge.
* @type {!PrinterState}
*/
printerState: {
type: Number,
reflectToAttribute: true,
},
/**
* Location of this icon. Determines color of the background badge.
* @type {!IconLocation}
*/
iconLocation: {
type: Number,
reflectToAttribute: true,
},
},
_template: html`{__html_template__}`,
});
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