| 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/logging.h" | 9 #include "base/logging.h" |
| 9 #include "printing/print_job_constants.h" | 10 #include "printing/print_job_constants.h" |
| 10 #include "printing/units.h" | 11 #include "printing/units.h" |
| 11 | 12 |
| 12 namespace printing { | 13 namespace printing { |
| 13 | 14 |
| 15 base::LazyInstance<std::string> g_user_agent; |
| 16 |
| 17 void SetAgent(const std::string& user_agent) { |
| 18 g_user_agent.Get() = user_agent; |
| 19 } |
| 20 |
| 21 const std::string& GetAgent() { |
| 22 return g_user_agent.Get(); |
| 23 } |
| 24 |
| 14 #if defined(USE_CUPS) | 25 #if defined(USE_CUPS) |
| 15 void GetColorModelForMode( | 26 void GetColorModelForMode( |
| 16 int color_mode, std::string* color_setting_name, std::string* color_value) { | 27 int color_mode, std::string* color_setting_name, std::string* color_value) { |
| 17 #if defined(OS_MACOSX) | 28 #if defined(OS_MACOSX) |
| 18 const char kCUPSColorMode[] = "ColorMode"; | 29 const char kCUPSColorMode[] = "ColorMode"; |
| 19 const char kCUPSColorModel[] = "ColorModel"; | 30 const char kCUPSColorModel[] = "ColorModel"; |
| 20 const char kCUPSPrintoutMode[] = "PrintoutMode"; | 31 const char kCUPSPrintoutMode[] = "PrintoutMode"; |
| 21 const char kCUPSProcessColorModel[] = "ProcessColorModel"; | 32 const char kCUPSProcessColorModel[] = "ProcessColorModel"; |
| 22 #else | 33 #else |
| 23 const char kCUPSColorMode[] = "cups-ColorMode"; | 34 const char kCUPSColorMode[] = "cups-ColorMode"; |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 } | 237 } |
| 227 | 238 |
| 228 void PrintSettings::SetOrientation(bool landscape) { | 239 void PrintSettings::SetOrientation(bool landscape) { |
| 229 if (landscape_ != landscape) { | 240 if (landscape_ != landscape) { |
| 230 landscape_ = landscape; | 241 landscape_ = landscape; |
| 231 page_setup_device_units_.FlipOrientation(); | 242 page_setup_device_units_.FlipOrientation(); |
| 232 } | 243 } |
| 233 } | 244 } |
| 234 | 245 |
| 235 } // namespace printing | 246 } // namespace printing |
| OLD | NEW |