| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/printing_context_cairo.h" | 5 #include "printing/printing_context_cairo.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "printing/print_job_constants.h" | |
| 10 #include "printing/print_settings_initializer_gtk.h" | 9 #include "printing/print_settings_initializer_gtk.h" |
| 11 #include "printing/units.h" | 10 #include "printing/units.h" |
| 12 | 11 |
| 13 #if defined(OS_CHROMEOS) | 12 #if defined(OS_CHROMEOS) |
| 14 #include <unicode/ulocdata.h> | 13 #include <unicode/ulocdata.h> |
| 15 #else | 14 #else |
| 16 #include <gtk/gtk.h> | 15 #include <gtk/gtk.h> |
| 17 #include <gtk/gtkprintunixdialog.h> | 16 #include <gtk/gtkprintunixdialog.h> |
| 18 #endif // defined(OS_CHROMEOS) | 17 #endif // defined(OS_CHROMEOS) |
| 19 | 18 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 #endif // defined(OS_CHROMEOS) | 146 #endif // defined(OS_CHROMEOS) |
| 148 | 147 |
| 149 return OK; | 148 return OK; |
| 150 } | 149 } |
| 151 | 150 |
| 152 PrintingContext::Result PrintingContextCairo::UpdatePrintSettings( | 151 PrintingContext::Result PrintingContextCairo::UpdatePrintSettings( |
| 153 const DictionaryValue& job_settings, const PageRanges& ranges) { | 152 const DictionaryValue& job_settings, const PageRanges& ranges) { |
| 154 DCHECK(!in_print_job_); | 153 DCHECK(!in_print_job_); |
| 155 | 154 |
| 156 bool landscape; | 155 bool landscape; |
| 157 if (!job_settings.GetBoolean(kSettingLandscape, &landscape)) | 156 if (!GetSettingsFromDict(job_settings, &landscape, NULL)) |
| 158 return OnError(); | 157 return OnError(); |
| 158 |
| 159 settings_.SetOrientation(landscape); | 159 settings_.SetOrientation(landscape); |
| 160 | |
| 161 settings_.ranges = ranges; | 160 settings_.ranges = ranges; |
| 162 | 161 |
| 163 // TODO(kmadhusu): Update other print settings such as number of copies, | 162 // TODO(kmadhusu): Update other print settings such as number of copies, |
| 164 // collate, duplex printing, etc., | 163 // collate, duplex printing, etc., |
| 165 | 164 |
| 166 return OK; | 165 return OK; |
| 167 } | 166 } |
| 168 | 167 |
| 169 PrintingContext::Result PrintingContextCairo::InitWithSettings( | 168 PrintingContext::Result PrintingContextCairo::InitWithSettings( |
| 170 const PrintSettings& settings) { | 169 const PrintSettings& settings) { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 void PrintingContextCairo::ReleaseContext() { | 223 void PrintingContextCairo::ReleaseContext() { |
| 225 // Intentional No-op. | 224 // Intentional No-op. |
| 226 } | 225 } |
| 227 | 226 |
| 228 gfx::NativeDrawingContext PrintingContextCairo::context() const { | 227 gfx::NativeDrawingContext PrintingContextCairo::context() const { |
| 229 // Intentional No-op. | 228 // Intentional No-op. |
| 230 return NULL; | 229 return NULL; |
| 231 } | 230 } |
| 232 | 231 |
| 233 } // namespace printing | 232 } // namespace printing |
| OLD | NEW |