Replace ConditionName with condition functions
Bug: none
Change-Id: I635ce61f6bd2d017d0c1d0deeb8e8752fb25e355
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5272852
Reviewed-by: Simon Zünd <[email protected]>
Commit-Queue: Alex Rudenko <[email protected]>
Auto-Submit: Alex Rudenko <[email protected]>
diff --git a/front_end/ui/legacy/ActionRegistration.ts b/front_end/ui/legacy/ActionRegistration.ts
index 03f6fed..3913ec2 100644
--- a/front_end/ui/legacy/ActionRegistration.ts
+++ b/front_end/ui/legacy/ActionRegistration.ts
@@ -223,7 +223,7 @@
return this.actionRegistration.setting;
}
- condition(): string|undefined {
+ condition(): Root.Runtime.Condition|undefined {
return this.actionRegistration.condition;
}
@@ -537,12 +537,12 @@
*/
setting?: string;
/**
- * A condition represented as a string the action's availability depends on. Conditions come
- * from the queryParamsObject defined in Runtime and just as the experiment field, they determine the availability
- * of the setting. A condition can be negated by prepending a ‘!’ to the value of the condition
- * property and in that case the behaviour of the action's availability will be inverted.
+ * A condition is a function that will make the action available if it
+ * returns true, and not available, otherwise. Make sure that objects you
+ * access from inside the condition function are ready at the time when the
+ * setting conditions are checked.
*/
- condition?: Root.Runtime.ConditionName;
+ condition?: Root.Runtime.Condition;
/**
* Used to sort actions when all registered actions are queried.
*/