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

Unified Diff: printing/printing_context.cc

Issue 6758014: PrintPreview: Added a helper function to get print job settings from dictionary. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix mac build error. Created 9 years, 9 months 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
« no previous file with comments | « printing/printing_context.h ('k') | printing/printing_context_cairo.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/printing_context.cc
diff --git a/printing/printing_context.cc b/printing/printing_context.cc
index bc9ba210b07dc86bd67d1ad4f72d349d84639c85..390d8f02db746c1151bc1c2c9de1e335abecb0ca 100644
--- a/printing/printing_context.cc
+++ b/printing/printing_context.cc
@@ -1,9 +1,12 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "printing/printing_context.h"
+#include "base/values.h"
+#include "printing/print_job_constants.h"
+
namespace printing {
PrintingContext::PrintingContext(const std::string& app_locale)
@@ -26,6 +29,19 @@ void PrintingContext::ResetSettings() {
abort_printing_ = false;
}
+bool PrintingContext::GetSettingsFromDict(const DictionaryValue& settings,
+ bool* landscape,
+ std::string* printerName) {
+ bool ret = true;
+ if (landscape)
+ ret &= settings.GetBoolean(kSettingLandscape, landscape);
+
+ if (printerName)
+ ret &= settings.GetString(kSettingPrinterName, printerName);
+
+ return ret;
+}
+
PrintingContext::Result PrintingContext::OnError() {
ResetSettings();
return abort_printing_ ? CANCEL : FAILED;
« no previous file with comments | « printing/printing_context.h ('k') | printing/printing_context_cairo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698