Skip to content

Commit

Permalink
Linux: Don't call printing::GetColorModelForMode() when USE_CUPS is n…
Browse files Browse the repository at this point in the history
…ot defined.

BUG=103183
TEST=none

Review URL: http://codereview.chromium.org/8496004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109091 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
thestig@chromium.org committed Nov 8, 2011
1 parent 4b3d192 commit fa879e5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions chrome/browser/printing/print_dialog_gtk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ bool PrintDialogGtk::UpdateSettings(const DictionaryValue& job_settings,
gtk_print_settings_set_n_copies(gtk_settings_, copies);
gtk_print_settings_set_collate(gtk_settings_, collate);

#if defined(USE_CUPS)
std::string color_value;
std::string color_setting_name;
printing::GetColorModelForMode(color, &color_setting_name, &color_value);
Expand All @@ -214,6 +215,7 @@ bool PrintDialogGtk::UpdateSettings(const DictionaryValue& job_settings,
break;
}
gtk_print_settings_set(gtk_settings_, kCUPSDuplex, cups_duplex_mode);
#endif
}
}
if (!page_setup_)
Expand Down
6 changes: 3 additions & 3 deletions printing/print_settings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace printing {

#if defined (USE_CUPS)
#if defined(USE_CUPS)
void GetColorModelForMode(
int color_mode, std::string* color_setting_name, std::string* color_value) {
#if defined(OS_MACOSX)
Expand All @@ -24,7 +24,7 @@ void GetColorModelForMode(
const char kCUPSColorModel[] = "cups-ColorModel";
const char kCUPSPrintoutMode[] = "cups-PrintoutMode";
const char kCUPSProcessColorModel[] = "cups-ProcessColorModel";
#endif
#endif // defined(OS_MACOSX)

color_setting_name->assign(kCUPSColorModel);
switch (color_mode) {
Expand Down Expand Up @@ -96,7 +96,7 @@ void GetColorModelForMode(
break;
}
}
#endif
#endif // defined(USE_CUPS)

bool isColorModelSelected(int model) {
return (model != GRAY &&
Expand Down
10 changes: 5 additions & 5 deletions printing/print_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ namespace printing {
// Returns true if color model is selected.
PRINTING_EXPORT bool isColorModelSelected(int model);

#if defined (USE_CUPS)
// Get the color model setting name and value for the |color_mode|.
PRINTING_EXPORT void GetColorModelForMode(int color_mode,
std::string* color_setting_name,
std::string* color_value);
#if defined(USE_CUPS)
// Get the color model setting name and value for the |color_mode|.
PRINTING_EXPORT void GetColorModelForMode(int color_mode,
std::string* color_setting_name,
std::string* color_value);
#endif

// OS-independent print settings.
Expand Down

0 comments on commit fa879e5

Please sign in to comment.