| 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;
|
|
|