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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/SettingsUI.js

Issue 2839413002: DevTools: add rendering overlay options to command menu (Closed)
Patch Set: ac Created 3 years, 7 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 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 fieldset.disabled = !setting.get(); 132 fieldset.disabled = !setting.get();
133 setting.addChangeListener(settingChanged); 133 setting.addChangeListener(settingChanged);
134 return fieldset; 134 return fieldset;
135 135
136 function settingChanged() { 136 function settingChanged() {
137 fieldset.disabled = !setting.get(); 137 fieldset.disabled = !setting.get();
138 } 138 }
139 }; 139 };
140 140
141 /** 141 /**
142 * @param {!Runtime.Extension} extension
143 * @return {?Element}
144 */
145 UI.SettingsUI.settingExtensionToControl = function(extension) {
dgozman 2017/05/15 19:07:44 Let's pass setting instance here, and let it have
luoe 2017/05/16 00:05:47 Done. Introducing an extension() getter feels a l
dgozman 2017/05/16 18:47:25 I think removing setting.title() is the right way.
146 var descriptor = extension.descriptor();
147 var setting = Common.moduleSetting(descriptor['settingName']);
148 var uiTitle = Common.UIString(extension.title() || '');
149 switch (descriptor['settingType']) {
150 case 'boolean':
151 return UI.SettingsUI.createSettingCheckbox(uiTitle, setting);
152 case 'enum':
153 return UI.SettingsUI.createSettingSelect(uiTitle, descriptor['options'], s etting);
dgozman 2017/05/15 19:07:44 Let's do some validation here - that options exist
luoe 2017/05/16 00:05:47 Done in the previous patch, since it falls within
154 default:
155 console.error('Invalid setting type: ' + descriptor['settingType']);
156 return null;
157 }
158 };
159
160 /**
142 * @interface 161 * @interface
143 */ 162 */
144 UI.SettingUI = function() {}; 163 UI.SettingUI = function() {};
145 164
146 UI.SettingUI.prototype = { 165 UI.SettingUI.prototype = {
147 /** 166 /**
148 * @return {?Element} 167 * @return {?Element}
149 */ 168 */
150 settingElement() {} 169 settingElement() {}
151 }; 170 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698