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

Unified Diff: chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc

Issue 2477453002: MD Settings: Sync route paths in JavaScript to URL constants in C++ (Closed)
Patch Set: fix js compile Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/settings/route.js ('k') | chrome/common/url_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
diff --git a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
index 1e31839c82abbe9f6c770dadceb874de78b2b699..190273011eadc80ffaf50a73067cbc483f3b8ec0 100644
--- a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
+++ b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
@@ -55,6 +55,11 @@ struct LocalizedString {
int id;
};
+struct PathConstant {
+ const char* name;
+ const char* path;
+};
+
void AddLocalizedStringsBulk(content::WebUIDataSource* html_source,
LocalizedString localized_strings[],
size_t num_strings) {
@@ -985,6 +990,35 @@ void AddPasswordsAndFormsStrings(content::WebUIDataSource* html_source) {
arraysize(localized_strings));
}
+void AddPaths(content::WebUIDataSource* html_source) {
+ PathConstant path_constants[] = {
+ {"accessibilityPath", chrome::kAccessibilitySubPage},
+ {"autofillPath", chrome::kAutofillSubPage},
+ {"clearBrowserDataPath", chrome::kClearBrowserDataSubPage},
+ {"contentPath", chrome::kContentSettingsSubPage},
+ {"handlersPath", chrome::kHandlerSettingsSubPage},
+ {"languagesPath", chrome::kLanguageOptionsSubPage},
+ {"manageProfilePath", chrome::kManageProfileSubPage},
+ {"passwordsPath", chrome::kPasswordManagerSubPage},
+ {"resetProfileSettingsPath", chrome::kResetProfileSettingsSubPage},
+ {"searchEnginesPath", chrome::kSearchEnginesSubPage},
+ {"signOutPath", chrome::kSignOutSubPage},
+ {"syncSetupPath", chrome::kSyncSetupSubPage},
+ {"triggeredResetProfileSettingsPath",
+ chrome::kTriggeredResetProfileSettingsSubPage},
+#if defined(OS_CHROMEOS)
+ {"bluetoothPath", chrome::kBluetoothSubPage},
+ {"dateTimePath", chrome::kDateTimeSubPage},
+ {"internetPath", chrome::kInternetOptionsSubPage},
+#endif
+ };
+
+ for (size_t i = 0; i < arraysize(path_constants); i++) {
+ html_source->AddString(path_constants[i].name,
+ std::string("/") + path_constants[i].path);
+ }
+}
+
void AddPeopleStrings(content::WebUIDataSource* html_source) {
LocalizedString localized_strings[] = {
{"peoplePageTitle", IDS_SETTINGS_PEOPLE},
@@ -1752,6 +1786,7 @@ void AddLocalizedStrings(content::WebUIDataSource* html_source,
#endif
AddOnStartupStrings(html_source);
AddPasswordsAndFormsStrings(html_source);
+ AddPaths(html_source);
AddPeopleStrings(html_source);
AddPrintingStrings(html_source);
AddPrivacyStrings(html_source);
« no previous file with comments | « chrome/browser/resources/settings/route.js ('k') | chrome/common/url_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698