| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/common/net/net_resource_provider.h" | 5 #include "chrome/common/net/net_resource_provider.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/string_piece.h" | 9 #include "base/string_piece.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_PARENT)); | 32 l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_PARENT)); |
| 33 value.SetString("headerName", | 33 value.SetString("headerName", |
| 34 l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_NAME)); | 34 l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_NAME)); |
| 35 value.SetString("headerSize", | 35 value.SetString("headerSize", |
| 36 l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_SIZE)); | 36 l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_SIZE)); |
| 37 value.SetString("headerDateModified", | 37 value.SetString("headerDateModified", |
| 38 l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_DATE_MODIFIED)); | 38 l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_DATE_MODIFIED)); |
| 39 value.SetString("listingParsingErrorBoxText", | 39 value.SetString("listingParsingErrorBoxText", |
| 40 l10n_util::GetStringFUTF16(IDS_DIRECTORY_LISTING_PARSING_ERROR_BOX_TEXT, | 40 l10n_util::GetStringFUTF16(IDS_DIRECTORY_LISTING_PARSING_ERROR_BOX_TEXT, |
| 41 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); | 41 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); |
| 42 html_data = jstemplate_builder::GetI18nTemplateHtml( | 42 html_data = webui::GetI18nTemplateHtml( |
| 43 ResourceBundle::GetSharedInstance().GetRawDataResource( | 43 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 44 IDR_DIR_HEADER_HTML), | 44 IDR_DIR_HEADER_HTML), |
| 45 &value); | 45 &value); |
| 46 } | 46 } |
| 47 | 47 |
| 48 std::string html_data; | 48 std::string html_data; |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 } // namespace | 51 } // namespace |
| 52 | 52 |
| 53 namespace chrome_common_net { | 53 namespace chrome_common_net { |
| 54 | 54 |
| 55 base::StringPiece NetResourceProvider(int key) { | 55 base::StringPiece NetResourceProvider(int key) { |
| 56 CR_DEFINE_STATIC_LOCAL(LazyDirectoryListerCacher, lazy_dir_lister, ()); | 56 CR_DEFINE_STATIC_LOCAL(LazyDirectoryListerCacher, lazy_dir_lister, ()); |
| 57 | 57 |
| 58 if (IDR_DIR_HEADER_HTML == key) | 58 if (IDR_DIR_HEADER_HTML == key) |
| 59 return base::StringPiece(lazy_dir_lister.html_data); | 59 return base::StringPiece(lazy_dir_lister.html_data); |
| 60 | 60 |
| 61 return ResourceBundle::GetSharedInstance().GetRawDataResource(key); | 61 return ResourceBundle::GetSharedInstance().GetRawDataResource(key); |
| 62 } | 62 } |
| 63 | 63 |
| 64 } // namespace chrome_common_net | 64 } // namespace chrome_common_net |
| OLD | NEW |