| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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("managePrinters"), | 107 localized_strings->SetString(std::string("managePrinters"), |
| 108 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_MANAGE_PRINTERS)); | 108 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_MANAGE_PRINTERS)); |
| 109 localized_strings->SetString(std::string("incrementTitle"), | 109 localized_strings->SetString(std::string("incrementTitle"), |
| 110 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_INCREMENT_TITLE)); | 110 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_INCREMENT_TITLE)); |
| 111 localized_strings->SetString(std::string("decrementTitle"), | 111 localized_strings->SetString(std::string("decrementTitle"), |
| 112 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_DECREMENT_TITLE)); | 112 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_DECREMENT_TITLE)); |
| 113 localized_strings->SetString(std::string("printPagesLabel"), | 113 localized_strings->SetString(std::string("printPagesLabel"), |
| 114 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PRINT_PAGES_LABEL)); | 114 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PRINT_PAGES_LABEL)); |
| 115 localized_strings->SetString(std::string("optionsLabel"), |
| 116 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_OPTIONS_LABEL)); |
| 117 localized_strings->SetString(std::string("optionHeaderFooter"), |
| 118 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_OPTION_HEADER_FOOTER)); |
| 115 } | 119 } |
| 116 | 120 |
| 117 } // namespace | 121 } // namespace |
| 118 | 122 |
| 119 PrintPreviewDataSource::PrintPreviewDataSource() | 123 PrintPreviewDataSource::PrintPreviewDataSource() |
| 120 : DataSource(chrome::kChromeUIPrintHost, MessageLoop::current()) { | 124 : DataSource(chrome::kChromeUIPrintHost, MessageLoop::current()) { |
| 121 } | 125 } |
| 122 | 126 |
| 123 PrintPreviewDataSource::~PrintPreviewDataSource() { | 127 PrintPreviewDataSource::~PrintPreviewDataSource() { |
| 124 } | 128 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 SendResponse(request_id, empty_bytes); | 167 SendResponse(request_id, empty_bytes); |
| 164 return; | 168 return; |
| 165 } | 169 } |
| 166 } | 170 } |
| 167 | 171 |
| 168 std::string PrintPreviewDataSource::GetMimeType(const std::string& path) const { | 172 std::string PrintPreviewDataSource::GetMimeType(const std::string& path) const { |
| 169 if (path.empty()) | 173 if (path.empty()) |
| 170 return "text/html"; // Print Preview Index Page. | 174 return "text/html"; // Print Preview Index Page. |
| 171 return "application/pdf"; // Print Preview data | 175 return "application/pdf"; // Print Preview data |
| 172 } | 176 } |
| OLD | NEW |