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

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: Push updates to inspector when windows are added, destroyed or reorganized 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 85286538db936290ac1daa2938335855f9eacbdb..a73440dfcf4543ae8bc827c4be4b622b66a279f3 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,23 +16,37 @@ 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
- void enable(ui::devtools::protocol::ErrorString* error) override {}
- void disable(ui::devtools::protocol::ErrorString* error) override {}
+ void disable(ui::devtools::protocol::ErrorString* error) override;
void getDocument(
ui::devtools::protocol::ErrorString* error,
std::unique_ptr<ui::devtools::protocol::DOM::Node>* out_root) override;
+ // WindowObserver
+ void OnWindowTreeChanging(WmWindow* window,
+ const TreeChangeParams& params) 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, WmWindow* parent);
+ void RemoveWindowNode(WmWindow* window);
+ void AddObserverToRootWindows();
+ void RemoveObserverFromRootWindows();
+ void Reset();
ash::WmShell* shell_;
+ typedef std::unordered_map<WmWindow*, int> WindowToNodeIdMap;
sadrul 2016/11/02 02:04:36 Use 'using WindowToNodeIdMap = ...';
Sarmad Hashmi 2016/11/03 01:42:18 Done.
+ 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') | ash/common/devtools/ash_devtools_dom_agent.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698