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 18 matching lines...) Expand all Loading... |
29 AddLocalizedString("title", IDS_PRINT_PREVIEW_TITLE); | 29 AddLocalizedString("title", IDS_PRINT_PREVIEW_TITLE); |
30 AddLocalizedString("loading", IDS_PRINT_PREVIEW_LOADING); | 30 AddLocalizedString("loading", IDS_PRINT_PREVIEW_LOADING); |
31 #if defined(GOOGLE_CHROME_BUILD) | 31 #if defined(GOOGLE_CHROME_BUILD) |
32 AddString("noPlugin", l10n_util::GetStringFUTF16( | 32 AddString("noPlugin", l10n_util::GetStringFUTF16( |
33 IDS_PRINT_PREVIEW_NO_PLUGIN, ASCIIToUTF16("chrome://plugins/"))); | 33 IDS_PRINT_PREVIEW_NO_PLUGIN, ASCIIToUTF16("chrome://plugins/"))); |
34 #else | 34 #else |
35 AddLocalizedString("noPlugin", IDS_PRINT_PREVIEW_NO_PLUGIN); | 35 AddLocalizedString("noPlugin", IDS_PRINT_PREVIEW_NO_PLUGIN); |
36 #endif | 36 #endif |
37 AddLocalizedString("launchNativeDialog", IDS_PRINT_PREVIEW_NATIVE_DIALOG); | 37 AddLocalizedString("launchNativeDialog", IDS_PRINT_PREVIEW_NATIVE_DIALOG); |
38 AddLocalizedString("previewFailed", IDS_PRINT_PREVIEW_FAILED); | 38 AddLocalizedString("previewFailed", IDS_PRINT_PREVIEW_FAILED); |
| 39 AddLocalizedString("invalidPrinterSettings", |
| 40 IDS_PRINT_PREVIEW_INVALID_PRINTER_SETTINGS); |
39 AddLocalizedString("initiatorTabCrashed", | 41 AddLocalizedString("initiatorTabCrashed", |
40 IDS_PRINT_PREVIEW_INITIATOR_TAB_CRASHED); | 42 IDS_PRINT_PREVIEW_INITIATOR_TAB_CRASHED); |
41 AddLocalizedString("initiatorTabClosed", | 43 AddLocalizedString("initiatorTabClosed", |
42 IDS_PRINT_PREVIEW_INITIATOR_TAB_CLOSED); | 44 IDS_PRINT_PREVIEW_INITIATOR_TAB_CLOSED); |
43 AddLocalizedString("reopenPage", IDS_PRINT_PREVIEW_REOPEN_PAGE); | 45 AddLocalizedString("reopenPage", IDS_PRINT_PREVIEW_REOPEN_PAGE); |
44 | 46 |
45 AddLocalizedString("printButton", IDS_PRINT_PREVIEW_PRINT_BUTTON); | 47 AddLocalizedString("printButton", IDS_PRINT_PREVIEW_PRINT_BUTTON); |
46 AddLocalizedString("cancelButton", IDS_PRINT_PREVIEW_CANCEL_BUTTON); | 48 AddLocalizedString("cancelButton", IDS_PRINT_PREVIEW_CANCEL_BUTTON); |
47 AddLocalizedString("printing", IDS_PRINT_PREVIEW_PRINTING); | 49 AddLocalizedString("printing", IDS_PRINT_PREVIEW_PRINTING); |
48 | 50 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 url_substr[0], page_index, &data); | 132 url_substr[0], page_index, &data); |
131 } | 133 } |
132 if (data.get()) { | 134 if (data.get()) { |
133 SendResponse(request_id, data); | 135 SendResponse(request_id, data); |
134 return; | 136 return; |
135 } | 137 } |
136 // Invalid request. | 138 // Invalid request. |
137 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes); | 139 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes); |
138 SendResponse(request_id, empty_bytes); | 140 SendResponse(request_id, empty_bytes); |
139 } | 141 } |
OLD | NEW |