| OLD | NEW |
| 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 "chrome/browser/ui/webui/print_preview_data_source.h" | 5 #include "chrome/browser/ui/webui/print_preview_data_source.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 AddLocalizedString("printPreviewSummaryFormatLong", | 70 AddLocalizedString("printPreviewSummaryFormatLong", |
| 71 IDS_PRINT_PREVIEW_SUMMARY_FORMAT_LONG); | 71 IDS_PRINT_PREVIEW_SUMMARY_FORMAT_LONG); |
| 72 AddLocalizedString("printPreviewSheetsLabelSingular", | 72 AddLocalizedString("printPreviewSheetsLabelSingular", |
| 73 IDS_PRINT_PREVIEW_SHEETS_LABEL_SINGULAR); | 73 IDS_PRINT_PREVIEW_SHEETS_LABEL_SINGULAR); |
| 74 AddLocalizedString("printPreviewSheetsLabelPlural", | 74 AddLocalizedString("printPreviewSheetsLabelPlural", |
| 75 IDS_PRINT_PREVIEW_SHEETS_LABEL_PLURAL); | 75 IDS_PRINT_PREVIEW_SHEETS_LABEL_PLURAL); |
| 76 AddLocalizedString("printPreviewPageLabelSingular", | 76 AddLocalizedString("printPreviewPageLabelSingular", |
| 77 IDS_PRINT_PREVIEW_PAGE_LABEL_SINGULAR); | 77 IDS_PRINT_PREVIEW_PAGE_LABEL_SINGULAR); |
| 78 AddLocalizedString("printPreviewPageLabelPlural", | 78 AddLocalizedString("printPreviewPageLabelPlural", |
| 79 IDS_PRINT_PREVIEW_PAGE_LABEL_PLURAL); | 79 IDS_PRINT_PREVIEW_PAGE_LABEL_PLURAL); |
| 80 AddLocalizedString("systemDialogOption", | 80 AddString("systemDialogOption", l10n_util::GetStringFUTF16( |
| 81 IDS_PRINT_PREVIEW_SYSTEM_DIALOG_OPTION); | 81 IDS_PRINT_PREVIEW_SYSTEM_DIALOG_OPTION, |
| 82 l10n_util::GetStringUTF16(IDS_PRINT_PREVIEW_ADVANCED_SHORTCUT_KEY))); |
| 82 AddLocalizedString("pageRangeInstruction", | 83 AddLocalizedString("pageRangeInstruction", |
| 83 IDS_PRINT_PREVIEW_PAGE_RANGE_INSTRUCTION); | 84 IDS_PRINT_PREVIEW_PAGE_RANGE_INSTRUCTION); |
| 84 AddLocalizedString("copiesInstruction", IDS_PRINT_PREVIEW_COPIES_INSTRUCTION); | 85 AddLocalizedString("copiesInstruction", IDS_PRINT_PREVIEW_COPIES_INSTRUCTION); |
| 85 AddLocalizedString("signIn", IDS_PRINT_PREVIEW_SIGN_IN); | 86 AddLocalizedString("signIn", IDS_PRINT_PREVIEW_SIGN_IN); |
| 86 AddLocalizedString("morePrinters", IDS_PRINT_PREVIEW_MORE_PRINTERS); | 87 AddLocalizedString("morePrinters", IDS_PRINT_PREVIEW_MORE_PRINTERS); |
| 87 AddLocalizedString("addCloudPrinter", IDS_PRINT_PREVIEW_ADD_CLOUD_PRINTER); | 88 AddLocalizedString("addCloudPrinter", IDS_PRINT_PREVIEW_ADD_CLOUD_PRINTER); |
| 88 AddLocalizedString("cloudPrinters", IDS_PRINT_PREVIEW_CLOUD_PRINTERS); | 89 AddLocalizedString("cloudPrinters", IDS_PRINT_PREVIEW_CLOUD_PRINTERS); |
| 89 AddLocalizedString("localPrinters", IDS_PRINT_PREVIEW_LOCAL_PRINTERS); | 90 AddLocalizedString("localPrinters", IDS_PRINT_PREVIEW_LOCAL_PRINTERS); |
| 90 AddLocalizedString("manageCloudPrinters", | 91 AddLocalizedString("manageCloudPrinters", |
| 91 IDS_PRINT_PREVIEW_MANAGE_CLOUD_PRINTERS); | 92 IDS_PRINT_PREVIEW_MANAGE_CLOUD_PRINTERS); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 url_substr[0], page_index, &data); | 127 url_substr[0], page_index, &data); |
| 127 } | 128 } |
| 128 if (data.get()) { | 129 if (data.get()) { |
| 129 SendResponse(request_id, data); | 130 SendResponse(request_id, data); |
| 130 return; | 131 return; |
| 131 } | 132 } |
| 132 // Invalid request. | 133 // Invalid request. |
| 133 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes); | 134 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes); |
| 134 SendResponse(request_id, empty_bytes); | 135 SendResponse(request_id, empty_bytes); |
| 135 } | 136 } |
| OLD | NEW |