| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "printing/print_job_constants.h" | 10 #include "printing/print_job_constants.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 color_value->assign(kCMYK); | 95 color_value->assign(kCMYK); |
| 96 break; | 96 break; |
| 97 case PROCESSCOLORMODEL_GREYSCALE: | 97 case PROCESSCOLORMODEL_GREYSCALE: |
| 98 color_setting_name->assign(kCUPSProcessColorModel); | 98 color_setting_name->assign(kCUPSProcessColorModel); |
| 99 color_value->assign(kGreyscale); | 99 color_value->assign(kGreyscale); |
| 100 break; | 100 break; |
| 101 case PROCESSCOLORMODEL_RGB: | 101 case PROCESSCOLORMODEL_RGB: |
| 102 color_setting_name->assign(kCUPSProcessColorModel); | 102 color_setting_name->assign(kCUPSProcessColorModel); |
| 103 color_value->assign(kRGB); | 103 color_value->assign(kRGB); |
| 104 break; | 104 break; |
| 105 case BROTHER_COLOR_COLOR: |
| 106 color_value->assign(kColor); |
| 107 break; |
| 108 case BROTHER_COLOR_BLACK: |
| 109 color_value->assign(kBlack); |
| 110 break; |
| 105 default: | 111 default: |
| 106 color_value->assign(kGrayscale); | 112 color_value->assign(kGrayscale); |
| 107 break; | 113 break; |
| 108 } | 114 } |
| 109 } | 115 } |
| 110 #endif // defined(USE_CUPS) | 116 #endif // defined(USE_CUPS) |
| 111 | 117 |
| 112 bool IsColorModelSelected(int color_mode) { | 118 bool IsColorModelSelected(int color_mode) { |
| 113 return (color_mode != GRAY && | 119 return (color_mode != GRAY && color_mode != BLACK && |
| 114 color_mode != BLACK && | |
| 115 color_mode != PRINTOUTMODE_NORMAL_GRAY && | 120 color_mode != PRINTOUTMODE_NORMAL_GRAY && |
| 116 color_mode != COLORMODE_MONOCHROME && | 121 color_mode != COLORMODE_MONOCHROME && |
| 117 color_mode != PROCESSCOLORMODEL_GREYSCALE && | 122 color_mode != PROCESSCOLORMODEL_GREYSCALE && |
| 118 color_mode != HP_COLOR_BLACK); | 123 color_mode != BROTHER_COLOR_BLACK && color_mode != HP_COLOR_BLACK); |
| 119 } | 124 } |
| 120 | 125 |
| 121 // Global SequenceNumber used for generating unique cookie values. | 126 // Global SequenceNumber used for generating unique cookie values. |
| 122 static base::StaticAtomicSequenceNumber cookie_seq; | 127 static base::StaticAtomicSequenceNumber cookie_seq; |
| 123 | 128 |
| 124 PrintSettings::PrintSettings() { | 129 PrintSettings::PrintSettings() { |
| 125 Clear(); | 130 Clear(); |
| 126 } | 131 } |
| 127 | 132 |
| 128 PrintSettings::PrintSettings(const PrintSettings& other) = default; | 133 PrintSettings::PrintSettings(const PrintSettings& other) = default; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 } | 248 } |
| 244 | 249 |
| 245 void PrintSettings::SetOrientation(bool landscape) { | 250 void PrintSettings::SetOrientation(bool landscape) { |
| 246 if (landscape_ != landscape) { | 251 if (landscape_ != landscape) { |
| 247 landscape_ = landscape; | 252 landscape_ = landscape; |
| 248 page_setup_device_units_.FlipOrientation(); | 253 page_setup_device_units_.FlipOrientation(); |
| 249 } | 254 } |
| 250 } | 255 } |
| 251 | 256 |
| 252 } // namespace printing | 257 } // namespace printing |
| OLD | NEW |