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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 | 323 |
324 static const cloud_devices::printer::MediaType kPdfMedia[] = { | 324 static const cloud_devices::printer::MediaType kPdfMedia[] = { |
325 ISO_A4, | 325 ISO_A4, |
326 ISO_A3, | 326 ISO_A3, |
327 NA_LETTER, | 327 NA_LETTER, |
328 NA_LEGAL, | 328 NA_LEGAL, |
329 NA_LEDGER | 329 NA_LEDGER |
330 }; | 330 }; |
331 const gfx::Size default_media_size = GetDefaultPdfMediaSizeMicrons(); | 331 const gfx::Size default_media_size = GetDefaultPdfMediaSizeMicrons(); |
332 Media default_media( | 332 Media default_media( |
333 "", default_media_size.width(), default_media_size.height()); | 333 "", "", default_media_size.width(), default_media_size.height()); |
334 if (!default_media.MatchBySize() || | 334 if (!default_media.MatchBySize() || |
335 std::find(kPdfMedia, | 335 std::find(kPdfMedia, |
336 kPdfMedia + arraysize(kPdfMedia), | 336 kPdfMedia + arraysize(kPdfMedia), |
337 default_media.type) == kPdfMedia + arraysize(kPdfMedia)) { | 337 default_media.type) == kPdfMedia + arraysize(kPdfMedia)) { |
338 default_media = Media(locale == "en-US" ? NA_LETTER : ISO_A4); | 338 default_media = Media(locale == "en-US" ? NA_LETTER : ISO_A4); |
339 } | 339 } |
340 MediaCapability media; | 340 MediaCapability media; |
341 for (size_t i = 0; i < arraysize(kPdfMedia); ++i) { | 341 for (size_t i = 0; i < arraysize(kPdfMedia); ++i) { |
342 Media media_option(kPdfMedia[i]); | 342 Media media_option(kPdfMedia[i]); |
343 media.AddDefaultOption(media_option, | 343 media.AddDefaultOption(media_option, |
(...skipping 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1580 printer_value->SetString("name", description.name); | 1580 printer_value->SetString("name", description.name); |
1581 printer_value->SetBoolean("hasLocalPrinting", has_local_printing); | 1581 printer_value->SetBoolean("hasLocalPrinting", has_local_printing); |
1582 printer_value->SetBoolean( | 1582 printer_value->SetBoolean( |
1583 "isUnregistered", | 1583 "isUnregistered", |
1584 description.id.empty() && | 1584 description.id.empty() && |
1585 command_line->HasSwitch(switches::kEnablePrintPreviewRegisterPromos)); | 1585 command_line->HasSwitch(switches::kEnablePrintPreviewRegisterPromos)); |
1586 printer_value->SetString("cloudID", description.id); | 1586 printer_value->SetString("cloudID", description.id); |
1587 } | 1587 } |
1588 | 1588 |
1589 #endif // defined(ENABLE_SERVICE_DISCOVERY) | 1589 #endif // defined(ENABLE_SERVICE_DISCOVERY) |
OLD | NEW |