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