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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/ui/SettingsUI.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/SettingsUI.js b/third_party/WebKit/Source/devtools/front_end/ui/SettingsUI.js
index bc3a433720f31a3bf27ac541cf2244683f805d25..622effaf77fd75d1f29e9bc5f07614bd37000e2c 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/SettingsUI.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/SettingsUI.js
@@ -138,6 +138,25 @@ UI.SettingsUI.createSettingFieldset = function(setting) {
}
};
+/**
+ * @param {!Runtime.Extension} extension
+ * @return {?Element}
+ */
+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.
+ var descriptor = extension.descriptor();
+ var setting = Common.moduleSetting(descriptor['settingName']);
+ var uiTitle = Common.UIString(extension.title() || '');
+ switch (descriptor['settingType']) {
+ case 'boolean':
+ return UI.SettingsUI.createSettingCheckbox(uiTitle, setting);
+ case 'enum':
+ return UI.SettingsUI.createSettingSelect(uiTitle, descriptor['options'], setting);
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
+ default:
+ console.error('Invalid setting type: ' + descriptor['settingType']);
+ return null;
+ }
+};
+
/**
* @interface
*/

Powered by Google App Engine
This is Rietveld 408576698