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

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

Issue 2466073003: Push updates to inspector when windows are added, destroyed or reorganized (Closed)
Patch Set: Document previous sibling id 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
« no previous file with comments | « no previous file | ash/common/devtools/ash_devtools_dom_agent.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « no previous file | ash/common/devtools/ash_devtools_dom_agent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698