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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp

Issue 2296323002: DevTools: Add features to collect classnames from Stylesheets and DOM (Closed)
Patch Set: DevTools: Add features to collect classnames from Stylesheets and DOM 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/core/inspector/InspectorCSSAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
index fbd395b0546bb4c75aa89484aaad029e6ba84b8a..9bce4548c243c4f44053b94b6fc89cc13ae1d3c8 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
@@ -1083,6 +1083,16 @@ void InspectorCSSAgent::getStyleSheetText(ErrorString* errorString, const String
inspectorStyleSheet->getText(result);
}
+void InspectorCSSAgent::collectClassNames(ErrorString* errorString, const String& styleSheetId, std::unique_ptr<protocol::Array<String>>* classNames)
+{
+ IdToInspectorStyleSheet::iterator it = m_idToInspectorStyleSheet.find(styleSheetId);
+ if (it == m_idToInspectorStyleSheet.end()) {
+ *errorString = "No style sheet with given id found";
+ return;
+ }
+ *classNames = it->value.get()->collectClassNames();
+}
+
void InspectorCSSAgent::setStyleSheetText(ErrorString* errorString, const String& styleSheetId, const String& text, protocol::Maybe<String>* sourceMapURL)
{
FrontendOperationScope scope;

Powered by Google App Engine
This is Rietveld 408576698