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" |
11 #include "base/shared_memory.h" | 11 #include "base/shared_memory.h" |
12 #include "base/string_piece.h" | 12 #include "base/string_piece.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "chrome/common/jstemplate_builder.h" | 14 #include "chrome/common/jstemplate_builder.h" |
15 #include "chrome/common/url_constants.h" | 15 #include "chrome/common/url_constants.h" |
16 #include "grit/browser_resources.h" | 16 #include "grit/browser_resources.h" |
17 #include "grit/generated_resources.h" | 17 #include "grit/generated_resources.h" |
18 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
19 #include "ui/base/resource/resource_bundle.h" | 19 #include "ui/base/resource/resource_bundle.h" |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 void SetLocalizedStrings(DictionaryValue* localized_strings) { | 23 void SetLocalizedStrings(DictionaryValue* localized_strings) { |
24 localized_strings->SetString(std::string("title"), | 24 localized_strings->SetString(std::string("title"), |
25 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_TITLE)); | 25 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_TITLE)); |
26 localized_strings->SetString(std::string("loading"), | 26 localized_strings->SetString(std::string("loading"), |
27 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_LOADING)); | 27 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_LOADING)); |
28 localized_strings->SetString(std::string("noPlugin"), | 28 localized_strings->SetString(std::string("noPlugin"), |
29 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_NO_PLUGIN)); | 29 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_NO_PLUGIN)); |
30 localized_strings->SetString(std::string("noPrinter"), | |
31 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_NO_PRINTER)); | |
32 | 30 |
33 localized_strings->SetString(std::string("printButton"), | 31 localized_strings->SetString(std::string("printButton"), |
34 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PRINT_BUTTON)); | 32 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PRINT_BUTTON)); |
35 localized_strings->SetString(std::string("cancelButton"), | 33 localized_strings->SetString(std::string("cancelButton"), |
36 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_CANCEL_BUTTON)); | 34 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_CANCEL_BUTTON)); |
37 | 35 |
38 localized_strings->SetString(std::string("destinationLabel"), | 36 localized_strings->SetString(std::string("destinationLabel"), |
39 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_DESTINATION_LABEL)); | 37 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_DESTINATION_LABEL)); |
40 localized_strings->SetString(std::string("copiesLabel"), | 38 localized_strings->SetString(std::string("copiesLabel"), |
41 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_COPIES_LABEL)); | 39 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_COPIES_LABEL)); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 } | 150 } |
153 | 151 |
154 std::string PrintPreviewUIHTMLSource::GetMimeType( | 152 std::string PrintPreviewUIHTMLSource::GetMimeType( |
155 const std::string& path) const { | 153 const std::string& path) const { |
156 // Print Preview Index page. | 154 // Print Preview Index page. |
157 if (path.empty()) | 155 if (path.empty()) |
158 return "text/html"; | 156 return "text/html"; |
159 // Print Preview data. | 157 // Print Preview data. |
160 return "application/pdf"; | 158 return "application/pdf"; |
161 } | 159 } |
OLD | NEW |