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

Remove value kConnectingToDevice from CupsPrinterStatus enum

This changes consolidates the CupsPrinterStatus kConnectingToDevice
enum value into kPrinterUnreachable enum value. Having both enum values
is redundant as they both would convey the same meaning to the user.

The enums modified in this CL are relatively new and not persisted
anywhere so they are safe to update.

Bug: 1059607
Change-Id: If890c95f5c4650d25125cb4c40291aae616f4d98
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2340292Reviewed-by: default avatarBailey Berro <baileyberro@chromium.org>
Reviewed-by: default avatarZentaro Kavanagh <zentaro@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Commit-Queue: Gavin Williams <gavinwill@chromium.org>
Cr-Commit-Position: refs/heads/master@{#795606}
parent e1a28063
......@@ -320,9 +320,6 @@
<message name="IDS_PRINT_PREVIEW_EULA_URL" desc="Message shown to user when their printer has a EULA associated with its PPD. This message is hyperlinked to the EULA.">
End User License Agreement
</message>
<message name="IDS_PRINT_PREVIEW_PRINTER_STATUS_CONNECTING_TO_DEVICE" desc="Error label to show under the destination dropdown when the device can't connect to the printer.">
Connection error
</message>
<message name="IDS_PRINT_PREVIEW_PRINTER_STATUS_DEVICE_ERROR" desc="Error label to show under the destination dropdown when the printer has a device error.">
Printer device error
</message>
......@@ -356,8 +353,8 @@
<message name="IDS_PRINT_PREVIEW_PRINTER_STATUS_PRINTER_QUEUE_FULL" desc="Error label to show under the destination dropdown when the printer has a full queue.">
Printer queue is full
</message>
<message name="IDS_PRINT_PREVIEW_PRINTER_STATUS_PRINTER_UNREACHABLE" desc="Error label to show under the destination dropdown when the printer is unreachable.">
Printer is unreachable
<message name="IDS_PRINT_PREVIEW_PRINTER_STATUS_PRINTER_UNREACHABLE" desc="Error label to show under the destination dropdown when the device is attempting to schedule a print job on the printer but can't get a connection to the printer">
Can’t connect to printer
</message>
<message name="IDS_PRINT_PREVIEW_PRINTER_STATUS_STOPPED" desc="Error label to show under the destination dropdown when the printer is in a stopped state.">
Printer is stopped
......
852457d45839a5239a52cfbeab403a0cfd0f26dd
\ No newline at end of file
b191fe1ebd5f14ceef3d72cfe6b195820f8529e6
\ No newline at end of file
......@@ -27,8 +27,6 @@ CupsPrinterStatus PrinterStatusToCupsPrinterStatus(
CupsReason PrinterReasonToCupsReason(const ReasonFromPrinter& reason) {
switch (reason) {
case ReasonFromPrinter::CONNECTING_TO_DEVICE:
return CupsReason::kConnectingToDevice;
case ReasonFromPrinter::FUSER_OVER_TEMP:
case ReasonFromPrinter::FUSER_UNDER_TEMP:
case ReasonFromPrinter::INTERPRETER_RESOURCE_UNAVAILABLE:
......@@ -67,6 +65,7 @@ CupsReason PrinterReasonToCupsReason(const ReasonFromPrinter& reason) {
return CupsReason::kPaused;
case ReasonFromPrinter::SPOOL_AREA_FULL:
return CupsReason::kPrinterQueueFull;
case ReasonFromPrinter::CONNECTING_TO_DEVICE:
case ReasonFromPrinter::SHUTDOWN:
case ReasonFromPrinter::TIMED_OUT:
return CupsReason::kPrinterUnreachable;
......
......@@ -57,9 +57,6 @@ TEST(CupsPrinterStatusCreatorTest, PrinterSeverityToCupsSeverity) {
}
TEST(CupsPrinterStatusCreatorTest, PrinterReasonToCupsReason) {
EXPECT_EQ(CupsReason::kConnectingToDevice,
PrinterReasonToCupsReason(ReasonFromPrinter::CONNECTING_TO_DEVICE));
EXPECT_EQ(CupsReason::kDeviceError,
PrinterReasonToCupsReason(ReasonFromPrinter::FUSER_OVER_TEMP));
EXPECT_EQ(CupsReason::kDeviceError,
......@@ -127,6 +124,8 @@ TEST(CupsPrinterStatusCreatorTest, PrinterReasonToCupsReason) {
EXPECT_EQ(CupsReason::kPrinterQueueFull,
PrinterReasonToCupsReason(ReasonFromPrinter::SPOOL_AREA_FULL));
EXPECT_EQ(CupsReason::kPrinterUnreachable,
PrinterReasonToCupsReason(ReasonFromPrinter::CONNECTING_TO_DEVICE));
EXPECT_EQ(CupsReason::kPrinterUnreachable,
PrinterReasonToCupsReason(ReasonFromPrinter::SHUTDOWN));
EXPECT_EQ(CupsReason::kPrinterUnreachable,
......
......@@ -316,7 +316,7 @@ class CupsPrintersManagerImpl
CupsPrinterStatus printer_status(printer_id);
printer_status.AddStatusReason(
CupsPrinterStatus::CupsPrinterStatusReason::Reason::
kConnectingToDevice,
kPrinterUnreachable,
CupsPrinterStatus::CupsPrinterStatusReason::Severity::kError);
std::move(cb).Run(std::move(printer_status));
return;
......
......@@ -8,23 +8,22 @@
* @enum {number}
*/
export const PrinterStatusReason = {
CONNECTING_TO_DEVICE: 0,
DEVICE_ERROR: 1,
DOOR_OPEN: 2,
LOW_ON_INK: 3,
LOW_ON_PAPER: 4,
NO_ERROR: 5,
OUT_OF_INK: 6,
OUT_OF_PAPER: 7,
OUTPUT_ALMOST_FULL: 8,
OUTPUT_FULL: 9,
PAPER_JAM: 10,
PAUSED: 11,
PRINTER_QUEUE_FULL: 12,
PRINTER_UNREACHABLE: 13,
STOPPED: 14,
TRAY_MISSING: 15,
UNKNOWN_REASON: 16,
DEVICE_ERROR: 0,
DOOR_OPEN: 1,
LOW_ON_INK: 2,
LOW_ON_PAPER: 3,
NO_ERROR: 4,
OUT_OF_INK: 5,
OUT_OF_PAPER: 6,
OUTPUT_ALMOST_FULL: 7,
OUTPUT_FULL: 8,
PAPER_JAM: 9,
PAUSED: 10,
PRINTER_QUEUE_FULL: 11,
PRINTER_UNREACHABLE: 12,
STOPPED: 13,
TRAY_MISSING: 14,
UNKNOWN_REASON: 15,
};
/**
......@@ -57,7 +56,6 @@ export let PrinterStatus;
/** @const {!Map<!PrinterStatusReason, string>} */
export const ERROR_STRING_KEY_MAP = new Map([
[PrinterStatusReason.CONNECTING_TO_DEVICE, 'printerStatusConnectingToDevice'],
[PrinterStatusReason.DEVICE_ERROR, 'printerStatusDeviceError'],
[PrinterStatusReason.DOOR_OPEN, 'printerStatusDoorOpen'],
[PrinterStatusReason.LOW_ON_INK, 'printerStatusLowOnInk'],
......
......@@ -328,8 +328,6 @@ void AddPrintPreviewStrings(content::WebUIDataSource* source) {
{"pinErrorMessage", IDS_PRINT_PREVIEW_PIN_ERROR_MESSAGE},
{"pinPlaceholder", IDS_PRINT_PREVIEW_PIN_PLACEHOLDER},
{"printerEulaURL", IDS_PRINT_PREVIEW_EULA_URL},
{"printerStatusConnectingToDevice",
IDS_PRINT_PREVIEW_PRINTER_STATUS_CONNECTING_TO_DEVICE},
{"printerStatusDeviceError", IDS_PRINT_PREVIEW_PRINTER_STATUS_DEVICE_ERROR},
{"printerStatusDoorOpen", IDS_PRINT_PREVIEW_PRINTER_STATUS_DOOR_OPEN},
{"printerStatusLowOnInk", IDS_PRINT_PREVIEW_PRINTER_STATUS_LOW_ON_INK},
......
......@@ -24,8 +24,7 @@ class CHROMEOS_EXPORT CupsPrinterStatus {
class CHROMEOS_EXPORT CupsPrinterStatusReason {
public:
enum class Reason {
kConnectingToDevice = 0,
kDeviceError,
kDeviceError = 0,
kDoorOpen,
kLowOnInk,
kLowOnPaper,
......
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