Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(553)

Unified Diff: chrome/browser/ui/webui/print_preview_handler.cc

Issue 7828106: Revert 100233 - PrintPreview: Added code to identify the printer default duplex value. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/print_preview/print_preview.js ('k') | chrome/test/data/webui/print_preview.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/print_preview_handler.cc
===================================================================
--- chrome/browser/ui/webui/print_preview_handler.cc (revision 100233)
+++ chrome/browser/ui/webui/print_preview_handler.cc (working copy)
@@ -59,7 +59,6 @@
const char kSetColorAsDefault[] = "setColorAsDefault";
const char kSetDuplexAsDefault[] = "setDuplexAsDefault";
const char kPrinterColorModelForColor[] = "printerColorModelForColor";
-const char kPrinterDefaultDuplexValue[] = "printerDefaultDuplexValue";
#if defined(USE_CUPS)
const char kColorDevice[] = "ColorDevice";
@@ -282,7 +281,6 @@
bool supports_color = true;
bool set_duplex_as_default = false;
int printer_color_space = printing::GRAY;
- int default_duplex_setting_value = printing::UNKNOWN_DUPLEX_MODE;
if (!print_backend_->GetPrinterCapsAndDefaults(printer_name,
&printer_info)) {
return;
@@ -308,24 +306,16 @@
if (attr && attr->value)
supports_color = ppd->color_device;
- ppd_choice_t* duplex_choice = ppdFindMarkedChoice(ppd, kDuplex);
- if (duplex_choice == NULL) {
+ ppd_choice_t* ch = ppdFindMarkedChoice(ppd, kDuplex);
+ if (ch == NULL) {
ppd_option_t* option = ppdFindOption(ppd, kDuplex);
if (option != NULL)
- duplex_choice = ppdFindChoice(option, option->defchoice);
+ ch = ppdFindChoice(option, option->defchoice);
}
- if (duplex_choice != NULL &&
- strcmp(duplex_choice->choice, kDuplexNone) != 0)
+ if (ch != NULL && strcmp(ch->choice, kDuplexNone) != 0)
set_duplex_as_default = true;
- if (duplex_choice != NULL) {
- if (strcmp(duplex_choice->choice, kDuplexNone) != 0)
- default_duplex_setting_value = printing::LONG_EDGE;
- else
- default_duplex_setting_value = printing::SIMPLEX;
- }
-
if (supports_color) {
// Identify the color space (COLOR/CMYK) for this printer.
ppd_option_t* color_model = ppdFindOption(ppd, kColorModel);
@@ -336,6 +326,7 @@
printer_color_space = printing::CMYK;
}
}
+
ppdClose(ppd);
}
file_util::Delete(ppd_file_path, false);
@@ -354,16 +345,6 @@
std::string::npos) &&
(printer_info.printer_defaults.find(kPskTwoSided) !=
std::string::npos);
-
- if (printer_info.printer_defaults.find(kPskDuplexFeature) !=
- std::string::npos) {
- if (printer_info.printer_defaults.find(kPskTwoSided) !=
- std::string::npos) {
- default_duplex_setting_value = printing::LONG_EDGE;
- } else {
- default_duplex_setting_value = printing::SIMPLEX;
- }
- }
#else
NOTIMPLEMENTED();
#endif
@@ -378,8 +359,6 @@
}
settings_info.SetBoolean(kSetDuplexAsDefault, set_duplex_as_default);
settings_info.SetInteger(kPrinterColorModelForColor, printer_color_space);
- settings_info.SetInteger(kPrinterDefaultDuplexValue,
- default_duplex_setting_value);
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
NewRunnableMethod(this,
« no previous file with comments | « chrome/browser/resources/print_preview/print_preview.js ('k') | chrome/test/data/webui/print_preview.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698