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 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #if defined(GOOGLE_CHROME_BUILD) | 44 #if defined(GOOGLE_CHROME_BUILD) |
45 AddString("noPlugin", l10n_util::GetStringFUTF16( | 45 AddString("noPlugin", l10n_util::GetStringFUTF16( |
46 IDS_PRINT_PREVIEW_NO_PLUGIN, ASCIIToUTF16("chrome://plugins/"))); | 46 IDS_PRINT_PREVIEW_NO_PLUGIN, ASCIIToUTF16("chrome://plugins/"))); |
47 #else | 47 #else |
48 AddLocalizedString("noPlugin", IDS_PRINT_PREVIEW_NO_PLUGIN); | 48 AddLocalizedString("noPlugin", IDS_PRINT_PREVIEW_NO_PLUGIN); |
49 #endif | 49 #endif |
50 AddLocalizedString("launchNativeDialog", IDS_PRINT_PREVIEW_NATIVE_DIALOG); | 50 AddLocalizedString("launchNativeDialog", IDS_PRINT_PREVIEW_NATIVE_DIALOG); |
51 AddLocalizedString("previewFailed", IDS_PRINT_PREVIEW_FAILED); | 51 AddLocalizedString("previewFailed", IDS_PRINT_PREVIEW_FAILED); |
52 AddLocalizedString("invalidPrinterSettings", | 52 AddLocalizedString("invalidPrinterSettings", |
53 IDS_PRINT_PREVIEW_INVALID_PRINTER_SETTINGS); | 53 IDS_PRINT_PREVIEW_INVALID_PRINTER_SETTINGS); |
54 AddLocalizedString("initiatorTabCrashed", | |
55 IDS_PRINT_PREVIEW_INITIATOR_TAB_CRASHED); | |
56 AddLocalizedString("initiatorTabClosed", | |
57 IDS_PRINT_PREVIEW_INITIATOR_TAB_CLOSED); | |
58 AddLocalizedString("reopenPage", IDS_PRINT_PREVIEW_REOPEN_PAGE); | |
59 | |
60 AddLocalizedString("printButton", IDS_PRINT_PREVIEW_PRINT_BUTTON); | 54 AddLocalizedString("printButton", IDS_PRINT_PREVIEW_PRINT_BUTTON); |
61 AddLocalizedString("cancelButton", IDS_PRINT_PREVIEW_CANCEL_BUTTON); | 55 AddLocalizedString("cancelButton", IDS_PRINT_PREVIEW_CANCEL_BUTTON); |
62 AddLocalizedString("printing", IDS_PRINT_PREVIEW_PRINTING); | 56 AddLocalizedString("printing", IDS_PRINT_PREVIEW_PRINTING); |
63 AddLocalizedString("printingToPDFInProgress", | 57 AddLocalizedString("printingToPDFInProgress", |
64 IDS_PRINT_PREVIEW_PRINTING_TO_PDF_IN_PROGRESS); | 58 IDS_PRINT_PREVIEW_PRINTING_TO_PDF_IN_PROGRESS); |
65 | 59 |
66 AddLocalizedString("destinationLabel", IDS_PRINT_PREVIEW_DESTINATION_LABEL); | 60 AddLocalizedString("destinationLabel", IDS_PRINT_PREVIEW_DESTINATION_LABEL); |
67 AddLocalizedString("copiesLabel", IDS_PRINT_PREVIEW_COPIES_LABEL); | 61 AddLocalizedString("copiesLabel", IDS_PRINT_PREVIEW_COPIES_LABEL); |
68 AddLocalizedString("examplePageRangeText", | 62 AddLocalizedString("examplePageRangeText", |
69 IDS_PRINT_PREVIEW_EXAMPLE_PAGE_RANGE_TEXT); | 63 IDS_PRINT_PREVIEW_EXAMPLE_PAGE_RANGE_TEXT); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 url_substr[0], page_index, &data); | 145 url_substr[0], page_index, &data); |
152 } | 146 } |
153 if (data.get()) { | 147 if (data.get()) { |
154 SendResponse(request_id, data); | 148 SendResponse(request_id, data); |
155 return; | 149 return; |
156 } | 150 } |
157 // Invalid request. | 151 // Invalid request. |
158 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes); | 152 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes); |
159 SendResponse(request_id, empty_bytes); | 153 SendResponse(request_id, empty_bytes); |
160 } | 154 } |
OLD | NEW |