| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 IDS_PRINT_PREVIEW_INVALID_PRINTER_SETTINGS); | 53 IDS_PRINT_PREVIEW_INVALID_PRINTER_SETTINGS); |
| 54 AddLocalizedString("initiatorTabCrashed", | 54 AddLocalizedString("initiatorTabCrashed", |
| 55 IDS_PRINT_PREVIEW_INITIATOR_TAB_CRASHED); | 55 IDS_PRINT_PREVIEW_INITIATOR_TAB_CRASHED); |
| 56 AddLocalizedString("initiatorTabClosed", | 56 AddLocalizedString("initiatorTabClosed", |
| 57 IDS_PRINT_PREVIEW_INITIATOR_TAB_CLOSED); | 57 IDS_PRINT_PREVIEW_INITIATOR_TAB_CLOSED); |
| 58 AddLocalizedString("reopenPage", IDS_PRINT_PREVIEW_REOPEN_PAGE); | 58 AddLocalizedString("reopenPage", IDS_PRINT_PREVIEW_REOPEN_PAGE); |
| 59 | 59 |
| 60 AddLocalizedString("printButton", IDS_PRINT_PREVIEW_PRINT_BUTTON); | 60 AddLocalizedString("printButton", IDS_PRINT_PREVIEW_PRINT_BUTTON); |
| 61 AddLocalizedString("cancelButton", IDS_PRINT_PREVIEW_CANCEL_BUTTON); | 61 AddLocalizedString("cancelButton", IDS_PRINT_PREVIEW_CANCEL_BUTTON); |
| 62 AddLocalizedString("printing", IDS_PRINT_PREVIEW_PRINTING); | 62 AddLocalizedString("printing", IDS_PRINT_PREVIEW_PRINTING); |
| 63 AddLocalizedString("printingToPDFInProgress", |
| 64 IDS_PRINT_PREVIEW_PRINTING_TO_PDF_IN_PROGRESS); |
| 63 | 65 |
| 64 AddLocalizedString("destinationLabel", IDS_PRINT_PREVIEW_DESTINATION_LABEL); | 66 AddLocalizedString("destinationLabel", IDS_PRINT_PREVIEW_DESTINATION_LABEL); |
| 65 AddLocalizedString("copiesLabel", IDS_PRINT_PREVIEW_COPIES_LABEL); | 67 AddLocalizedString("copiesLabel", IDS_PRINT_PREVIEW_COPIES_LABEL); |
| 66 AddLocalizedString("examplePageRangeText", | 68 AddLocalizedString("examplePageRangeText", |
| 67 IDS_PRINT_PREVIEW_EXAMPLE_PAGE_RANGE_TEXT); | 69 IDS_PRINT_PREVIEW_EXAMPLE_PAGE_RANGE_TEXT); |
| 68 AddLocalizedString("layoutLabel", IDS_PRINT_PREVIEW_LAYOUT_LABEL); | 70 AddLocalizedString("layoutLabel", IDS_PRINT_PREVIEW_LAYOUT_LABEL); |
| 69 AddLocalizedString("optionAllPages", IDS_PRINT_PREVIEW_OPTION_ALL_PAGES); | 71 AddLocalizedString("optionAllPages", IDS_PRINT_PREVIEW_OPTION_ALL_PAGES); |
| 70 AddLocalizedString("optionBw", IDS_PRINT_PREVIEW_OPTION_BW); | 72 AddLocalizedString("optionBw", IDS_PRINT_PREVIEW_OPTION_BW); |
| 71 AddLocalizedString("optionCollate", IDS_PRINT_PREVIEW_OPTION_COLLATE); | 73 AddLocalizedString("optionCollate", IDS_PRINT_PREVIEW_OPTION_COLLATE); |
| 72 AddLocalizedString("optionColor", IDS_PRINT_PREVIEW_OPTION_COLOR); | 74 AddLocalizedString("optionColor", IDS_PRINT_PREVIEW_OPTION_COLOR); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 url_substr[0], page_index, &data); | 148 url_substr[0], page_index, &data); |
| 147 } | 149 } |
| 148 if (data.get()) { | 150 if (data.get()) { |
| 149 SendResponse(request_id, data); | 151 SendResponse(request_id, data); |
| 150 return; | 152 return; |
| 151 } | 153 } |
| 152 // Invalid request. | 154 // Invalid request. |
| 153 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes); | 155 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes); |
| 154 SendResponse(request_id, empty_bytes); | 156 SendResponse(request_id, empty_bytes); |
| 155 } | 157 } |
| OLD | NEW |