Skip to content

Commit

Permalink
Renamed color_capable to color_changeable.
Browse files Browse the repository at this point in the history
BUG=153726

Review URL: https://chromiumcodereview.appspot.com/11641003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174281 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
vitalybuka@chromium.org committed Dec 20, 2012
1 parent 7f914fd commit 133af72
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion chrome/browser/printing/print_system_task_proxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ void PrintSystemTaskProxy::GetPrinterCapabilities(

DictionaryValue settings_info;
settings_info.SetString(kPrinterId, printer_name);
settings_info.SetBoolean(kDisableColorOption, !info.color_capable);
settings_info.SetBoolean(kDisableColorOption, !info.color_changeable);
settings_info.SetBoolean(printing::kSettingSetColorAsDefault,
info.color_default);
// TODO(gene): Make new capabilities format for Print Preview
Expand Down
2 changes: 1 addition & 1 deletion printing/backend/cups_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ bool parsePpdCapabilities(
VLOG(1) << "Unknown printer color model";
}

caps.color_capable = (cm_color && cm_black && (cm_color != cm_black));
caps.color_changeable = (cm_color && cm_black && (cm_color != cm_black));
caps.color_default = is_color;

ppdClose(ppd);
Expand Down
10 changes: 5 additions & 5 deletions printing/backend/cups_helper_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ TEST(PrintBackendCupsHelperTest, TestPpdParsingNoColorDuplexLongEdge) {

printing::PrinterSemanticCapsAndDefaults caps;
EXPECT_TRUE(printing::parsePpdCapabilities("test", test_ppd_data, &caps));
EXPECT_FALSE(caps.color_capable);
EXPECT_FALSE(caps.color_changeable);
EXPECT_FALSE(caps.color_default);
EXPECT_TRUE(caps.duplex_capable);
EXPECT_EQ(caps.duplex_default, printing::LONG_EDGE);
Expand All @@ -58,7 +58,7 @@ TEST(PrintBackendCupsHelperTest, TestPpdParsingNoColorDuplexSimples) {

printing::PrinterSemanticCapsAndDefaults caps;
EXPECT_TRUE(printing::parsePpdCapabilities("test", test_ppd_data, &caps));
EXPECT_FALSE(caps.color_capable);
EXPECT_FALSE(caps.color_changeable);
EXPECT_FALSE(caps.color_default);
EXPECT_TRUE(caps.duplex_capable);
EXPECT_EQ(caps.duplex_default, printing::SIMPLEX);
Expand All @@ -82,7 +82,7 @@ TEST(PrintBackendCupsHelperTest, TestPpdParsingNoColorNoDuplex) {

printing::PrinterSemanticCapsAndDefaults caps;
EXPECT_TRUE(printing::parsePpdCapabilities("test", test_ppd_data, &caps));
EXPECT_FALSE(caps.color_capable);
EXPECT_FALSE(caps.color_changeable);
EXPECT_FALSE(caps.color_default);
EXPECT_FALSE(caps.duplex_capable);
EXPECT_EQ(caps.duplex_default, printing::UNKNOWN_DUPLEX_MODE);
Expand Down Expand Up @@ -115,7 +115,7 @@ TEST(PrintBackendCupsHelperTest, TestPpdParsingColorTrueDuplexLongEdge) {

printing::PrinterSemanticCapsAndDefaults caps;
EXPECT_TRUE(printing::parsePpdCapabilities("test", test_ppd_data, &caps));
EXPECT_TRUE(caps.color_capable);
EXPECT_TRUE(caps.color_changeable);
EXPECT_TRUE(caps.color_default);
EXPECT_TRUE(caps.duplex_capable);
EXPECT_EQ(caps.duplex_default, printing::LONG_EDGE);
Expand Down Expand Up @@ -152,7 +152,7 @@ TEST(PrintBackendCupsHelperTest, TestPpdParsingColorFalseDuplexLongEdge) {

printing::PrinterSemanticCapsAndDefaults caps;
EXPECT_TRUE(printing::parsePpdCapabilities("test", test_ppd_data, &caps));
EXPECT_TRUE(caps.color_capable);
EXPECT_TRUE(caps.color_changeable);
EXPECT_FALSE(caps.color_default);
EXPECT_TRUE(caps.duplex_capable);
EXPECT_EQ(caps.duplex_default, printing::LONG_EDGE);
Expand Down
2 changes: 1 addition & 1 deletion printing/backend/print_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ PrinterBasicInfo::PrinterBasicInfo()
PrinterBasicInfo::~PrinterBasicInfo() {}

PrinterSemanticCapsAndDefaults::PrinterSemanticCapsAndDefaults()
: color_capable(false),
: color_changeable(false),
duplex_capable(false),
color_default(false),
duplex_default(UNKNOWN_DUPLEX_MODE) {}
Expand Down
2 changes: 1 addition & 1 deletion printing/backend/print_backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct PRINTING_EXPORT PrinterSemanticCapsAndDefaults {
~PrinterSemanticCapsAndDefaults();

// Capabilities.
bool color_capable;
bool color_changeable;
bool duplex_capable;

// Current defaults.
Expand Down
12 changes: 6 additions & 6 deletions printing/backend/print_backend_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ bool PrintBackendWin::GetPrinterSemanticCapsAndDefaults(

// Get printer capabilities. For more info see here:
// http://msdn.microsoft.com/en-us/library/windows/desktop/dd183552(v=vs.85).aspx
caps.color_capable = (::DeviceCapabilities(info_5.get()->pPrinterName,
info_5.get()->pPortName,
DC_COLORDEVICE,
NULL,
NULL) == 1);
caps.color_changeable = (::DeviceCapabilities(info_5.get()->pPrinterName,
info_5.get()->pPortName,
DC_COLORDEVICE,
NULL,
NULL) == 1);

caps.duplex_capable = (::DeviceCapabilities(info_5.get()->pPrinterName,
info_5.get()->pPortName,
Expand Down Expand Up @@ -155,7 +155,7 @@ bool PrintBackendWin::GetPrinterSemanticCapsAndDefaults(
}
} else {
LOG(WARNING) << "Fallback to color/simplex mode.";
caps.color_default = caps.color_capable;
caps.color_default = caps.color_changeable;
caps.duplex_default = SIMPLEX;
}

Expand Down

0 comments on commit 133af72

Please sign in to comment.