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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/DOMModel.js

Issue 2343773002: DevTools: Autocomplete class names in ClassesPaneWidget (Closed)
Patch Set: Reviewed Created 4 years, 3 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/sdk/CSSModel.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/sdk/DOMModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/DOMModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/DOMModel.js
index 8885d5b49d41702e3652dbbbe95bc97dfb796683..4cc73c1e14e189c19b4e3eb661e877b8b2e5d7f8 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/DOMModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/DOMModel.js
@@ -1738,6 +1738,36 @@ WebInspector.DOMModel.prototype = {
/**
* @param {!DOMAgent.NodeId} nodeId
+ * @return {!Promise<!Array<string>>}
+ */
+ classNamesPromise: function(nodeId)
+ {
+ return new Promise(promiseBody.bind(this));
+
+ /**
+ * @param {function(!Array<string>)} fulfill
+ * @this {WebInspector.DOMModel}
+ */
+ function promiseBody(fulfill)
+ {
+ this._agent.collectClassNamesFromSubtree(nodeId, classNamesCallback);
+
+ /**
+ * @param {?string} error
+ * @param {?Array<string>} classNames
+ */
+ function classNamesCallback(error, classNames)
+ {
+ if (!error && classNames)
+ fulfill(classNames);
+ else
+ fulfill([]);
+ }
+ }
+ },
+
+ /**
+ * @param {!DOMAgent.NodeId} nodeId
* @param {string} selectors
* @param {function(?DOMAgent.NodeId)=} callback
*/
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/sdk/CSSModel.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698