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 @@ ...@@ -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."> <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 End User License Agreement
</message> </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."> <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 Printer device error
</message> </message>
...@@ -356,8 +353,8 @@ ...@@ -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."> <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 Printer queue is full
</message> </message>
<message name="IDS_PRINT_PREVIEW_PRINTER_STATUS_PRINTER_UNREACHABLE" desc="Error label to show under the destination dropdown when the 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">
Printer is unreachable Can’t connect to printer
</message> </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."> <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 Printer is stopped
......
852457d45839a5239a52cfbeab403a0cfd0f26dd b191fe1ebd5f14ceef3d72cfe6b195820f8529e6
\ No newline at end of file \ No newline at end of file
...@@ -27,8 +27,6 @@ CupsPrinterStatus PrinterStatusToCupsPrinterStatus( ...@@ -27,8 +27,6 @@ CupsPrinterStatus PrinterStatusToCupsPrinterStatus(
CupsReason PrinterReasonToCupsReason(const ReasonFromPrinter& reason) { CupsReason PrinterReasonToCupsReason(const ReasonFromPrinter& reason) {
switch (reason) { switch (reason) {
case ReasonFromPrinter::CONNECTING_TO_DEVICE:
return CupsReason::kConnectingToDevice;
case ReasonFromPrinter::FUSER_OVER_TEMP: case ReasonFromPrinter::FUSER_OVER_TEMP:
case ReasonFromPrinter::FUSER_UNDER_TEMP: case ReasonFromPrinter::FUSER_UNDER_TEMP:
case ReasonFromPrinter::INTERPRETER_RESOURCE_UNAVAILABLE: case ReasonFromPrinter::INTERPRETER_RESOURCE_UNAVAILABLE:
...@@ -67,6 +65,7 @@ CupsReason PrinterReasonToCupsReason(const ReasonFromPrinter& reason) { ...@@ -67,6 +65,7 @@ CupsReason PrinterReasonToCupsReason(const ReasonFromPrinter& reason) {
return CupsReason::kPaused; return CupsReason::kPaused;
case ReasonFromPrinter::SPOOL_AREA_FULL: case ReasonFromPrinter::SPOOL_AREA_FULL:
return CupsReason::kPrinterQueueFull; return CupsReason::kPrinterQueueFull;
case ReasonFromPrinter::CONNECTING_TO_DEVICE:
case ReasonFromPrinter::SHUTDOWN: case ReasonFromPrinter::SHUTDOWN:
case ReasonFromPrinter::TIMED_OUT: case ReasonFromPrinter::TIMED_OUT:
return CupsReason::kPrinterUnreachable; return CupsReason::kPrinterUnreachable;
......
...@@ -57,9 +57,6 @@ TEST(CupsPrinterStatusCreatorTest, PrinterSeverityToCupsSeverity) { ...@@ -57,9 +57,6 @@ TEST(CupsPrinterStatusCreatorTest, PrinterSeverityToCupsSeverity) {
} }
TEST(CupsPrinterStatusCreatorTest, PrinterReasonToCupsReason) { TEST(CupsPrinterStatusCreatorTest, PrinterReasonToCupsReason) {
EXPECT_EQ(CupsReason::kConnectingToDevice,
PrinterReasonToCupsReason(ReasonFromPrinter::CONNECTING_TO_DEVICE));
EXPECT_EQ(CupsReason::kDeviceError, EXPECT_EQ(CupsReason::kDeviceError,
PrinterReasonToCupsReason(ReasonFromPrinter::FUSER_OVER_TEMP)); PrinterReasonToCupsReason(ReasonFromPrinter::FUSER_OVER_TEMP));
EXPECT_EQ(CupsReason::kDeviceError, EXPECT_EQ(CupsReason::kDeviceError,
...@@ -127,6 +124,8 @@ TEST(CupsPrinterStatusCreatorTest, PrinterReasonToCupsReason) { ...@@ -127,6 +124,8 @@ TEST(CupsPrinterStatusCreatorTest, PrinterReasonToCupsReason) {
EXPECT_EQ(CupsReason::kPrinterQueueFull, EXPECT_EQ(CupsReason::kPrinterQueueFull,
PrinterReasonToCupsReason(ReasonFromPrinter::SPOOL_AREA_FULL)); PrinterReasonToCupsReason(ReasonFromPrinter::SPOOL_AREA_FULL));
EXPECT_EQ(CupsReason::kPrinterUnreachable,
PrinterReasonToCupsReason(ReasonFromPrinter::CONNECTING_TO_DEVICE));
EXPECT_EQ(CupsReason::kPrinterUnreachable, EXPECT_EQ(CupsReason::kPrinterUnreachable,
PrinterReasonToCupsReason(ReasonFromPrinter::SHUTDOWN)); PrinterReasonToCupsReason(ReasonFromPrinter::SHUTDOWN));
EXPECT_EQ(CupsReason::kPrinterUnreachable, EXPECT_EQ(CupsReason::kPrinterUnreachable,
......
...@@ -316,7 +316,7 @@ class CupsPrintersManagerImpl ...@@ -316,7 +316,7 @@ class CupsPrintersManagerImpl
CupsPrinterStatus printer_status(printer_id); CupsPrinterStatus printer_status(printer_id);
printer_status.AddStatusReason( printer_status.AddStatusReason(
CupsPrinterStatus::CupsPrinterStatusReason::Reason:: CupsPrinterStatus::CupsPrinterStatusReason::Reason::
kConnectingToDevice, kPrinterUnreachable,
CupsPrinterStatus::CupsPrinterStatusReason::Severity::kError); CupsPrinterStatus::CupsPrinterStatusReason::Severity::kError);
std::move(cb).Run(std::move(printer_status)); std::move(cb).Run(std::move(printer_status));
return; return;
......
...@@ -8,23 +8,22 @@ ...@@ -8,23 +8,22 @@
* @enum {number} * @enum {number}
*/ */
export const PrinterStatusReason = { export const PrinterStatusReason = {
CONNECTING_TO_DEVICE: 0, DEVICE_ERROR: 0,
DEVICE_ERROR: 1, DOOR_OPEN: 1,
DOOR_OPEN: 2, LOW_ON_INK: 2,
LOW_ON_INK: 3, LOW_ON_PAPER: 3,
LOW_ON_PAPER: 4, NO_ERROR: 4,
NO_ERROR: 5, OUT_OF_INK: 5,
OUT_OF_INK: 6, OUT_OF_PAPER: 6,
OUT_OF_PAPER: 7, OUTPUT_ALMOST_FULL: 7,
OUTPUT_ALMOST_FULL: 8, OUTPUT_FULL: 8,
OUTPUT_FULL: 9, PAPER_JAM: 9,
PAPER_JAM: 10, PAUSED: 10,
PAUSED: 11, PRINTER_QUEUE_FULL: 11,
PRINTER_QUEUE_FULL: 12, PRINTER_UNREACHABLE: 12,
PRINTER_UNREACHABLE: 13, STOPPED: 13,
STOPPED: 14, TRAY_MISSING: 14,
TRAY_MISSING: 15, UNKNOWN_REASON: 15,
UNKNOWN_REASON: 16,
}; };
/** /**
...@@ -57,7 +56,6 @@ export let PrinterStatus; ...@@ -57,7 +56,6 @@ export let PrinterStatus;
/** @const {!Map<!PrinterStatusReason, string>} */ /** @const {!Map<!PrinterStatusReason, string>} */
export const ERROR_STRING_KEY_MAP = new Map([ export const ERROR_STRING_KEY_MAP = new Map([
[PrinterStatusReason.CONNECTING_TO_DEVICE, 'printerStatusConnectingToDevice'],
[PrinterStatusReason.DEVICE_ERROR, 'printerStatusDeviceError'], [PrinterStatusReason.DEVICE_ERROR, 'printerStatusDeviceError'],
[PrinterStatusReason.DOOR_OPEN, 'printerStatusDoorOpen'], [PrinterStatusReason.DOOR_OPEN, 'printerStatusDoorOpen'],
[PrinterStatusReason.LOW_ON_INK, 'printerStatusLowOnInk'], [PrinterStatusReason.LOW_ON_INK, 'printerStatusLowOnInk'],
......
...@@ -328,8 +328,6 @@ void AddPrintPreviewStrings(content::WebUIDataSource* source) { ...@@ -328,8 +328,6 @@ void AddPrintPreviewStrings(content::WebUIDataSource* source) {
{"pinErrorMessage", IDS_PRINT_PREVIEW_PIN_ERROR_MESSAGE}, {"pinErrorMessage", IDS_PRINT_PREVIEW_PIN_ERROR_MESSAGE},
{"pinPlaceholder", IDS_PRINT_PREVIEW_PIN_PLACEHOLDER}, {"pinPlaceholder", IDS_PRINT_PREVIEW_PIN_PLACEHOLDER},
{"printerEulaURL", IDS_PRINT_PREVIEW_EULA_URL}, {"printerEulaURL", IDS_PRINT_PREVIEW_EULA_URL},
{"printerStatusConnectingToDevice",
IDS_PRINT_PREVIEW_PRINTER_STATUS_CONNECTING_TO_DEVICE},
{"printerStatusDeviceError", IDS_PRINT_PREVIEW_PRINTER_STATUS_DEVICE_ERROR}, {"printerStatusDeviceError", IDS_PRINT_PREVIEW_PRINTER_STATUS_DEVICE_ERROR},
{"printerStatusDoorOpen", IDS_PRINT_PREVIEW_PRINTER_STATUS_DOOR_OPEN}, {"printerStatusDoorOpen", IDS_PRINT_PREVIEW_PRINTER_STATUS_DOOR_OPEN},
{"printerStatusLowOnInk", IDS_PRINT_PREVIEW_PRINTER_STATUS_LOW_ON_INK}, {"printerStatusLowOnInk", IDS_PRINT_PREVIEW_PRINTER_STATUS_LOW_ON_INK},
......
...@@ -24,8 +24,7 @@ class CHROMEOS_EXPORT CupsPrinterStatus { ...@@ -24,8 +24,7 @@ class CHROMEOS_EXPORT CupsPrinterStatus {
class CHROMEOS_EXPORT CupsPrinterStatusReason { class CHROMEOS_EXPORT CupsPrinterStatusReason {
public: public:
enum class Reason { enum class Reason {
kConnectingToDevice = 0, kDeviceError = 0,
kDeviceError,
kDoorOpen, kDoorOpen,
kLowOnInk, kLowOnInk,
kLowOnPaper, 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