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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 AddLocalizedString("cloudPrinters", IDS_PRINT_PREVIEW_CLOUD_PRINTERS); | 88 AddLocalizedString("cloudPrinters", IDS_PRINT_PREVIEW_CLOUD_PRINTERS); |
89 AddLocalizedString("localPrinters", IDS_PRINT_PREVIEW_LOCAL_PRINTERS); | 89 AddLocalizedString("localPrinters", IDS_PRINT_PREVIEW_LOCAL_PRINTERS); |
90 AddLocalizedString("manageCloudPrinters", | 90 AddLocalizedString("manageCloudPrinters", |
91 IDS_PRINT_PREVIEW_MANAGE_CLOUD_PRINTERS); | 91 IDS_PRINT_PREVIEW_MANAGE_CLOUD_PRINTERS); |
92 AddLocalizedString("manageLocalPrinters", | 92 AddLocalizedString("manageLocalPrinters", |
93 IDS_PRINT_PREVIEW_MANAGE_LOCAL_PRINTERS); | 93 IDS_PRINT_PREVIEW_MANAGE_LOCAL_PRINTERS); |
94 AddLocalizedString("managePrinters", IDS_PRINT_PREVIEW_MANAGE_PRINTERS); | 94 AddLocalizedString("managePrinters", IDS_PRINT_PREVIEW_MANAGE_PRINTERS); |
95 AddLocalizedString("incrementTitle", IDS_PRINT_PREVIEW_INCREMENT_TITLE); | 95 AddLocalizedString("incrementTitle", IDS_PRINT_PREVIEW_INCREMENT_TITLE); |
96 AddLocalizedString("decrementTitle", IDS_PRINT_PREVIEW_DECREMENT_TITLE); | 96 AddLocalizedString("decrementTitle", IDS_PRINT_PREVIEW_DECREMENT_TITLE); |
97 AddLocalizedString("printPagesLabel", IDS_PRINT_PREVIEW_PRINT_PAGES_LABEL); | 97 AddLocalizedString("printPagesLabel", IDS_PRINT_PREVIEW_PRINT_PAGES_LABEL); |
| 98 AddLocalizedString("optionsLabel", IDS_PRINT_PREVIEW_OPTIONS_LABEL); |
| 99 AddLocalizedString("optionHeaderFooter", |
| 100 IDS_PRINT_PREVIEW_OPTION_HEADER_FOOTER); |
98 | 101 |
99 set_json_path("strings.js"); | 102 set_json_path("strings.js"); |
100 add_resource_path("print_preview.js", IDR_PRINT_PREVIEW_JS); | 103 add_resource_path("print_preview.js", IDR_PRINT_PREVIEW_JS); |
101 set_default_resource(IDR_PRINT_PREVIEW_HTML); | 104 set_default_resource(IDR_PRINT_PREVIEW_HTML); |
102 } | 105 } |
103 | 106 |
104 PrintPreviewDataSource::~PrintPreviewDataSource() { | 107 PrintPreviewDataSource::~PrintPreviewDataSource() { |
105 } | 108 } |
106 | 109 |
107 void PrintPreviewDataSource::StartDataRequest(const std::string& path, | 110 void PrintPreviewDataSource::StartDataRequest(const std::string& path, |
(...skipping 15 matching lines...) Expand all Loading... |
123 url_substr[0], page_index, &data); | 126 url_substr[0], page_index, &data); |
124 } | 127 } |
125 if (data.get()) { | 128 if (data.get()) { |
126 SendResponse(request_id, data); | 129 SendResponse(request_id, data); |
127 return; | 130 return; |
128 } | 131 } |
129 // Invalid request. | 132 // Invalid request. |
130 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes); | 133 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes); |
131 SendResponse(request_id, empty_bytes); | 134 SendResponse(request_id, empty_bytes); |
132 } | 135 } |
OLD | NEW |