| 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 18 matching lines...) Expand all Loading... |
| 29 localized_strings->SetString(std::string("loading"), | 29 localized_strings->SetString(std::string("loading"), |
| 30 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_LOADING)); | 30 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_LOADING)); |
| 31 #if defined(GOOGLE_CHROME_BUILD) | 31 #if defined(GOOGLE_CHROME_BUILD) |
| 32 localized_strings->SetString(std::string("noPlugin"), | 32 localized_strings->SetString(std::string("noPlugin"), |
| 33 l10n_util::GetStringFUTF8(IDS_PRINT_PREVIEW_NO_PLUGIN, | 33 l10n_util::GetStringFUTF8(IDS_PRINT_PREVIEW_NO_PLUGIN, |
| 34 ASCIIToUTF16("chrome://plugins/"))); | 34 ASCIIToUTF16("chrome://plugins/"))); |
| 35 #else | 35 #else |
| 36 localized_strings->SetString(std::string("noPlugin"), | 36 localized_strings->SetString(std::string("noPlugin"), |
| 37 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_NO_PLUGIN)); | 37 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_NO_PLUGIN)); |
| 38 #endif | 38 #endif |
| 39 localized_strings->SetString(std::string("launchNativeDialog"), |
| 40 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_NATIVE_DIALOG)); |
| 39 localized_strings->SetString(std::string("previewFailed"), | 41 localized_strings->SetString(std::string("previewFailed"), |
| 40 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_FAILED)); | 42 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_FAILED)); |
| 41 localized_strings->SetString(std::string("initiatorTabClosed"), | 43 localized_strings->SetString(std::string("initiatorTabClosed"), |
| 42 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_INITIATOR_TAB_CLOSED)); | 44 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_INITIATOR_TAB_CLOSED)); |
| 43 localized_strings->SetString(std::string("reopenPage"), | 45 localized_strings->SetString(std::string("reopenPage"), |
| 44 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_REOPEN_PAGE)); | 46 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_REOPEN_PAGE)); |
| 45 | 47 |
| 46 localized_strings->SetString(std::string("printButton"), | 48 localized_strings->SetString(std::string("printButton"), |
| 47 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PRINT_BUTTON)); | 49 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PRINT_BUTTON)); |
| 48 localized_strings->SetString(std::string("cancelButton"), | 50 localized_strings->SetString(std::string("cancelButton"), |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 SendResponse(request_id, empty_bytes); | 157 SendResponse(request_id, empty_bytes); |
| 156 return; | 158 return; |
| 157 } | 159 } |
| 158 } | 160 } |
| 159 | 161 |
| 160 std::string PrintPreviewDataSource::GetMimeType(const std::string& path) const { | 162 std::string PrintPreviewDataSource::GetMimeType(const std::string& path) const { |
| 161 if (path.empty()) | 163 if (path.empty()) |
| 162 return "text/html"; // Print Preview Index Page. | 164 return "text/html"; // Print Preview Index Page. |
| 163 return "application/pdf"; // Print Preview data | 165 return "application/pdf"; // Print Preview data |
| 164 } | 166 } |
| OLD | NEW |