Chromium Code Reviews| Index: printing/printing_context.cc |
| diff --git a/printing/printing_context.cc b/printing/printing_context.cc |
| index bc9ba210b07dc86bd67d1ad4f72d349d84639c85..a934e43c2b40427b3524a374c51695566f4ea559 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, |
| + string16* printerName) { |
| + bool ret = true; |
| + if (landscape) |
| + ret &= (settings.GetBoolean(kSettingLandscape, landscape)); |
|
Lei Zhang
2011/03/30 22:12:00
nit: you probably don't need to outer parenthesis,
kmadhusu
2011/03/30 22:18:47
Done.
|
| + |
| + if (printerName) |
| + ret &= (settings.GetString(kSettingPrinterName, printerName)); |
| + |
| + return ret; |
| +} |
| + |
| PrintingContext::Result PrintingContext::OnError() { |
| ResetSettings(); |
| return abort_printing_ ? CANCEL : FAILED; |