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

Side by Side Diff: printing/print_settings.cc

Issue 8496004: Linux: Don't call printing::GetColorModelForMode() when USE_CUPS is not defined. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "printing/print_settings.h" 5 #include "printing/print_settings.h"
6 6
7 #include "base/atomic_sequence_num.h" 7 #include "base/atomic_sequence_num.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "printing/print_job_constants.h" 9 #include "printing/print_job_constants.h"
10 #include "printing/units.h" 10 #include "printing/units.h"
11 11
12 namespace printing { 12 namespace printing {
13 13
14 #if defined (USE_CUPS) 14 #if defined(USE_CUPS)
15 void GetColorModelForMode( 15 void GetColorModelForMode(
16 int color_mode, std::string* color_setting_name, std::string* color_value) { 16 int color_mode, std::string* color_setting_name, std::string* color_value) {
17 #if defined(OS_MACOSX) 17 #if defined(OS_MACOSX)
18 const char kCUPSColorMode[] = "ColorMode"; 18 const char kCUPSColorMode[] = "ColorMode";
19 const char kCUPSColorModel[] = "ColorModel"; 19 const char kCUPSColorModel[] = "ColorModel";
20 const char kCUPSPrintoutMode[] = "PrintoutMode"; 20 const char kCUPSPrintoutMode[] = "PrintoutMode";
21 const char kCUPSProcessColorModel[] = "ProcessColorModel"; 21 const char kCUPSProcessColorModel[] = "ProcessColorModel";
22 #else 22 #else
23 const char kCUPSColorMode[] = "cups-ColorMode"; 23 const char kCUPSColorMode[] = "cups-ColorMode";
24 const char kCUPSColorModel[] = "cups-ColorModel"; 24 const char kCUPSColorModel[] = "cups-ColorModel";
25 const char kCUPSPrintoutMode[] = "cups-PrintoutMode"; 25 const char kCUPSPrintoutMode[] = "cups-PrintoutMode";
26 const char kCUPSProcessColorModel[] = "cups-ProcessColorModel"; 26 const char kCUPSProcessColorModel[] = "cups-ProcessColorModel";
27 #endif 27 #endif // defined(OS_MACOSX)
28 28
29 color_setting_name->assign(kCUPSColorModel); 29 color_setting_name->assign(kCUPSColorModel);
30 switch (color_mode) { 30 switch (color_mode) {
31 case COLOR: 31 case COLOR:
32 color_value->assign(kColor); 32 color_value->assign(kColor);
33 break; 33 break;
34 case CMYK: 34 case CMYK:
35 color_value->assign(kCMYK); 35 color_value->assign(kCMYK);
36 break; 36 break;
37 case PRINTOUTMODE_NORMAL: 37 case PRINTOUTMODE_NORMAL:
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 break; 89 break;
90 case PROCESSCOLORMODEL_RGB: 90 case PROCESSCOLORMODEL_RGB:
91 color_setting_name->assign(kCUPSProcessColorModel); 91 color_setting_name->assign(kCUPSProcessColorModel);
92 color_value->assign(kRGB); 92 color_value->assign(kRGB);
93 break; 93 break;
94 default: 94 default:
95 color_value->assign(kGrayscale); 95 color_value->assign(kGrayscale);
96 break; 96 break;
97 } 97 }
98 } 98 }
99 #endif 99 #endif // defined(USE_CUPS)
100 100
101 bool isColorModelSelected(int model) { 101 bool isColorModelSelected(int model) {
102 return (model != GRAY && 102 return (model != GRAY &&
103 model != BLACK && 103 model != BLACK &&
104 model != PRINTOUTMODE_NORMAL_GRAY && 104 model != PRINTOUTMODE_NORMAL_GRAY &&
105 model != COLORMODE_MONOCHROME && 105 model != COLORMODE_MONOCHROME &&
106 model != PROCESSCOLORMODEL_GREYSCALE && 106 model != PROCESSCOLORMODEL_GREYSCALE &&
107 model != HP_COLOR_BLACK); 107 model != HP_COLOR_BLACK);
108 } 108 }
109 109
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 } 240 }
241 241
242 void PrintSettings::SetOrientation(bool landscape) { 242 void PrintSettings::SetOrientation(bool landscape) {
243 if (landscape_ != landscape) { 243 if (landscape_ != landscape) {
244 landscape_ = landscape; 244 landscape_ = landscape;
245 page_setup_device_units_.FlipOrientation(); 245 page_setup_device_units_.FlipOrientation();
246 } 246 }
247 } 247 }
248 248
249 } // namespace printing 249 } // namespace printing
OLDNEW
« chrome/browser/printing/print_dialog_gtk.cc ('K') | « printing/print_settings.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698