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

Side by Side Diff: chrome/browser/resources/settings/site_settings/protocol_handlers.js

Issue 2280233002: [HBD] Update MD Site Settings Plugins section to show 3rd mode checkbox. (Closed)
Patch Set: merge origin/master Created 4 years, 3 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * 'protocol-handlers' is the polymer element for showing the 7 * 'protocol-handlers' is the polymer element for showing the
8 * protocol handlers category under Site Settings. 8 * protocol handlers category under Site Settings.
9 */ 9 */
10 10
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 this.browserProxy.initializeProtocolHandlerList(); 71 this.browserProxy.initializeProtocolHandlerList();
72 }, 72 },
73 73
74 /** 74 /**
75 * Obtains the description for the main toggle. 75 * Obtains the description for the main toggle.
76 * @param {boolean} categoryEnabled Whether the main toggle is enabled. 76 * @param {boolean} categoryEnabled Whether the main toggle is enabled.
77 * @return {string} The description to use. 77 * @return {string} The description to use.
78 * @private 78 * @private
79 */ 79 */
80 computeHandlersDescription_: function(categoryEnabled) { 80 computeHandlersDescription_: function(categoryEnabled) {
81 var setting = categoryEnabled ?
82 settings.PermissionValues.ALLOW : settings.PermissionValues.BLOCK;
81 return this.computeCategoryDesc( 83 return this.computeCategoryDesc(
82 settings.ContentSettingsTypes.PROTOCOL_HANDLERS, categoryEnabled, true); 84 settings.ContentSettingsTypes.PROTOCOL_HANDLERS, setting, true);
83 }, 85 },
84 86
85 /** 87 /**
86 * Returns whether the given index matches the default handler. 88 * Returns whether the given index matches the default handler.
87 * @param {number} index The index to evaluate. 89 * @param {number} index The index to evaluate.
88 * @param {number} defaultHandler The default handler index. 90 * @param {number} defaultHandler The default handler index.
89 * @return {boolean} Whether the item is default. 91 * @return {boolean} Whether the item is default.
90 * @private 92 * @private
91 */ 93 */
92 isDefault_: function(index, defaultHandler) { 94 isDefault_: function(index, defaultHandler) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 onActionMenuIronActivate_: function(event) { 141 onActionMenuIronActivate_: function(event) {
140 var protocol = event.model.item.protocol; 142 var protocol = event.model.item.protocol;
141 var url = event.model.item.spec; 143 var url = event.model.item.spec;
142 if (event.detail.selected == MenuActions.SET_DEFAULT) { 144 if (event.detail.selected == MenuActions.SET_DEFAULT) {
143 this.browserProxy.setProtocolDefault(protocol, url); 145 this.browserProxy.setProtocolDefault(protocol, url);
144 } else if (event.detail.selected == MenuActions.REMOVE) { 146 } else if (event.detail.selected == MenuActions.REMOVE) {
145 this.browserProxy.removeProtocolHandler(protocol, url); 147 this.browserProxy.removeProtocolHandler(protocol, url);
146 } 148 }
147 }, 149 },
148 }); 150 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698