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

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

Issue 2343773002: DevTools: Autocomplete class names in ClassesPaneWidget (Closed)
Patch Set: 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
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 3f3586c50425ccf6b472dba366768ea26d43662a..cd0548265d4204b57b766e816d094875ca399fe7 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(?)} fulfill
+ * @this {WebInspector.DOMModel}
+ */
+ function promiseBody(fulfill)
+ {
+ this._agent.collectClassNamesFromSubtree(nodeId, classNamesCallback);
+
+ /**
+ * @param {?string} error
lushnikov 2016/09/15 17:58:31 nit: comment indentation
ahmetemirercin 2016/09/16 05:08:44 Done.
+ * @param {!Array<string>} classNames
+ */
+ function classNamesCallback(error, classNames)
+ {
+ if (!error && classNames)
+ fulfill(classNames);
+ else
+ fulfill(null);
lushnikov 2016/09/15 17:58:31 let's fulfill []
ahmetemirercin 2016/09/16 05:08:44 Done.
+ }
+ }
+ },
+
+ /**
+ * @param {!DOMAgent.NodeId} nodeId
* @param {string} selectors
* @param {function(?DOMAgent.NodeId)=} callback
*/

Powered by Google App Engine
This is Rietveld 408576698