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

Side by Side Diff: printing/printing_context_win.cc

Issue 8122006: Fix lack of preview when GCP printer is selected. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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
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 <algorithm> 9 #include <algorithm>
10 10
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 !job_settings.GetBoolean(kSettingCollate, &collate) || 338 !job_settings.GetBoolean(kSettingCollate, &collate) ||
339 !job_settings.GetInteger(kSettingColor, &color) || 339 !job_settings.GetInteger(kSettingColor, &color) ||
340 !job_settings.GetBoolean(kSettingPrintToPDF, &print_to_pdf) || 340 !job_settings.GetBoolean(kSettingPrintToPDF, &print_to_pdf) ||
341 !job_settings.GetInteger(kSettingDuplexMode, &duplex_mode) || 341 !job_settings.GetInteger(kSettingDuplexMode, &duplex_mode) ||
342 !job_settings.GetInteger(kSettingCopies, &copies) || 342 !job_settings.GetInteger(kSettingCopies, &copies) ||
343 !job_settings.GetString(kSettingDeviceName, &device_name)) { 343 !job_settings.GetString(kSettingDeviceName, &device_name)) {
344 return OnError(); 344 return OnError();
345 } 345 }
346 346
347 bool print_to_cloud = job_settings.HasKey(printing::kSettingCloudPrintId); 347 bool print_to_cloud = job_settings.HasKey(printing::kSettingCloudPrintId);
348 bool is_cloud_dialog = false;
349 job_settings.GetBoolean(printing::kSettingCloudPrintDialog, &is_cloud_dialog);
kmadhusu 2011/10/03 22:15:10 same here.
Albert Bodenhamer 2011/10/03 22:38:39 Done.
348 350
349 if (print_to_pdf || print_to_cloud) { 351 if (print_to_pdf || print_to_cloud || is_cloud_dialog) {
350 // Default fallback to Letter size. 352 // Default fallback to Letter size.
351 gfx::Size paper_size; 353 gfx::Size paper_size;
352 gfx::Rect paper_rect; 354 gfx::Rect paper_rect;
353 paper_size.SetSize(kPDFLetterWidth, kPDFLetterHeight); 355 paper_size.SetSize(kPDFLetterWidth, kPDFLetterHeight);
354 356
355 // Get settings from locale. Paper type buffer length is at most 4. 357 // Get settings from locale. Paper type buffer length is at most 4.
356 const int paper_type_buffer_len = 4; 358 const int paper_type_buffer_len = 4;
357 wchar_t paper_type_buffer[paper_type_buffer_len] = {0}; 359 wchar_t paper_type_buffer[paper_type_buffer_len] = {0};
358 GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_IPAPERSIZE, paper_type_buffer, 360 GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_IPAPERSIZE, paper_type_buffer,
359 paper_type_buffer_len); 361 paper_type_buffer_len);
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 if (buf_size) { 811 if (buf_size) {
810 buffer->reset(new uint8[buf_size]); 812 buffer->reset(new uint8[buf_size]);
811 memset(buffer->get(), 0, buf_size); 813 memset(buffer->get(), 0, buf_size);
812 if (!GetPrinter(printer, level, buffer->get(), buf_size, &buf_size)) { 814 if (!GetPrinter(printer, level, buffer->get(), buf_size, &buf_size)) {
813 buffer->reset(); 815 buffer->reset();
814 } 816 }
815 } 817 }
816 } 818 }
817 819
818 } // namespace printing 820 } // namespace printing
OLDNEW
« printing/printing_context_mac.mm ('K') | « printing/printing_context_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698