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

Side by Side Diff: chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc

Issue 2408613002: Replace kPreferHtmlOverPlugins feature checks with PluginUtils::ShouldPreferHtmlOverPlugi… (Closed)
Patch Set: Replace remaining kPreferHtmlOverPlugins feature checks with PluginUtils::ShouldPreferHtmlOverPlugi… Created 4 years, 2 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 | « chrome/browser/ui/webui/options/content_settings_handler.cc ('k') | 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 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"
16 #include "chrome/browser/plugins/plugin_utils.h"
15 #include "chrome/browser/profiles/profile.h" 17 #include "chrome/browser/profiles/profile.h"
16 #include "chrome/browser/ui/webui/policy_indicator_localized_strings_provider.h" 18 #include "chrome/browser/ui/webui/policy_indicator_localized_strings_provider.h"
17 #include "chrome/common/chrome_features.h" 19 #include "chrome/common/chrome_features.h"
18 #include "chrome/common/url_constants.h" 20 #include "chrome/common/url_constants.h"
19 #include "chrome/grit/chromium_strings.h" 21 #include "chrome/grit/chromium_strings.h"
20 #include "chrome/grit/generated_resources.h" 22 #include "chrome/grit/generated_resources.h"
21 #include "chrome/grit/locale_settings.h" 23 #include "chrome/grit/locale_settings.h"
22 #include "components/autofill/core/browser/payments/payments_service_url.h" 24 #include "components/autofill/core/browser/payments/payments_service_url.h"
23 #include "components/autofill/core/common/autofill_constants.h" 25 #include "components/autofill/core/common/autofill_constants.h"
24 #include "components/google/core/browser/google_util.h" 26 #include "components/google/core/browser/google_util.h"
(...skipping 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after
1279 {"searchEnginesEdit", IDS_SETTINGS_SEARCH_ENGINES_EDIT}, 1281 {"searchEnginesEdit", IDS_SETTINGS_SEARCH_ENGINES_EDIT},
1280 {"searchEnginesRemoveFromList", 1282 {"searchEnginesRemoveFromList",
1281 IDS_SETTINGS_SEARCH_ENGINES_REMOVE_FROM_LIST}, 1283 IDS_SETTINGS_SEARCH_ENGINES_REMOVE_FROM_LIST},
1282 {"searchEnginesManageExtension", 1284 {"searchEnginesManageExtension",
1283 IDS_SETTINGS_SEARCH_ENGINES_MANAGE_EXTENSION}, 1285 IDS_SETTINGS_SEARCH_ENGINES_MANAGE_EXTENSION},
1284 }; 1286 };
1285 AddLocalizedStringsBulk(html_source, localized_strings, 1287 AddLocalizedStringsBulk(html_source, localized_strings,
1286 arraysize(localized_strings)); 1288 arraysize(localized_strings));
1287 } 1289 }
1288 1290
1289 void AddSiteSettingsStrings(content::WebUIDataSource* html_source) { 1291 void AddSiteSettingsStrings(content::WebUIDataSource* html_source,
1292 Profile* profile) {
1290 LocalizedString localized_strings[] = { 1293 LocalizedString localized_strings[] = {
1291 {"addSiteHeader", IDS_SETTINGS_ADD_SITE_HEADER}, 1294 {"addSiteHeader", IDS_SETTINGS_ADD_SITE_HEADER},
1292 {"addSiteLink", IDS_SETTINGS_ADD_SITE_LINK}, 1295 {"addSiteLink", IDS_SETTINGS_ADD_SITE_LINK},
1293 {"addSite", IDS_SETTINGS_ADD_SITE}, 1296 {"addSite", IDS_SETTINGS_ADD_SITE},
1294 {"cookieAppCache", IDS_COOKIES_APPLICATION_CACHE}, 1297 {"cookieAppCache", IDS_COOKIES_APPLICATION_CACHE},
1295 {"cookieCacheStorage", IDS_COOKIES_CACHE_STORAGE}, 1298 {"cookieCacheStorage", IDS_COOKIES_CACHE_STORAGE},
1296 {"cookieChannelId", IDS_COOKIES_CHANNEL_ID}, 1299 {"cookieChannelId", IDS_COOKIES_CHANNEL_ID},
1297 {"cookieDatabaseStorage", IDS_COOKIES_DATABASE_STORAGE}, 1300 {"cookieDatabaseStorage", IDS_COOKIES_DATABASE_STORAGE},
1298 {"cookieFileSystem", IDS_COOKIES_FILE_SYSTEM}, 1301 {"cookieFileSystem", IDS_COOKIES_FILE_SYSTEM},
1299 {"cookieFlashLso", IDS_COOKIES_FLASH_LSO}, 1302 {"cookieFlashLso", IDS_COOKIES_FLASH_LSO},
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
1464 {"adobeFlashStorage", IDS_SETTINGS_SITE_SETTINGS_ADOBE_FLASH_SETTINGS}, 1467 {"adobeFlashStorage", IDS_SETTINGS_SITE_SETTINGS_ADOBE_FLASH_SETTINGS},
1465 {"learnMore", IDS_SETTINGS_SITE_SETTINGS_LEARN_MORE}, 1468 {"learnMore", IDS_SETTINGS_SITE_SETTINGS_LEARN_MORE},
1466 {"incognitoSite", IDS_SETTINGS_SITE_SETTINGS_INCOGNITO}, 1469 {"incognitoSite", IDS_SETTINGS_SITE_SETTINGS_INCOGNITO},
1467 {"incognitoSiteOnly", IDS_SETTINGS_SITE_SETTINGS_INCOGNITO_ONLY}, 1470 {"incognitoSiteOnly", IDS_SETTINGS_SITE_SETTINGS_INCOGNITO_ONLY},
1468 {"embeddedIncognitoSite", IDS_SETTINGS_SITE_SETTINGS_INCOGNITO_EMBEDDED}, 1471 {"embeddedIncognitoSite", IDS_SETTINGS_SITE_SETTINGS_INCOGNITO_EMBEDDED},
1469 {"siteSettingsSiteDetails", IDS_SETTINGS_SITE_DETAILS}, 1472 {"siteSettingsSiteDetails", IDS_SETTINGS_SITE_DETAILS},
1470 }; 1473 };
1471 AddLocalizedStringsBulk(html_source, localized_strings, 1474 AddLocalizedStringsBulk(html_source, localized_strings,
1472 arraysize(localized_strings)); 1475 arraysize(localized_strings));
1473 1476
1474 if (base::FeatureList::IsEnabled(features::kPreferHtmlOverPlugins)) { 1477 if (PluginUtils::ShouldPreferHtmlOverPlugins(
1478 HostContentSettingsMapFactory::GetForProfile(profile))) {
1475 LocalizedString flash_strings[] = { 1479 LocalizedString flash_strings[] = {
1476 {"siteSettingsFlashAskBefore", 1480 {"siteSettingsFlashAskBefore",
1477 IDS_SETTINGS_SITE_SETTINGS_FLASH_ASK_BEFORE_RUNNING}, 1481 IDS_SETTINGS_SITE_SETTINGS_FLASH_ASK_BEFORE_RUNNING},
1478 {"siteSettingsFlashAskBeforeSubtitle", 1482 {"siteSettingsFlashAskBeforeSubtitle",
1479 IDS_SETTINGS_SITE_SETTINGS_FLASH_ASK_BEFORE_RUNNING_SUBTITLE}, 1483 IDS_SETTINGS_SITE_SETTINGS_FLASH_ASK_BEFORE_RUNNING_SUBTITLE},
1480 }; 1484 };
1481 AddLocalizedStringsBulk(html_source, flash_strings, 1485 AddLocalizedStringsBulk(html_source, flash_strings,
1482 arraysize(flash_strings)); 1486 arraysize(flash_strings));
1483 } else { 1487 } else {
1484 LocalizedString flash_strings[] = { 1488 LocalizedString flash_strings[] = {
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
1681 #endif 1685 #endif
1682 AddOnStartupStrings(html_source); 1686 AddOnStartupStrings(html_source);
1683 AddPasswordsAndFormsStrings(html_source); 1687 AddPasswordsAndFormsStrings(html_source);
1684 AddPeopleStrings(html_source); 1688 AddPeopleStrings(html_source);
1685 AddPrintingStrings(html_source); 1689 AddPrintingStrings(html_source);
1686 AddPrivacyStrings(html_source); 1690 AddPrivacyStrings(html_source);
1687 AddResetStrings(html_source); 1691 AddResetStrings(html_source);
1688 AddSearchEnginesStrings(html_source); 1692 AddSearchEnginesStrings(html_source);
1689 AddSearchInSettingsStrings(html_source); 1693 AddSearchInSettingsStrings(html_source);
1690 AddSearchStrings(html_source); 1694 AddSearchStrings(html_source);
1691 AddSiteSettingsStrings(html_source); 1695 AddSiteSettingsStrings(html_source, profile);
1692 #if !defined(OS_CHROMEOS) 1696 #if !defined(OS_CHROMEOS)
1693 AddSystemStrings(html_source); 1697 AddSystemStrings(html_source);
1694 #endif 1698 #endif
1695 AddUsersStrings(html_source); 1699 AddUsersStrings(html_source);
1696 AddWebContentStrings(html_source); 1700 AddWebContentStrings(html_source);
1697 1701
1698 policy_indicator::AddLocalizedStrings(html_source); 1702 policy_indicator::AddLocalizedStrings(html_source);
1699 1703
1700 html_source->SetJsonPath(kLocalizedStringsFile); 1704 html_source->SetJsonPath(kLocalizedStringsFile);
1701 } 1705 }
1702 1706
1703 } // namespace settings 1707 } // namespace settings
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/content_settings_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698