| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/settings/md_settings_localized_strings_provide
r.h" | 5 #include "chrome/browser/ui/webui/settings/md_settings_localized_strings_provide
r.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/i18n/number_formatting.h" |
| 11 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 11 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 12 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/ui/webui/policy_indicator_localized_strings_provider.h" | 16 #include "chrome/browser/ui/webui/policy_indicator_localized_strings_provider.h" |
| 15 #include "chrome/common/url_constants.h" | 17 #include "chrome/common/url_constants.h" |
| 16 #include "chrome/grit/chromium_strings.h" | 18 #include "chrome/grit/chromium_strings.h" |
| 17 #include "chrome/grit/generated_resources.h" | 19 #include "chrome/grit/generated_resources.h" |
| 18 #include "chrome/grit/google_chrome_strings.h" | 20 #include "chrome/grit/google_chrome_strings.h" |
| 19 #include "chrome/grit/locale_settings.h" | 21 #include "chrome/grit/locale_settings.h" |
| (...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 {"quickUnlockPasswordLabel", | 741 {"quickUnlockPasswordLabel", |
| 740 IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_PASSWORD_LABEL}, | 742 IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_PASSWORD_LABEL}, |
| 741 {"quickUnlockInvalidPassword", | 743 {"quickUnlockInvalidPassword", |
| 742 IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_INVALID_PASSWORD}, | 744 IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_INVALID_PASSWORD}, |
| 743 {"quickUnlockChooseUnlockMethod", | 745 {"quickUnlockChooseUnlockMethod", |
| 744 IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_CHOOSE_UNLOCK_METHOD}, | 746 IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_CHOOSE_UNLOCK_METHOD}, |
| 745 {"quickUnlockUnlockMethodPassword", | 747 {"quickUnlockUnlockMethodPassword", |
| 746 IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_UNLOCK_METHOD_PASSWORD}, | 748 IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_UNLOCK_METHOD_PASSWORD}, |
| 747 {"quickUnlockUnlockMethodPinAndPassword", | 749 {"quickUnlockUnlockMethodPinAndPassword", |
| 748 IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_UNLOCK_METHOD_PIN_AND_PASSWORD}, | 750 IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_UNLOCK_METHOD_PIN_AND_PASSWORD}, |
| 751 {"pinPlaceholder", |
| 752 IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_ENTER_PIN_OR_PASSWORD_PLACEHOLDER}, |
| 753 {"pinClear", IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_PIN_KEYBOARD_CLEAR}, |
| 749 {"quickUnlockUnlockMethodNone", | 754 {"quickUnlockUnlockMethodNone", |
| 750 IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_UNLOCK_METHOD_NONE}, | 755 IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_UNLOCK_METHOD_NONE}, |
| 751 {"quickUnlockConfigurePinButton", | 756 {"quickUnlockConfigurePinButton", |
| 752 IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_CONFIGURE_PIN_BUTTON}, | 757 IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_CONFIGURE_PIN_BUTTON}, |
| 753 {"quickUnlockConfigurePinChoosePinTitle", | 758 {"quickUnlockConfigurePinChoosePinTitle", |
| 754 IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_CONFIGURE_PIN_CHOOSE_PIN_TITLE}, | 759 IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_CONFIGURE_PIN_CHOOSE_PIN_TITLE}, |
| 755 {"quickUnlockConfigurePinChoosePinWeakPinWarning", | 760 {"quickUnlockConfigurePinChoosePinWeakPinWarning", |
| 756 IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_CONFIGURE_PIN_CHOOSE_PIN_WEAK_PIN_WARNING}
, | 761 IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_CONFIGURE_PIN_CHOOSE_PIN_WEAK_PIN_WARNING}
, |
| 757 {"quickUnlockConfigurePinContinueButton", | 762 {"quickUnlockConfigurePinContinueButton", |
| 758 IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_CONFIGURE_PIN_CONTINUE_BUTTON}, | 763 IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_CONFIGURE_PIN_CONTINUE_BUTTON}, |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 IDS_SETTINGS_PASSPHRASE_CONFIRMATION_PLACEHOLDER}, | 834 IDS_SETTINGS_PASSPHRASE_CONFIRMATION_PLACEHOLDER}, |
| 830 {"submitPassphraseButton", IDS_SETTINGS_SUBMIT_PASSPHRASE}, | 835 {"submitPassphraseButton", IDS_SETTINGS_SUBMIT_PASSPHRASE}, |
| 831 {"personalizeGoogleServicesTitle", | 836 {"personalizeGoogleServicesTitle", |
| 832 IDS_SETTINGS_PERSONALIZE_GOOGLE_SERVICES_TITLE}, | 837 IDS_SETTINGS_PERSONALIZE_GOOGLE_SERVICES_TITLE}, |
| 833 {"personalizeGoogleServicesText", | 838 {"personalizeGoogleServicesText", |
| 834 IDS_SETTINGS_PERSONALIZE_GOOGLE_SERVICES_TEXT}, | 839 IDS_SETTINGS_PERSONALIZE_GOOGLE_SERVICES_TEXT}, |
| 835 }; | 840 }; |
| 836 AddLocalizedStringsBulk(html_source, localized_strings, | 841 AddLocalizedStringsBulk(html_source, localized_strings, |
| 837 arraysize(localized_strings)); | 842 arraysize(localized_strings)); |
| 838 | 843 |
| 844 // Format numbers to be used on the pin keyboard. |
| 845 for (int j = 0; j <= 9; j++) { |
| 846 html_source->AddString("pinKeyboard" + base::IntToString(j), |
| 847 base::FormatNumber(int64_t{j})); |
| 848 } |
| 849 |
| 839 html_source->AddString("autofillHelpURL", autofill::kHelpURL); | 850 html_source->AddString("autofillHelpURL", autofill::kHelpURL); |
| 840 html_source->AddString("supervisedUsersUrl", | 851 html_source->AddString("supervisedUsersUrl", |
| 841 chrome::kLegacySupervisedUserManagementURL); | 852 chrome::kLegacySupervisedUserManagementURL); |
| 842 std::string sync_dashboard_url = | 853 std::string sync_dashboard_url = |
| 843 google_util::AppendGoogleLocaleParam( | 854 google_util::AppendGoogleLocaleParam( |
| 844 GURL(chrome::kSyncGoogleDashboardURL), | 855 GURL(chrome::kSyncGoogleDashboardURL), |
| 845 g_browser_process->GetApplicationLocale()) | 856 g_browser_process->GetApplicationLocale()) |
| 846 .spec(); | 857 .spec(); |
| 847 html_source->AddString("syncDashboardUrl", sync_dashboard_url); | 858 html_source->AddString("syncDashboardUrl", sync_dashboard_url); |
| 848 html_source->AddString( | 859 html_source->AddString( |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1190 #endif | 1201 #endif |
| 1191 AddUsersStrings(html_source); | 1202 AddUsersStrings(html_source); |
| 1192 AddWebContentStrings(html_source); | 1203 AddWebContentStrings(html_source); |
| 1193 | 1204 |
| 1194 policy_indicator::AddLocalizedStrings(html_source); | 1205 policy_indicator::AddLocalizedStrings(html_source); |
| 1195 | 1206 |
| 1196 html_source->SetJsonPath(kLocalizedStringsFile); | 1207 html_source->SetJsonPath(kLocalizedStringsFile); |
| 1197 } | 1208 } |
| 1198 | 1209 |
| 1199 } // namespace settings | 1210 } // namespace settings |
| OLD | NEW |