| 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_ui_html_source.h" | 5 #include "chrome/browser/ui/webui/print_preview_ui_html_source.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 localized_strings->SetString(std::string("printPreviewSummaryFormat"), | 89 localized_strings->SetString(std::string("printPreviewSummaryFormat"), |
| 90 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_SUMMARY_FORMAT)); | 90 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_SUMMARY_FORMAT)); |
| 91 localized_strings->SetString(std::string("printPreviewSheetsLabel"), | 91 localized_strings->SetString(std::string("printPreviewSheetsLabel"), |
| 92 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_SHEETS_LABEL)); | 92 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_SHEETS_LABEL)); |
| 93 localized_strings->SetString(std::string("printPreviewPageLabelSingular"), | 93 localized_strings->SetString(std::string("printPreviewPageLabelSingular"), |
| 94 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PAGE_LABEL_SINGULAR)); | 94 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PAGE_LABEL_SINGULAR)); |
| 95 localized_strings->SetString(std::string("printPreviewPageLabelPlural"), | 95 localized_strings->SetString(std::string("printPreviewPageLabelPlural"), |
| 96 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PAGE_LABEL_PLURAL)); | 96 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PAGE_LABEL_PLURAL)); |
| 97 localized_strings->SetString(std::string("systemDialogOption"), | 97 localized_strings->SetString(std::string("systemDialogOption"), |
| 98 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_SYSTEM_DIALOG_OPTION)); | 98 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_SYSTEM_DIALOG_OPTION)); |
| 99 localized_strings->SetString(std::string("managePrinters"), |
| 100 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_MANAGE_PRINTERS)); |
| 99 } | 101 } |
| 100 | 102 |
| 101 } // namespace | 103 } // namespace |
| 102 | 104 |
| 103 PrintPreviewUIHTMLSource::PrintPreviewUIHTMLSource() | 105 PrintPreviewUIHTMLSource::PrintPreviewUIHTMLSource() |
| 104 : DataSource(chrome::kChromeUIPrintHost, MessageLoop::current()), | 106 : DataSource(chrome::kChromeUIPrintHost, MessageLoop::current()), |
| 105 data_(std::make_pair(static_cast<base::SharedMemory*>(NULL), 0U)) { | 107 data_(std::make_pair(static_cast<base::SharedMemory*>(NULL), 0U)) { |
| 106 } | 108 } |
| 107 | 109 |
| 108 PrintPreviewUIHTMLSource::~PrintPreviewUIHTMLSource() { | 110 PrintPreviewUIHTMLSource::~PrintPreviewUIHTMLSource() { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 } | 163 } |
| 162 | 164 |
| 163 std::string PrintPreviewUIHTMLSource::GetMimeType( | 165 std::string PrintPreviewUIHTMLSource::GetMimeType( |
| 164 const std::string& path) const { | 166 const std::string& path) const { |
| 165 // Print Preview Index page. | 167 // Print Preview Index page. |
| 166 if (path.empty()) | 168 if (path.empty()) |
| 167 return "text/html"; | 169 return "text/html"; |
| 168 // Print Preview data. | 170 // Print Preview data. |
| 169 return "application/pdf"; | 171 return "application/pdf"; |
| 170 } | 172 } |
| OLD | NEW |