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

Side by Side Diff: chrome/browser/ui/webui/print_preview/print_preview_handler.cc

Issue 1407353003: Expose more paper sizes when printing to PDF (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add more paper sizes for PDF output Created 5 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/ui/webui/print_preview/print_preview_handler.h" 5 #include "chrome/browser/ui/webui/print_preview/print_preview_handler.h"
6 6
7 #include <ctype.h> 7 #include <ctype.h>
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 352
353 ColorCapability color; 353 ColorCapability color;
354 { 354 {
355 Color standard_color(STANDARD_COLOR); 355 Color standard_color(STANDARD_COLOR);
356 standard_color.vendor_id = base::IntToString(printing::COLOR); 356 standard_color.vendor_id = base::IntToString(printing::COLOR);
357 color.AddDefaultOption(standard_color, true); 357 color.AddDefaultOption(standard_color, true);
358 } 358 }
359 color.SaveTo(&description); 359 color.SaveTo(&description);
360 360
361 static const cloud_devices::printer::MediaType kPdfMedia[] = { 361 static const cloud_devices::printer::MediaType kPdfMedia[] = {
362 ISO_A0,
363 ISO_A1,
364 ISO_A2,
365 ISO_A3,
362 ISO_A4, 366 ISO_A4,
363 ISO_A3, 367 ISO_A5,
368 NA_LEGAL,
364 NA_LETTER, 369 NA_LETTER,
365 NA_LEGAL, 370 NA_LEDGER,
366 NA_LEDGER 371 OM_UK_BUSINESS_CARD,
372 OM_US_BUSINESS_CARD
367 }; 373 };
368 const gfx::Size default_media_size = GetDefaultPdfMediaSizeMicrons(); 374 const gfx::Size default_media_size = GetDefaultPdfMediaSizeMicrons();
369 Media default_media( 375 Media default_media(
370 "", "", default_media_size.width(), default_media_size.height()); 376 "", "", default_media_size.width(), default_media_size.height());
371 if (!default_media.MatchBySize() || 377 if (!default_media.MatchBySize() ||
372 std::find(kPdfMedia, 378 std::find(kPdfMedia,
373 kPdfMedia + arraysize(kPdfMedia), 379 kPdfMedia + arraysize(kPdfMedia),
374 default_media.type) == kPdfMedia + arraysize(kPdfMedia)) { 380 default_media.type) == kPdfMedia + arraysize(kPdfMedia)) {
375 default_media = Media(locale == "en-US" ? NA_LETTER : ISO_A4); 381 default_media = Media(locale == "en-US" ? NA_LETTER : ISO_A4);
376 } 382 }
(...skipping 1439 matching lines...) Expand 10 before | Expand all | Expand 10 after
1816 1822
1817 void PrintPreviewHandler::UnregisterForGaiaCookieChanges() { 1823 void PrintPreviewHandler::UnregisterForGaiaCookieChanges() {
1818 if (gaia_cookie_manager_service_) 1824 if (gaia_cookie_manager_service_)
1819 gaia_cookie_manager_service_->RemoveObserver(this); 1825 gaia_cookie_manager_service_->RemoveObserver(this);
1820 } 1826 }
1821 1827
1822 void PrintPreviewHandler::SetPdfSavedClosureForTesting( 1828 void PrintPreviewHandler::SetPdfSavedClosureForTesting(
1823 const base::Closure& closure) { 1829 const base::Closure& closure) {
1824 pdf_file_saved_closure_ = closure; 1830 pdf_file_saved_closure_ = closure;
1825 } 1831 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698