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

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

Issue 2527573003: Refactor remove methods, add DCHECKS, and remove_observer boolean (Closed)
Patch Set: sadruls comments 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 88ac1970ad14c9db2450efd90e1f4d838621fbd2..b79f606ac7d317aff8d92b3d7a0ca657c41101a5 100644
--- a/ash/common/devtools/ash_devtools_dom_agent.h
+++ b/ash/common/devtools/ash_devtools_dom_agent.h
@@ -45,19 +45,33 @@ class ASH_EXPORT AshDevToolsDOMAgent
int GetNodeIdFromView(views::View* view);
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> BuildInitialTree();
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);
- void RemoveWidgetNode(views::Widget* widget);
- void RemoveViewNode(views::View* view);
+ std::unique_ptr<ui::devtools::protocol::DOM::Node> BuildTreeForRootWidget(
+ views::Widget* widget);
+ std::unique_ptr<ui::devtools::protocol::DOM::Node> BuildTreeForView(
+ views::View* view);
+
+ void AddWindowTree(WmWindow* window);
+ // |remove_observer| ensures that we don't add a duplicate observer in any
+ // observer callback. For example, |remove_observer| is false when rebuilding
+ // the tree in OnWindowStackingChanged so that the observer is not removed and
+ // re-added, thus causing endless calls on the observer.
+ void RemoveWindowTree(WmWindow* window, bool remove_observer);
+ void RemoveWindowNode(WmWindow* window, bool remove_observer);
+
+ void RemoveWidgetTree(views::Widget* widget, bool remove_observer);
+ void RemoveWidgetNode(views::Widget* widget, bool remove_observer);
+
+ void RemoveViewTree(views::View* view,
+ views::View* parent,
+ bool remove_observer);
+ void RemoveViewNode(views::View* view,
+ views::View* parent,
+ bool remove_observer);
+
void RemoveObserverFromAllWindows();
- void AddRootWindowObservers();
void Reset();
ash::WmShell* shell_;
« 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