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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 IDS_PRINT_PREVIEW_SUMMARY_FORMAT_LONG); | 86 IDS_PRINT_PREVIEW_SUMMARY_FORMAT_LONG); |
87 AddLocalizedString("printPreviewSheetsLabelSingular", | 87 AddLocalizedString("printPreviewSheetsLabelSingular", |
88 IDS_PRINT_PREVIEW_SHEETS_LABEL_SINGULAR); | 88 IDS_PRINT_PREVIEW_SHEETS_LABEL_SINGULAR); |
89 AddLocalizedString("printPreviewSheetsLabelPlural", | 89 AddLocalizedString("printPreviewSheetsLabelPlural", |
90 IDS_PRINT_PREVIEW_SHEETS_LABEL_PLURAL); | 90 IDS_PRINT_PREVIEW_SHEETS_LABEL_PLURAL); |
91 AddLocalizedString("printPreviewPageLabelSingular", | 91 AddLocalizedString("printPreviewPageLabelSingular", |
92 IDS_PRINT_PREVIEW_PAGE_LABEL_SINGULAR); | 92 IDS_PRINT_PREVIEW_PAGE_LABEL_SINGULAR); |
93 AddLocalizedString("printPreviewPageLabelPlural", | 93 AddLocalizedString("printPreviewPageLabelPlural", |
94 IDS_PRINT_PREVIEW_PAGE_LABEL_PLURAL); | 94 IDS_PRINT_PREVIEW_PAGE_LABEL_PLURAL); |
95 const string16 shortcut_text(UTF8ToUTF16(kAdvancedPrintShortcut)); | 95 const string16 shortcut_text(UTF8ToUTF16(kAdvancedPrintShortcut)); |
| 96 #if defined(OS_CHROMEOS) |
| 97 AddString("cloudPrintDialogOption", l10n_util::GetStringFUTF16( |
| 98 IDS_PRINT_PREVIEW_CLOUD_DIALOG_OPTION, |
| 99 shortcut_text)); |
| 100 AddLocalizedString("printWithCloudPrint", |
| 101 IDS_PRINT_PREVIEW_MORE_PRINTERS); |
| 102 #else |
96 AddString("systemDialogOption", l10n_util::GetStringFUTF16( | 103 AddString("systemDialogOption", l10n_util::GetStringFUTF16( |
97 IDS_PRINT_PREVIEW_SYSTEM_DIALOG_OPTION, | 104 IDS_PRINT_PREVIEW_SYSTEM_DIALOG_OPTION, |
98 shortcut_text)); | 105 shortcut_text)); |
99 | 106 AddLocalizedString("printWithCloudPrint", |
| 107 IDS_PRINT_PREVIEW_PRINT_WITH_CLOUD_PRINT); |
| 108 #endif |
100 AddLocalizedString("pageRangeInstruction", | 109 AddLocalizedString("pageRangeInstruction", |
101 IDS_PRINT_PREVIEW_PAGE_RANGE_INSTRUCTION); | 110 IDS_PRINT_PREVIEW_PAGE_RANGE_INSTRUCTION); |
102 AddLocalizedString("copiesInstruction", IDS_PRINT_PREVIEW_COPIES_INSTRUCTION); | 111 AddLocalizedString("copiesInstruction", IDS_PRINT_PREVIEW_COPIES_INSTRUCTION); |
103 AddLocalizedString("signIn", IDS_PRINT_PREVIEW_SIGN_IN); | 112 AddLocalizedString("signIn", IDS_PRINT_PREVIEW_SIGN_IN); |
104 AddLocalizedString("cloudPrinters", IDS_PRINT_PREVIEW_CLOUD_PRINTERS); | |
105 AddLocalizedString("localPrinters", IDS_PRINT_PREVIEW_LOCAL_PRINTERS); | |
106 AddLocalizedString("manageCloudPrinters", | |
107 IDS_PRINT_PREVIEW_MANAGE_CLOUD_PRINTERS); | |
108 AddLocalizedString("manageLocalPrinters", | |
109 IDS_PRINT_PREVIEW_MANAGE_LOCAL_PRINTERS); | |
110 AddLocalizedString("managePrinters", IDS_PRINT_PREVIEW_MANAGE_PRINTERS); | 113 AddLocalizedString("managePrinters", IDS_PRINT_PREVIEW_MANAGE_PRINTERS); |
111 AddLocalizedString("printWithCloudPrintWait", | 114 AddLocalizedString("printWithCloudPrintWait", |
112 IDS_PRINT_PREVIEW_PRINT_WITH_CLOUD_PRINT_WAIT); | 115 IDS_PRINT_PREVIEW_PRINT_WITH_CLOUD_PRINT_WAIT); |
113 AddLocalizedString("printWithCloudPrint", | |
114 IDS_PRINT_PREVIEW_PRINT_WITH_CLOUD_PRINT); | |
115 AddLocalizedString("incrementTitle", IDS_PRINT_PREVIEW_INCREMENT_TITLE); | 116 AddLocalizedString("incrementTitle", IDS_PRINT_PREVIEW_INCREMENT_TITLE); |
116 AddLocalizedString("decrementTitle", IDS_PRINT_PREVIEW_DECREMENT_TITLE); | 117 AddLocalizedString("decrementTitle", IDS_PRINT_PREVIEW_DECREMENT_TITLE); |
117 AddLocalizedString("printPagesLabel", IDS_PRINT_PREVIEW_PRINT_PAGES_LABEL); | 118 AddLocalizedString("printPagesLabel", IDS_PRINT_PREVIEW_PRINT_PAGES_LABEL); |
118 AddLocalizedString("optionsLabel", IDS_PRINT_PREVIEW_OPTIONS_LABEL); | 119 AddLocalizedString("optionsLabel", IDS_PRINT_PREVIEW_OPTIONS_LABEL); |
119 AddLocalizedString("optionHeaderFooter", | 120 AddLocalizedString("optionHeaderFooter", |
120 IDS_PRINT_PREVIEW_OPTION_HEADER_FOOTER); | 121 IDS_PRINT_PREVIEW_OPTION_HEADER_FOOTER); |
121 AddLocalizedString("marginsLabel", IDS_PRINT_PREVIEW_MARGINS_LABEL); | 122 AddLocalizedString("marginsLabel", IDS_PRINT_PREVIEW_MARGINS_LABEL); |
122 AddLocalizedString("defaultMargins", IDS_PRINT_PREVIEW_DEFAULT_MARGINS); | 123 AddLocalizedString("defaultMargins", IDS_PRINT_PREVIEW_DEFAULT_MARGINS); |
123 AddLocalizedString("noMargins", IDS_PRINT_PREVIEW_NO_MARGINS); | 124 AddLocalizedString("noMargins", IDS_PRINT_PREVIEW_NO_MARGINS); |
124 AddLocalizedString("customMargins", IDS_PRINT_PREVIEW_CUSTOM_MARGINS); | 125 AddLocalizedString("customMargins", IDS_PRINT_PREVIEW_CUSTOM_MARGINS); |
(...skipping 25 matching lines...) Expand all Loading... |
150 url_substr[0], page_index, &data); | 151 url_substr[0], page_index, &data); |
151 } | 152 } |
152 if (data.get()) { | 153 if (data.get()) { |
153 SendResponse(request_id, data); | 154 SendResponse(request_id, data); |
154 return; | 155 return; |
155 } | 156 } |
156 // Invalid request. | 157 // Invalid request. |
157 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes); | 158 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes); |
158 SendResponse(request_id, empty_bytes); | 159 SendResponse(request_id, empty_bytes); |
159 } | 160 } |
OLD | NEW |