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

Unified Diff: components/ui_devtools/views/ui_devtools_dom_agent.h

Issue 2959263002: Show corresponding window/widget/view in UIElement tree when clicking on a UI element. (Closed)
Patch Set: add domain overlay Created 3 years, 5 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: components/ui_devtools/views/ui_devtools_dom_agent.h
diff --git a/components/ui_devtools/views/ui_devtools_dom_agent.h b/components/ui_devtools/views/ui_devtools_dom_agent.h
index 701547f6cca0ee5b50a062311f45d9e2529ee8d4..77113669ad52acb1d5ba524bda281edc62e68489 100644
--- a/components/ui_devtools/views/ui_devtools_dom_agent.h
+++ b/components/ui_devtools/views/ui_devtools_dom_agent.h
@@ -9,6 +9,7 @@
#include "components/ui_devtools/devtools_base_agent.h"
#include "components/ui_devtools/views/ui_element_delegate.h"
#include "ui/aura/env_observer.h"
+#include "ui/events/event_handler.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
@@ -16,8 +17,13 @@ namespace aura {
class Window;
}
+namespace ui {
+class MouseEvent;
+}
+
namespace ui_devtools {
+class UIDevToolsOverlayAgent;
class UIElement;
class UIDevToolsDOMAgentObserver {
@@ -29,9 +35,10 @@ class UIDevToolsDOMAgentObserver {
class UIDevToolsDOMAgent : public ui_devtools::UiDevToolsBaseAgent<
ui_devtools::protocol::DOM::Metainfo>,
public UIElementDelegate,
- public aura::EnvObserver {
+ public aura::EnvObserver,
+ public ui::EventHandler {
public:
- UIDevToolsDOMAgent();
+ UIDevToolsDOMAgent(UIDevToolsOverlayAgent* overlay_agent);
~UIDevToolsDOMAgent() override;
// DOM::Backend:
@@ -42,6 +49,11 @@ class UIDevToolsDOMAgent : public ui_devtools::UiDevToolsBaseAgent<
std::unique_ptr<ui_devtools::protocol::DOM::HighlightConfig>
highlight_config,
ui_devtools::protocol::Maybe<int> node_id) override;
+ ui_devtools::protocol::Response setInspectMode(
+ ui_devtools::protocol::Maybe<String> mode,
+ std::unique_ptr<ui_devtools::protocol::DOM::HighlightConfig>
+ highlight_config,
+ ui_devtools::protocol::Maybe<int> node_id) override;
ui_devtools::protocol::Response hideHighlight() override;
// UIElementDelegate:
@@ -51,6 +63,9 @@ class UIDevToolsDOMAgent : public ui_devtools::UiDevToolsBaseAgent<
void OnUIElementBoundsChanged(UIElement* ui_element) override;
bool IsHighlightingWindow(aura::Window* window) override;
+ // ui:EventHandler:
+ void OnMouseEvent(ui::MouseEvent* event) override;
+
void AddObserver(UIDevToolsDOMAgentObserver* observer);
void RemoveObserver(UIDevToolsDOMAgentObserver* observer);
UIElement* GetElementFromNodeId(int node_id);
@@ -89,6 +104,7 @@ class UIDevToolsDOMAgent : public ui_devtools::UiDevToolsBaseAgent<
highlight_config,
int node_id);
+ UIDevToolsOverlayAgent* overlay_agent_;
bool is_building_tree_;
std::unique_ptr<UIElement> window_element_root_;
std::unordered_map<int, UIElement*> node_id_to_ui_element_;

Powered by Google App Engine
This is Rietveld 408576698