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

Unified Diff: printing/print_settings.cc

Issue 1397333003: PDF Printing: embed browser user agent string in PDF metadata. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2015-11-05 (Thursday) 17:13:38 EST Created 5 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 side-by-side diff with in-line comments
Download patch
« printing/pdf_metafile_skia.cc ('K') | « printing/print_settings.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/print_settings.cc
diff --git a/printing/print_settings.cc b/printing/print_settings.cc
index b1c50c9e372bf9fa0008e1b1a568323ee995e906..1e1c543bd8be81e8d611c0efbb010fbf88aaf036 100644
--- a/printing/print_settings.cc
+++ b/printing/print_settings.cc
@@ -5,12 +5,21 @@
#include "printing/print_settings.h"
#include "base/atomic_sequence_num.h"
+#include "base/lazy_instance.h"
#include "base/logging.h"
#include "printing/print_job_constants.h"
#include "printing/units.h"
namespace printing {
+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
+void SetAgent(const std::string& user_agent) {
+ g_user_agent.Get() = user_agent;
+}
+const std::string& GetAgent() {
+ return g_user_agent.Get();
+}
+
#if defined(USE_CUPS)
void GetColorModelForMode(
int color_mode, std::string* color_setting_name, std::string* color_value) {
« printing/pdf_metafile_skia.cc ('K') | « printing/print_settings.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698