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

Side by Side Diff: printing/printing_context_win.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, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « printing/printing_context_mac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_win.h" 5 #include "printing/printing_context_win.h"
6 6
7 #include <winspool.h> 7 #include <winspool.h>
8 8
9 #include "base/i18n/file_util_icu.h" 9 #include "base/i18n/file_util_icu.h"
10 #include "base/i18n/time_formatting.h" 10 #include "base/i18n/time_formatting.h"
11 #include "base/message_loop.h" 11 #include "base/message_loop.h"
12 #include "base/time.h" 12 #include "base/time.h"
13 #include "base/utf_string_conversions.h" 13 #include "base/utf_string_conversions.h"
14 #include "base/values.h" 14 #include "base/values.h"
15 #include "printing/print_job_constants.h"
16 #include "printing/print_settings_initializer_win.h" 15 #include "printing/print_settings_initializer_win.h"
17 #include "printing/printed_document.h" 16 #include "printing/printed_document.h"
18 #include "skia/ext/platform_device_win.h" 17 #include "skia/ext/platform_device_win.h"
19 18
20 using base::Time; 19 using base::Time;
21 20
22 namespace printing { 21 namespace printing {
23 22
24 class PrintingContextWin::CallbackHandler : public IPrintDialogCallback, 23 class PrintingContextWin::CallbackHandler : public IPrintDialogCallback,
25 public IObjectWithSite { 24 public IObjectWithSite {
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 return FAILED; 207 return FAILED;
209 } 208 }
210 return ParseDialogResult(dialog_options); 209 return ParseDialogResult(dialog_options);
211 } 210 }
212 211
213 PrintingContext::Result PrintingContextWin::UpdatePrintSettings( 212 PrintingContext::Result PrintingContextWin::UpdatePrintSettings(
214 const DictionaryValue& job_settings, const PageRanges& ranges) { 213 const DictionaryValue& job_settings, const PageRanges& ranges) {
215 DCHECK(!in_print_job_); 214 DCHECK(!in_print_job_);
216 215
217 bool landscape; 216 bool landscape;
218 if (!job_settings.GetBoolean(kSettingLandscape, &landscape)) 217 if (!GetSettingsFromDict(job_settings, &landscape, NULL))
219 return OnError(); 218 return OnError();
219
220 settings_.SetOrientation(landscape); 220 settings_.SetOrientation(landscape);
221 221
222 // TODO(kmadhusu): Update other print settings such as number of copies, 222 // TODO(kmadhusu): Update other print settings such as number of copies,
223 // collate, duplex printing, job title, etc., 223 // collate, duplex printing, job title, etc.,
224 224
225 settings_.ranges = ranges; 225 settings_.ranges = ranges;
226 226
227 return OK; 227 return OK;
228 } 228 }
229 229
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 if (buf_size) { 618 if (buf_size) {
619 buffer->reset(new uint8[buf_size]); 619 buffer->reset(new uint8[buf_size]);
620 memset(buffer->get(), 0, buf_size); 620 memset(buffer->get(), 0, buf_size);
621 if (!GetPrinter(printer, level, buffer->get(), buf_size, &buf_size)) { 621 if (!GetPrinter(printer, level, buffer->get(), buf_size, &buf_size)) {
622 buffer->reset(); 622 buffer->reset();
623 } 623 }
624 } 624 }
625 } 625 }
626 626
627 } // namespace printing 627 } // namespace printing
OLDNEW
« no previous file with comments | « printing/printing_context_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698