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_piece.h" | 10 #include "base/string_piece.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 localized_strings->SetString(std::string("printPreviewPageLabelSingular"), | 97 localized_strings->SetString(std::string("printPreviewPageLabelSingular"), |
98 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PAGE_LABEL_SINGULAR)); | 98 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PAGE_LABEL_SINGULAR)); |
99 localized_strings->SetString(std::string("printPreviewPageLabelPlural"), | 99 localized_strings->SetString(std::string("printPreviewPageLabelPlural"), |
100 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PAGE_LABEL_PLURAL)); | 100 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PAGE_LABEL_PLURAL)); |
101 localized_strings->SetString(std::string("systemDialogOption"), | 101 localized_strings->SetString(std::string("systemDialogOption"), |
102 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_SYSTEM_DIALOG_OPTION)); | 102 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_SYSTEM_DIALOG_OPTION)); |
103 localized_strings->SetString(std::string("pageRangeInstruction"), | 103 localized_strings->SetString(std::string("pageRangeInstruction"), |
104 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PAGE_RANGE_INSTRUCTION)); | 104 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PAGE_RANGE_INSTRUCTION)); |
105 localized_strings->SetString(std::string("copiesInstruction"), | 105 localized_strings->SetString(std::string("copiesInstruction"), |
106 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_COPIES_INSTRUCTION)); | 106 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_COPIES_INSTRUCTION)); |
| 107 localized_strings->SetString(std::string("signIn"), |
| 108 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_SIGN_IN)); |
| 109 localized_strings->SetString(std::string("morePrinters"), |
| 110 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_MORE_PRINTERS)); |
| 111 localized_strings->SetString(std::string("addCloudPrinter"), |
| 112 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_ADD_CLOUD_PRINTER)); |
| 113 localized_strings->SetString(std::string("cloudPrinters"), |
| 114 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_CLOUD_PRINTERS)); |
| 115 localized_strings->SetString(std::string("localPrinters"), |
| 116 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_LOCAL_PRINTERS)); |
| 117 localized_strings->SetString(std::string("manageCloudPrinters"), |
| 118 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_MANAGE_CLOUD_PRINTERS)); |
| 119 localized_strings->SetString(std::string("manageLocalPrinters"), |
| 120 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_MANAGE_LOCAL_PRINTERS)); |
107 localized_strings->SetString(std::string("managePrinters"), | 121 localized_strings->SetString(std::string("managePrinters"), |
108 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_MANAGE_PRINTERS)); | 122 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_MANAGE_PRINTERS)); |
109 } | 123 } |
110 | 124 |
111 } // namespace | 125 } // namespace |
112 | 126 |
113 PrintPreviewDataSource::PrintPreviewDataSource() | 127 PrintPreviewDataSource::PrintPreviewDataSource() |
114 : DataSource(chrome::kChromeUIPrintHost, MessageLoop::current()) { | 128 : DataSource(chrome::kChromeUIPrintHost, MessageLoop::current()) { |
115 } | 129 } |
116 | 130 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 SendResponse(request_id, empty_bytes); | 171 SendResponse(request_id, empty_bytes); |
158 return; | 172 return; |
159 } | 173 } |
160 } | 174 } |
161 | 175 |
162 std::string PrintPreviewDataSource::GetMimeType(const std::string& path) const { | 176 std::string PrintPreviewDataSource::GetMimeType(const std::string& path) const { |
163 if (path.empty()) | 177 if (path.empty()) |
164 return "text/html"; // Print Preview Index Page. | 178 return "text/html"; // Print Preview Index Page. |
165 return "application/pdf"; // Print Preview data | 179 return "application/pdf"; // Print Preview data |
166 } | 180 } |
OLD | NEW |