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

Unified Diff: chrome/browser/resources/settings/site_settings/site_settings_behavior.js

Issue 2280233002: [HBD] Update MD Site Settings Plugins section to show 3rd mode checkbox. (Closed)
Patch Set: merge origin/master Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/settings/site_settings/site_settings_behavior.js
diff --git a/chrome/browser/resources/settings/site_settings/site_settings_behavior.js b/chrome/browser/resources/settings/site_settings/site_settings_behavior.js
index 423006f496e17c49855e9866bb0f78f5a87d8d68..7c48cbb3dcff577c2ffbda46e203e48ac2b6326b 100644
--- a/chrome/browser/resources/settings/site_settings/site_settings_behavior.js
+++ b/chrome/browser/resources/settings/site_settings/site_settings_behavior.js
@@ -248,13 +248,14 @@ var SiteSettingsBehaviorImpl = {
/**
* A utility function to compute the description for the category.
* @param {string} category The category to show the description for.
- * @param {boolean} categoryEnabled The state of the global toggle.
+ * @param {string} setting The string value of the setting.
* @param {boolean} showRecommendation Whether to show the '(recommended)'
* label prefix.
* @return {string} The category description.
* @protected
*/
- computeCategoryDesc: function(category, categoryEnabled, showRecommendation) {
+ computeCategoryDesc: function(category, setting, showRecommendation) {
+ var categoryEnabled = this.computeIsSettingEnabled(category, setting);
switch (category) {
case settings.ContentSettingsTypes.JAVASCRIPT:
// "Allowed (recommended)" vs "Blocked".
@@ -315,14 +316,11 @@ var SiteSettingsBehaviorImpl = {
loadTimeData.getString('siteSettingsShowAllRecommended') :
loadTimeData.getString('siteSettingsShowAll');
case settings.ContentSettingsTypes.PLUGINS:
- // "Detect and run important content (recommended)" vs "Let me choose".
- if (!categoryEnabled) {
- return loadTimeData.getString('siteSettingsLetMeChoose');
- }
- return showRecommendation ?
- loadTimeData.getString(
- 'siteSettingsDetectAndRunImportantRecommended') :
- loadTimeData.getString('siteSettingsDetectAndRunImportant');
+ if (setting == settings.PermissionValues.ALLOW)
+ return loadTimeData.getString('siteSettingsFlashAllow');
+ if (setting == settings.PermissionValues.BLOCK)
+ return loadTimeData.getString('siteSettingsFlashBlock');
+ return loadTimeData.getString('siteSettingsFlashAskBefore');
case settings.ContentSettingsTypes.BACKGROUND_SYNC:
// "Allow sites to finish sending and receiving data" vs "Do not allow".
if (!categoryEnabled) {

Powered by Google App Engine
This is Rietveld 408576698