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

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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/settings/SettingsScreen.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c16b54580f46a147b6e4664e41272982aa70e040..76b306fe835017f7eb52df00626855f41862d8b3 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/SettingsUI.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/SettingsUI.js
@@ -123,6 +123,29 @@ UI.SettingsUI.createCustomSetting = function(name, element) {
};
/**
+ * @param {!Common.Setting} setting
+ * @return {?Element}
+ */
+UI.SettingsUI.createControlForSetting = function(setting) {
+ if (!setting.extension())
+ return null;
+ var descriptor = setting.extension().descriptor();
+ var uiTitle = Common.UIString(setting.title() || '');
+ switch (descriptor['settingType']) {
+ case 'boolean':
+ return UI.SettingsUI.createSettingCheckbox(uiTitle, setting);
+ case 'enum':
+ if (Array.isArray(descriptor['options']))
+ return UI.SettingsUI.createSettingSelect(uiTitle, descriptor['options'], setting);
+ console.error('Enum setting defined without options');
+ return null;
+ default:
+ console.error('Invalid setting type: ' + descriptor['settingType']);
+ return null;
+ }
+};
+
+/**
* @interface
*/
UI.SettingUI = function() {};
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/settings/SettingsScreen.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698