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 // TODO(abodenha@chromium.org) The number of #ifdefs here has gotten too | 7 // TODO(abodenha@chromium.org) The number of #ifdefs here has gotten too |
8 // large. Refactor this code into separate files for Linux and Chrome OS. | 8 // large. Refactor this code into separate files for Linux and Chrome OS. |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 if (!job_settings.GetBoolean(kSettingLandscape, &landscape)) | 148 if (!job_settings.GetBoolean(kSettingLandscape, &landscape)) |
149 return OnError(); | 149 return OnError(); |
150 | 150 |
151 settings_.SetOrientation(landscape); | 151 settings_.SetOrientation(landscape); |
152 settings_.ranges = ranges; | 152 settings_.ranges = ranges; |
153 | 153 |
154 return OK; | 154 return OK; |
155 #else | 155 #else |
156 DCHECK(!in_print_job_); | 156 DCHECK(!in_print_job_); |
157 | 157 |
| 158 if (!print_dialog_) { |
| 159 print_dialog_ = create_dialog_func_(this); |
| 160 print_dialog_->AddRefToDialog(); |
| 161 } |
| 162 |
158 if (!print_dialog_->UpdateSettings(job_settings, ranges)) | 163 if (!print_dialog_->UpdateSettings(job_settings, ranges)) |
159 return OnError(); | 164 return OnError(); |
160 | 165 |
161 return OK; | 166 return OK; |
162 #endif | 167 #endif |
163 } | 168 } |
164 | 169 |
165 PrintingContext::Result PrintingContextCairo::InitWithSettings( | 170 PrintingContext::Result PrintingContextCairo::InitWithSettings( |
166 const PrintSettings& settings) { | 171 const PrintSettings& settings) { |
167 DCHECK(!in_print_job_); | 172 DCHECK(!in_print_job_); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 void PrintingContextCairo::ReleaseContext() { | 225 void PrintingContextCairo::ReleaseContext() { |
221 // Intentional No-op. | 226 // Intentional No-op. |
222 } | 227 } |
223 | 228 |
224 gfx::NativeDrawingContext PrintingContextCairo::context() const { | 229 gfx::NativeDrawingContext PrintingContextCairo::context() const { |
225 // Intentional No-op. | 230 // Intentional No-op. |
226 return NULL; | 231 return NULL; |
227 } | 232 } |
228 | 233 |
229 } // namespace printing | 234 } // namespace printing |
OLD | NEW |