OLD | NEW |
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 Loading... |
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, | |
366 NA_LEDGER | 370 NA_LEDGER |
367 }; | 371 }; |
368 const gfx::Size default_media_size = GetDefaultPdfMediaSizeMicrons(); | 372 const gfx::Size default_media_size = GetDefaultPdfMediaSizeMicrons(); |
369 Media default_media( | 373 Media default_media( |
370 "", "", default_media_size.width(), default_media_size.height()); | 374 "", "", default_media_size.width(), default_media_size.height()); |
371 if (!default_media.MatchBySize() || | 375 if (!default_media.MatchBySize() || |
372 std::find(kPdfMedia, | 376 std::find(kPdfMedia, |
373 kPdfMedia + arraysize(kPdfMedia), | 377 kPdfMedia + arraysize(kPdfMedia), |
374 default_media.type) == kPdfMedia + arraysize(kPdfMedia)) { | 378 default_media.type) == kPdfMedia + arraysize(kPdfMedia)) { |
375 default_media = Media(locale == "en-US" ? NA_LETTER : ISO_A4); | 379 default_media = Media(locale == "en-US" ? NA_LETTER : ISO_A4); |
(...skipping 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1816 | 1820 |
1817 void PrintPreviewHandler::UnregisterForGaiaCookieChanges() { | 1821 void PrintPreviewHandler::UnregisterForGaiaCookieChanges() { |
1818 if (gaia_cookie_manager_service_) | 1822 if (gaia_cookie_manager_service_) |
1819 gaia_cookie_manager_service_->RemoveObserver(this); | 1823 gaia_cookie_manager_service_->RemoveObserver(this); |
1820 } | 1824 } |
1821 | 1825 |
1822 void PrintPreviewHandler::SetPdfSavedClosureForTesting( | 1826 void PrintPreviewHandler::SetPdfSavedClosureForTesting( |
1823 const base::Closure& closure) { | 1827 const base::Closure& closure) { |
1824 pdf_file_saved_closure_ = closure; | 1828 pdf_file_saved_closure_ = closure; |
1825 } | 1829 } |
OLD | NEW |