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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 AddLocalizedString("title", IDS_PRINT_PREVIEW_TITLE); | 42 AddLocalizedString("title", IDS_PRINT_PREVIEW_TITLE); |
43 AddLocalizedString("loading", IDS_PRINT_PREVIEW_LOADING); | 43 AddLocalizedString("loading", IDS_PRINT_PREVIEW_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", |
| 53 IDS_PRINT_PREVIEW_INVALID_PRINTER_SETTINGS); |
52 AddLocalizedString("initiatorTabCrashed", | 54 AddLocalizedString("initiatorTabCrashed", |
53 IDS_PRINT_PREVIEW_INITIATOR_TAB_CRASHED); | 55 IDS_PRINT_PREVIEW_INITIATOR_TAB_CRASHED); |
54 AddLocalizedString("initiatorTabClosed", | 56 AddLocalizedString("initiatorTabClosed", |
55 IDS_PRINT_PREVIEW_INITIATOR_TAB_CLOSED); | 57 IDS_PRINT_PREVIEW_INITIATOR_TAB_CLOSED); |
56 AddLocalizedString("reopenPage", IDS_PRINT_PREVIEW_REOPEN_PAGE); | 58 AddLocalizedString("reopenPage", IDS_PRINT_PREVIEW_REOPEN_PAGE); |
57 | 59 |
58 AddLocalizedString("printButton", IDS_PRINT_PREVIEW_PRINT_BUTTON); | 60 AddLocalizedString("printButton", IDS_PRINT_PREVIEW_PRINT_BUTTON); |
59 AddLocalizedString("cancelButton", IDS_PRINT_PREVIEW_CANCEL_BUTTON); | 61 AddLocalizedString("cancelButton", IDS_PRINT_PREVIEW_CANCEL_BUTTON); |
60 AddLocalizedString("printing", IDS_PRINT_PREVIEW_PRINTING); | 62 AddLocalizedString("printing", IDS_PRINT_PREVIEW_PRINTING); |
61 | 63 |
(...skipping 84 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 |