| 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 46af6a218063d135d0c3d4e5ccca6f04225711a0..760671f742105bb36dad4908993ab72fae3a4a7d 100644
|
| --- a/ash/common/devtools/ash_devtools_dom_agent.h
|
| +++ b/ash/common/devtools/ash_devtools_dom_agent.h
|
| @@ -6,6 +6,7 @@
|
| #define ASH_COMMON_DEVTOOLS_ASH_DEVTOOLS_DOM_AGENT_H_
|
|
|
| #include "ash/common/wm_shell.h"
|
| +#include "ash/common/wm_window_observer.h"
|
| #include "base/compiler_specific.h"
|
| #include "components/ui_devtools/DOM.h"
|
| #include "components/ui_devtools/devtools_base_agent.h"
|
| @@ -15,22 +16,38 @@ namespace devtools {
|
|
|
| class ASH_EXPORT AshDevToolsDOMAgent
|
| : public NON_EXPORTED_BASE(ui::devtools::UiDevToolsBaseAgent<
|
| - ui::devtools::protocol::DOM::Metainfo>) {
|
| + ui::devtools::protocol::DOM::Metainfo>),
|
| + public WmWindowObserver {
|
| public:
|
| explicit AshDevToolsDOMAgent(ash::WmShell* shell);
|
| ~AshDevToolsDOMAgent() override;
|
|
|
| // DOM::Backend
|
| - ui::devtools::protocol::Response enable() override;
|
| ui::devtools::protocol::Response disable() override;
|
| ui::devtools::protocol::Response getDocument(
|
| std::unique_ptr<ui::devtools::protocol::DOM::Node>* out_root) override;
|
|
|
| + // WindowObserver
|
| + void OnWindowDestroying(WmWindow* window) override;
|
| + void OnWindowTreeChanged(WmWindow* window,
|
| + const TreeChangeParams& params) override;
|
| + void OnWindowStackingChanged(WmWindow* window) override;
|
| +
|
| private:
|
| + std::unique_ptr<ui::devtools::protocol::DOM::Node> BuildTreeForWindow(
|
| + WmWindow* window);
|
| std::unique_ptr<ui::devtools::protocol::DOM::Node> BuildInitialTree();
|
| + void AddWindowNode(WmWindow* window);
|
| + void RemoveWindowNode(WmWindow* window, WmWindow* old_parent);
|
| + void RemoveObserverFromAllWindows();
|
| + void AddRootWindowObservers();
|
| + void Reset();
|
|
|
| ash::WmShell* shell_;
|
|
|
| + using WindowToNodeIdMap = std::unordered_map<WmWindow*, int>;
|
| + WindowToNodeIdMap window_to_node_id_map_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(AshDevToolsDOMAgent);
|
| };
|
|
|
|
|