Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Side by Side Diff: chrome/common/net/net_resource_provider.cc

Issue 2032903004: Fix FTP directory listing page error by adding "language" key (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: split CLs Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/strings/string_piece.h" 10 #include "base/strings/string_piece.h"
(...skipping 19 matching lines...) Expand all
30 value.SetString("header", 30 value.SetString("header",
31 l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_HEADER)); 31 l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_HEADER));
32 value.SetString("parentDirText", 32 value.SetString("parentDirText",
33 l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_PARENT)); 33 l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_PARENT));
34 value.SetString("headerName", 34 value.SetString("headerName",
35 l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_NAME)); 35 l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_NAME));
36 value.SetString("headerSize", 36 value.SetString("headerSize",
37 l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_SIZE)); 37 l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_SIZE));
38 value.SetString("headerDateModified", 38 value.SetString("headerDateModified",
39 l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_DATE_MODIFIED)); 39 l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_DATE_MODIFIED));
40 value.SetString("language",
41 l10n_util::GetLanguage(base::i18n::GetConfiguredLocale()));
40 value.SetString("listingParsingErrorBoxText", 42 value.SetString("listingParsingErrorBoxText",
41 l10n_util::GetStringFUTF16(IDS_DIRECTORY_LISTING_PARSING_ERROR_BOX_TEXT, 43 l10n_util::GetStringFUTF16(IDS_DIRECTORY_LISTING_PARSING_ERROR_BOX_TEXT,
42 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); 44 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)));
43 value.SetString("textdirection", base::i18n::IsRTL() ? "rtl" : "ltr"); 45 value.SetString("textdirection", base::i18n::IsRTL() ? "rtl" : "ltr");
44 html_data = webui::GetI18nTemplateHtml( 46 html_data = webui::GetI18nTemplateHtml(
45 ResourceBundle::GetSharedInstance().GetRawDataResource( 47 ResourceBundle::GetSharedInstance().GetRawDataResource(
46 IDR_DIR_HEADER_HTML), 48 IDR_DIR_HEADER_HTML),
47 &value); 49 &value);
48 } 50 }
49 51
50 std::string html_data; 52 std::string html_data;
51 }; 53 };
52 54
53 } // namespace 55 } // namespace
54 56
55 namespace chrome_common_net { 57 namespace chrome_common_net {
56 58
57 base::StringPiece NetResourceProvider(int key) { 59 base::StringPiece NetResourceProvider(int key) {
58 CR_DEFINE_STATIC_LOCAL(LazyDirectoryListerCacher, lazy_dir_lister, ()); 60 CR_DEFINE_STATIC_LOCAL(LazyDirectoryListerCacher, lazy_dir_lister, ());
59 61
60 if (IDR_DIR_HEADER_HTML == key) 62 if (IDR_DIR_HEADER_HTML == key)
61 return base::StringPiece(lazy_dir_lister.html_data); 63 return base::StringPiece(lazy_dir_lister.html_data);
62 64
63 return ResourceBundle::GetSharedInstance().GetRawDataResource(key); 65 return ResourceBundle::GetSharedInstance().GetRawDataResource(key);
64 } 66 }
65 67
66 } // namespace chrome_common_net 68 } // namespace chrome_common_net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698