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

Unified Diff: ash/common/devtools/ash_devtools_dom_agent.h

Issue 2486543003: Add CSS agent for various window/widget/view attributes in devtools (Closed)
Patch Set: rebase Created 4 years, 1 month 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: ash/common/devtools/ash_devtools_dom_agent.h
diff --git a/ash/common/devtools/ash_devtools_dom_agent.h b/ash/common/devtools/ash_devtools_dom_agent.h
index 97cae3050eb1eb042de35b0c9133e75b25403feb..dab35b99117368722962a06bf867a7182f1c20cb 100644
--- a/ash/common/devtools/ash_devtools_dom_agent.h
+++ b/ash/common/devtools/ash_devtools_dom_agent.h
@@ -10,6 +10,8 @@
#include "base/compiler_specific.h"
#include "components/ui_devtools/DOM.h"
#include "components/ui_devtools/devtools_base_agent.h"
+#include "ui/views/view.h"
+#include "ui/views/widget/widget.h"
namespace ash {
namespace devtools {
@@ -34,7 +36,15 @@ class ASH_EXPORT AshDevToolsDOMAgent
const TreeChangeParams& params) override;
void OnWindowStackingChanged(WmWindow* window) override;
+ WmWindow* GetWindowFromNodeId(int nodeId);
+ views::Widget* GetWidgetFromNodeId(int nodeId);
+ views::View* GetViewFromNodeId(int nodeId);
+
private:
+ std::unique_ptr<ui::devtools::protocol::DOM::Node> BuildTreeForView(
+ views::View* view);
+ std::unique_ptr<ui::devtools::protocol::DOM::Node> BuildTreeForRootWidget(
+ views::Widget* widget);
std::unique_ptr<ui::devtools::protocol::DOM::Node> BuildTreeForWindow(
WmWindow* window);
std::unique_ptr<ui::devtools::protocol::DOM::Node> BuildInitialTree();
@@ -49,6 +59,10 @@ class ASH_EXPORT AshDevToolsDOMAgent
using WindowToNodeIdMap = std::unordered_map<WmWindow*, int>;
WindowToNodeIdMap window_to_node_id_map_;
+ std::unordered_map<int, WmWindow*> node_id_to_window_map_;
+ std::unordered_map<int, views::Widget*> node_id_to_widget_map_;
+ std::unordered_map<int, views::View*> node_id_to_view_map_;
+
DISALLOW_COPY_AND_ASSIGN(AshDevToolsDOMAgent);
};

Powered by Google App Engine
This is Rietveld 408576698