Index: third_party/WebKit/Source/devtools/front_end/common/Settings.js |
diff --git a/third_party/WebKit/Source/devtools/front_end/common/Settings.js b/third_party/WebKit/Source/devtools/front_end/common/Settings.js |
index 280e168499ef29428b2a15c9190a0eabe04baea1..372336c000b8f10a3354c2c80691a0c17b38db95 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/common/Settings.js |
+++ b/third_party/WebKit/Source/devtools/front_end/common/Settings.js |
@@ -75,6 +75,8 @@ Common.Settings = class { |
this.createSetting(settingName, defaultValue, storageType); |
if (descriptor['title']) |
setting.setTitle(descriptor['title']); |
+ if (descriptor['options']) |
+ setting.setOptions(descriptor['options']); |
this._moduleSettings.set(settingName, setting); |
} |
@@ -263,6 +265,8 @@ Common.Setting = class { |
this._storage = storage; |
/** @type {string} */ |
this._title = ''; |
+ /** @type {!Array<!Common.Setting.Option>|undefined} */ |
+ this._options; |
} |
/** |
@@ -300,6 +304,20 @@ Common.Setting = class { |
} |
/** |
+ * @return {!Array<!Common.Setting.Option>} |
+ */ |
+ options() { |
lushnikov
2017/03/11 00:46:00
Let's not infect Common.Setting with fields which
luoe
2017/05/09 02:58:00
Done.
|
+ return this._options || []; |
+ } |
+ |
+ /** |
+ * @param {!Array<!Common.Setting.Option>} options |
+ */ |
+ setOptions(options) { |
+ this._options = options; |
+ } |
+ |
+ /** |
* @return {V} |
*/ |
get() { |
@@ -814,6 +832,9 @@ Common.SettingStorageType = { |
Session: Symbol('Session') |
}; |
+/** @typedef {!{title: string, value: *, raw: (boolean|undefined)}} */ |
+Common.Setting.Option; |
+ |
/** |
* @param {string} settingName |
* @return {!Common.Setting} |