Chromium Code Reviews| 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" | 10 #include "base/i18n/number_formatting.h" |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 #include "chrome/common/url_constants.h" | 22 #include "chrome/common/url_constants.h" |
| 23 #include "chrome/grit/chromium_strings.h" | 23 #include "chrome/grit/chromium_strings.h" |
| 24 #include "chrome/grit/generated_resources.h" | 24 #include "chrome/grit/generated_resources.h" |
| 25 #include "chrome/grit/locale_settings.h" | 25 #include "chrome/grit/locale_settings.h" |
| 26 #include "components/autofill/core/browser/payments/payments_service_url.h" | 26 #include "components/autofill/core/browser/payments/payments_service_url.h" |
| 27 #include "components/autofill/core/common/autofill_constants.h" | 27 #include "components/autofill/core/common/autofill_constants.h" |
| 28 #include "components/google/core/browser/google_util.h" | 28 #include "components/google/core/browser/google_util.h" |
| 29 #include "components/password_manager/core/browser/password_manager_constants.h" | 29 #include "components/password_manager/core/browser/password_manager_constants.h" |
| 30 #include "components/safe_browsing_db/safe_browsing_prefs.h" | 30 #include "components/safe_browsing_db/safe_browsing_prefs.h" |
| 31 #include "components/strings/grit/components_strings.h" | 31 #include "components/strings/grit/components_strings.h" |
| 32 #include "components/subresource_filter/core/browser/subresource_filter_features .h" | |
| 32 #include "content/public/browser/web_ui_data_source.h" | 33 #include "content/public/browser/web_ui_data_source.h" |
| 33 #include "ui/base/l10n/l10n_util.h" | 34 #include "ui/base/l10n/l10n_util.h" |
| 34 | 35 |
| 35 #if defined(OS_CHROMEOS) | 36 #if defined(OS_CHROMEOS) |
| 36 #include "ash/common/ash_switches.h" | 37 #include "ash/common/ash_switches.h" |
| 37 #include "ash/common/system/chromeos/devicetype_utils.h" | 38 #include "ash/common/system/chromeos/devicetype_utils.h" |
| 38 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 39 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 39 #include "chrome/browser/ui/webui/chromeos/network_element_localized_strings_pro vider.h" | 40 #include "chrome/browser/ui/webui/chromeos/network_element_localized_strings_pro vider.h" |
| 40 #include "chrome/browser/ui/webui/chromeos/ui_account_tweaks.h" | 41 #include "chrome/browser/ui/webui/chromeos/ui_account_tweaks.h" |
| 41 #include "chromeos/chromeos_switches.h" | 42 #include "chromeos/chromeos_switches.h" |
| (...skipping 1709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1751 {"handlerIsDefault", IDS_SETTINGS_SITE_SETTINGS_HANDLER_IS_DEFAULT}, | 1752 {"handlerIsDefault", IDS_SETTINGS_SITE_SETTINGS_HANDLER_IS_DEFAULT}, |
| 1752 {"handlerSetDefault", IDS_SETTINGS_SITE_SETTINGS_HANDLER_SET_DEFAULT}, | 1753 {"handlerSetDefault", IDS_SETTINGS_SITE_SETTINGS_HANDLER_SET_DEFAULT}, |
| 1753 {"handlerRemove", IDS_SETTINGS_SITE_SETTINGS_REMOVE}, | 1754 {"handlerRemove", IDS_SETTINGS_SITE_SETTINGS_REMOVE}, |
| 1754 {"adobeFlashStorage", IDS_SETTINGS_SITE_SETTINGS_ADOBE_FLASH_SETTINGS}, | 1755 {"adobeFlashStorage", IDS_SETTINGS_SITE_SETTINGS_ADOBE_FLASH_SETTINGS}, |
| 1755 {"learnMore", IDS_SETTINGS_SITE_SETTINGS_LEARN_MORE}, | 1756 {"learnMore", IDS_SETTINGS_SITE_SETTINGS_LEARN_MORE}, |
| 1756 {"incognitoSite", IDS_SETTINGS_SITE_SETTINGS_INCOGNITO}, | 1757 {"incognitoSite", IDS_SETTINGS_SITE_SETTINGS_INCOGNITO}, |
| 1757 {"incognitoSiteOnly", IDS_SETTINGS_SITE_SETTINGS_INCOGNITO_ONLY}, | 1758 {"incognitoSiteOnly", IDS_SETTINGS_SITE_SETTINGS_INCOGNITO_ONLY}, |
| 1758 {"embeddedIncognitoSite", IDS_SETTINGS_SITE_SETTINGS_INCOGNITO_EMBEDDED}, | 1759 {"embeddedIncognitoSite", IDS_SETTINGS_SITE_SETTINGS_INCOGNITO_EMBEDDED}, |
| 1759 {"siteSettingsSiteDetails", IDS_SETTINGS_SITE_DETAILS}, | 1760 {"siteSettingsSiteDetails", IDS_SETTINGS_SITE_DETAILS}, |
| 1760 {"noSitesAdded", IDS_SETTINGS_SITE_NO_SITES_ADDED}, | 1761 {"noSitesAdded", IDS_SETTINGS_SITE_NO_SITES_ADDED}, |
| 1762 {"siteSettingsSubresourceFilter", IDS_SUBRESOURCE_FILTER_HEADER}, | |
| 1763 {"siteSettingsSubresourceFilterAllow", IDS_SUBRESOURCE_FILTER_ALLOW_RADIO}, | |
| 1764 {"siteSettingsSubresourceFilterBlock", IDS_SUBRESOURCE_FILTER_BLOCK_RADIO}, | |
| 1761 }; | 1765 }; |
| 1762 AddLocalizedStringsBulk(html_source, localized_strings, | 1766 AddLocalizedStringsBulk(html_source, localized_strings, |
| 1763 arraysize(localized_strings)); | 1767 arraysize(localized_strings)); |
| 1764 | 1768 |
| 1765 html_source->AddBoolean("enableSiteSettings", | 1769 html_source->AddBoolean("enableSiteSettings", |
| 1766 base::CommandLine::ForCurrentProcess()->HasSwitch( | 1770 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 1767 switches::kEnableSiteSettings)); | 1771 switches::kEnableSiteSettings)); |
| 1772 html_source->AddBoolean( | |
| 1773 "isSubresourceFilterVisible", | |
|
tommycli
2017/03/13 19:17:01
All our other switches are named: "showFooBar" or
melandory
2017/03/20 22:16:19
Done.
| |
| 1774 base::FeatureList::IsEnabled( | |
| 1775 subresource_filter::kSafeBrowsingSubresourceFilterContentSetting)); | |
| 1768 | 1776 |
| 1769 if (PluginUtils::ShouldPreferHtmlOverPlugins( | 1777 if (PluginUtils::ShouldPreferHtmlOverPlugins( |
| 1770 HostContentSettingsMapFactory::GetForProfile(profile))) { | 1778 HostContentSettingsMapFactory::GetForProfile(profile))) { |
| 1771 LocalizedString flash_strings[] = { | 1779 LocalizedString flash_strings[] = { |
| 1772 {"siteSettingsFlashAskBefore", | 1780 {"siteSettingsFlashAskBefore", |
| 1773 IDS_SETTINGS_SITE_SETTINGS_FLASH_ASK_BEFORE_RUNNING}, | 1781 IDS_SETTINGS_SITE_SETTINGS_FLASH_ASK_BEFORE_RUNNING}, |
| 1774 {"siteSettingsFlashAskBeforeSubtitle", | 1782 {"siteSettingsFlashAskBeforeSubtitle", |
| 1775 IDS_SETTINGS_SITE_SETTINGS_FLASH_ASK_BEFORE_RUNNING_SUBTITLE}, | 1783 IDS_SETTINGS_SITE_SETTINGS_FLASH_ASK_BEFORE_RUNNING_SUBTITLE}, |
| 1776 }; | 1784 }; |
| 1777 AddLocalizedStringsBulk(html_source, flash_strings, | 1785 AddLocalizedStringsBulk(html_source, flash_strings, |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1970 | 1978 |
| 1971 #if defined(OS_CHROMEOS) | 1979 #if defined(OS_CHROMEOS) |
| 1972 chromeos::network_element::AddLocalizedStrings(html_source); | 1980 chromeos::network_element::AddLocalizedStrings(html_source); |
| 1973 #endif | 1981 #endif |
| 1974 policy_indicator::AddLocalizedStrings(html_source); | 1982 policy_indicator::AddLocalizedStrings(html_source); |
| 1975 | 1983 |
| 1976 html_source->SetJsonPath(kLocalizedStringsFile); | 1984 html_source->SetJsonPath(kLocalizedStringsFile); |
| 1977 } | 1985 } |
| 1978 | 1986 |
| 1979 } // namespace settings | 1987 } // namespace settings |
| OLD | NEW |