OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/print_preview_data_source.h" | 5 #include "chrome/browser/ui/webui/print_preview/print_preview_data_source.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/ref_counted_memory.h" | 10 #include "base/memory/ref_counted_memory.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 IDS_PRINT_PREVIEW_PAGE_RANGE_INSTRUCTION); | 115 IDS_PRINT_PREVIEW_PAGE_RANGE_INSTRUCTION); |
116 AddLocalizedString("copiesInstruction", IDS_PRINT_PREVIEW_COPIES_INSTRUCTION); | 116 AddLocalizedString("copiesInstruction", IDS_PRINT_PREVIEW_COPIES_INSTRUCTION); |
117 AddLocalizedString("signIn", IDS_PRINT_PREVIEW_SIGN_IN); | 117 AddLocalizedString("signIn", IDS_PRINT_PREVIEW_SIGN_IN); |
118 AddLocalizedString("managePrinters", IDS_PRINT_PREVIEW_MANAGE_PRINTERS); | 118 AddLocalizedString("managePrinters", IDS_PRINT_PREVIEW_MANAGE_PRINTERS); |
119 AddLocalizedString("incrementTitle", IDS_PRINT_PREVIEW_INCREMENT_TITLE); | 119 AddLocalizedString("incrementTitle", IDS_PRINT_PREVIEW_INCREMENT_TITLE); |
120 AddLocalizedString("decrementTitle", IDS_PRINT_PREVIEW_DECREMENT_TITLE); | 120 AddLocalizedString("decrementTitle", IDS_PRINT_PREVIEW_DECREMENT_TITLE); |
121 AddLocalizedString("printPagesLabel", IDS_PRINT_PREVIEW_PRINT_PAGES_LABEL); | 121 AddLocalizedString("printPagesLabel", IDS_PRINT_PREVIEW_PRINT_PAGES_LABEL); |
122 AddLocalizedString("optionsLabel", IDS_PRINT_PREVIEW_OPTIONS_LABEL); | 122 AddLocalizedString("optionsLabel", IDS_PRINT_PREVIEW_OPTIONS_LABEL); |
123 AddLocalizedString("optionHeaderFooter", | 123 AddLocalizedString("optionHeaderFooter", |
124 IDS_PRINT_PREVIEW_OPTION_HEADER_FOOTER); | 124 IDS_PRINT_PREVIEW_OPTION_HEADER_FOOTER); |
| 125 AddLocalizedString("optionFitToPage", |
| 126 IDS_PRINT_PREVIEW_OPTION_FIT_TO_PAGE); |
125 AddLocalizedString("marginsLabel", IDS_PRINT_PREVIEW_MARGINS_LABEL); | 127 AddLocalizedString("marginsLabel", IDS_PRINT_PREVIEW_MARGINS_LABEL); |
126 AddLocalizedString("defaultMargins", IDS_PRINT_PREVIEW_DEFAULT_MARGINS); | 128 AddLocalizedString("defaultMargins", IDS_PRINT_PREVIEW_DEFAULT_MARGINS); |
127 AddLocalizedString("noMargins", IDS_PRINT_PREVIEW_NO_MARGINS); | 129 AddLocalizedString("noMargins", IDS_PRINT_PREVIEW_NO_MARGINS); |
128 AddLocalizedString("customMargins", IDS_PRINT_PREVIEW_CUSTOM_MARGINS); | 130 AddLocalizedString("customMargins", IDS_PRINT_PREVIEW_CUSTOM_MARGINS); |
129 AddLocalizedString("minimumMargins", IDS_PRINT_PREVIEW_MINIMUM_MARGINS); | 131 AddLocalizedString("minimumMargins", IDS_PRINT_PREVIEW_MINIMUM_MARGINS); |
130 AddLocalizedString("top", IDS_PRINT_PREVIEW_TOP_MARGIN_LABEL); | 132 AddLocalizedString("top", IDS_PRINT_PREVIEW_TOP_MARGIN_LABEL); |
131 AddLocalizedString("bottom", IDS_PRINT_PREVIEW_BOTTOM_MARGIN_LABEL); | 133 AddLocalizedString("bottom", IDS_PRINT_PREVIEW_BOTTOM_MARGIN_LABEL); |
132 AddLocalizedString("left", IDS_PRINT_PREVIEW_LEFT_MARGIN_LABEL); | 134 AddLocalizedString("left", IDS_PRINT_PREVIEW_LEFT_MARGIN_LABEL); |
133 AddLocalizedString("right", IDS_PRINT_PREVIEW_RIGHT_MARGIN_LABEL); | 135 AddLocalizedString("right", IDS_PRINT_PREVIEW_RIGHT_MARGIN_LABEL); |
134 | 136 |
(...skipping 24 matching lines...) Expand all Loading... |
159 url_substr[0], page_index, &data); | 161 url_substr[0], page_index, &data); |
160 } | 162 } |
161 if (data.get()) { | 163 if (data.get()) { |
162 SendResponse(request_id, data); | 164 SendResponse(request_id, data); |
163 return; | 165 return; |
164 } | 166 } |
165 // Invalid request. | 167 // Invalid request. |
166 scoped_refptr<base::RefCountedBytes> empty_bytes(new base::RefCountedBytes); | 168 scoped_refptr<base::RefCountedBytes> empty_bytes(new base::RefCountedBytes); |
167 SendResponse(request_id, empty_bytes); | 169 SendResponse(request_id, empty_bytes); |
168 } | 170 } |
OLD | NEW |