| 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" |
| 11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 14 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
| 15 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 15 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| 16 #include "chrome/browser/plugins/plugin_utils.h" | 16 #include "chrome/browser/plugins/plugin_utils.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| 18 #include "chrome/browser/ui/webui/policy_indicator_localized_strings_provider.h" | 18 #include "chrome/browser/ui/webui/policy_indicator_localized_strings_provider.h" |
| 19 #include "chrome/common/chrome_features.h" | 19 #include "chrome/common/chrome_features.h" |
| 20 #include "chrome/common/chrome_switches.h" |
| 20 #include "chrome/common/url_constants.h" | 21 #include "chrome/common/url_constants.h" |
| 21 #include "chrome/grit/chromium_strings.h" | 22 #include "chrome/grit/chromium_strings.h" |
| 22 #include "chrome/grit/generated_resources.h" | 23 #include "chrome/grit/generated_resources.h" |
| 23 #include "chrome/grit/locale_settings.h" | 24 #include "chrome/grit/locale_settings.h" |
| 24 #include "components/autofill/core/browser/payments/payments_service_url.h" | 25 #include "components/autofill/core/browser/payments/payments_service_url.h" |
| 25 #include "components/autofill/core/common/autofill_constants.h" | 26 #include "components/autofill/core/common/autofill_constants.h" |
| 26 #include "components/google/core/browser/google_util.h" | 27 #include "components/google/core/browser/google_util.h" |
| 27 #include "components/password_manager/core/browser/password_manager_constants.h" | 28 #include "components/password_manager/core/browser/password_manager_constants.h" |
| 28 #include "components/strings/grit/components_strings.h" | 29 #include "components/strings/grit/components_strings.h" |
| 29 #include "content/public/browser/web_ui_data_source.h" | 30 #include "content/public/browser/web_ui_data_source.h" |
| 30 #include "ui/base/l10n/l10n_util.h" | 31 #include "ui/base/l10n/l10n_util.h" |
| 31 | 32 |
| 33 |
| 32 #if defined(OS_CHROMEOS) | 34 #if defined(OS_CHROMEOS) |
| 33 #include "ash/common/system/chromeos/devicetype_utils.h" | 35 #include "ash/common/system/chromeos/devicetype_utils.h" |
| 34 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 36 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 35 #include "chrome/browser/ui/webui/chromeos/ui_account_tweaks.h" | 37 #include "chrome/browser/ui/webui/chromeos/ui_account_tweaks.h" |
| 36 #include "chrome/common/chrome_switches.h" | |
| 37 #include "chromeos/chromeos_switches.h" | 38 #include "chromeos/chromeos_switches.h" |
| 38 #include "components/user_manager/user.h" | 39 #include "components/user_manager/user.h" |
| 39 #include "components/user_manager/user_manager.h" | 40 #include "components/user_manager/user_manager.h" |
| 40 #include "ui/chromeos/strings/grit/ui_chromeos_strings.h" | 41 #include "ui/chromeos/strings/grit/ui_chromeos_strings.h" |
| 41 #else | 42 #else |
| 42 #include "chrome/browser/ui/webui/settings/system_handler.h" | 43 #include "chrome/browser/ui/webui/settings/system_handler.h" |
| 43 #endif | 44 #endif |
| 44 | 45 |
| 45 namespace settings { | 46 namespace settings { |
| 46 namespace { | 47 namespace { |
| (...skipping 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1487 {"adobeFlashStorage", IDS_SETTINGS_SITE_SETTINGS_ADOBE_FLASH_SETTINGS}, | 1488 {"adobeFlashStorage", IDS_SETTINGS_SITE_SETTINGS_ADOBE_FLASH_SETTINGS}, |
| 1488 {"learnMore", IDS_SETTINGS_SITE_SETTINGS_LEARN_MORE}, | 1489 {"learnMore", IDS_SETTINGS_SITE_SETTINGS_LEARN_MORE}, |
| 1489 {"incognitoSite", IDS_SETTINGS_SITE_SETTINGS_INCOGNITO}, | 1490 {"incognitoSite", IDS_SETTINGS_SITE_SETTINGS_INCOGNITO}, |
| 1490 {"incognitoSiteOnly", IDS_SETTINGS_SITE_SETTINGS_INCOGNITO_ONLY}, | 1491 {"incognitoSiteOnly", IDS_SETTINGS_SITE_SETTINGS_INCOGNITO_ONLY}, |
| 1491 {"embeddedIncognitoSite", IDS_SETTINGS_SITE_SETTINGS_INCOGNITO_EMBEDDED}, | 1492 {"embeddedIncognitoSite", IDS_SETTINGS_SITE_SETTINGS_INCOGNITO_EMBEDDED}, |
| 1492 {"siteSettingsSiteDetails", IDS_SETTINGS_SITE_DETAILS}, | 1493 {"siteSettingsSiteDetails", IDS_SETTINGS_SITE_DETAILS}, |
| 1493 }; | 1494 }; |
| 1494 AddLocalizedStringsBulk(html_source, localized_strings, | 1495 AddLocalizedStringsBulk(html_source, localized_strings, |
| 1495 arraysize(localized_strings)); | 1496 arraysize(localized_strings)); |
| 1496 | 1497 |
| 1498 html_source->AddBoolean("enableSiteSettings", |
| 1499 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 1500 switches::kEnableSiteSettings)); |
| 1501 |
| 1497 if (PluginUtils::ShouldPreferHtmlOverPlugins( | 1502 if (PluginUtils::ShouldPreferHtmlOverPlugins( |
| 1498 HostContentSettingsMapFactory::GetForProfile(profile))) { | 1503 HostContentSettingsMapFactory::GetForProfile(profile))) { |
| 1499 LocalizedString flash_strings[] = { | 1504 LocalizedString flash_strings[] = { |
| 1500 {"siteSettingsFlashAskBefore", | 1505 {"siteSettingsFlashAskBefore", |
| 1501 IDS_SETTINGS_SITE_SETTINGS_FLASH_ASK_BEFORE_RUNNING}, | 1506 IDS_SETTINGS_SITE_SETTINGS_FLASH_ASK_BEFORE_RUNNING}, |
| 1502 {"siteSettingsFlashAskBeforeSubtitle", | 1507 {"siteSettingsFlashAskBeforeSubtitle", |
| 1503 IDS_SETTINGS_SITE_SETTINGS_FLASH_ASK_BEFORE_RUNNING_SUBTITLE}, | 1508 IDS_SETTINGS_SITE_SETTINGS_FLASH_ASK_BEFORE_RUNNING_SUBTITLE}, |
| 1504 }; | 1509 }; |
| 1505 AddLocalizedStringsBulk(html_source, flash_strings, | 1510 AddLocalizedStringsBulk(html_source, flash_strings, |
| 1506 arraysize(flash_strings)); | 1511 arraysize(flash_strings)); |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1718 #endif | 1723 #endif |
| 1719 AddUsersStrings(html_source); | 1724 AddUsersStrings(html_source); |
| 1720 AddWebContentStrings(html_source); | 1725 AddWebContentStrings(html_source); |
| 1721 | 1726 |
| 1722 policy_indicator::AddLocalizedStrings(html_source); | 1727 policy_indicator::AddLocalizedStrings(html_source); |
| 1723 | 1728 |
| 1724 html_source->SetJsonPath(kLocalizedStringsFile); | 1729 html_source->SetJsonPath(kLocalizedStringsFile); |
| 1725 } | 1730 } |
| 1726 | 1731 |
| 1727 } // namespace settings | 1732 } // namespace settings |
| OLD | NEW |