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

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

Issue 2529553002: Hook up views/widgets to AshDevToolsDOMAgent (Closed)
Patch Set: sadruls comments and merge test CL with this 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 b79f606ac7d317aff8d92b3d7a0ca657c41101a5..de4d23b7b6c9085f21fb94279146502f88438cc5 100644
--- a/ash/common/devtools/ash_devtools_dom_agent.h
+++ b/ash/common/devtools/ash_devtools_dom_agent.h
@@ -11,7 +11,9 @@
#include "components/ui_devtools/DOM.h"
#include "components/ui_devtools/devtools_base_agent.h"
#include "ui/views/view.h"
+#include "ui/views/view_observer.h"
#include "ui/views/widget/widget.h"
+#include "ui/views/widget/widget_removals_observer.h"
namespace ash {
namespace devtools {
@@ -19,7 +21,9 @@ namespace devtools {
class ASH_EXPORT AshDevToolsDOMAgent
: public NON_EXPORTED_BASE(ui::devtools::UiDevToolsBaseAgent<
ui::devtools::protocol::DOM::Metainfo>),
- public WmWindowObserver {
+ public WmWindowObserver,
+ public views::WidgetRemovalsObserver,
+ public views::ViewObserver {
public:
explicit AshDevToolsDOMAgent(ash::WmShell* shell);
~AshDevToolsDOMAgent() override;
@@ -36,6 +40,14 @@ class ASH_EXPORT AshDevToolsDOMAgent
const TreeChangeParams& params) override;
void OnWindowStackingChanged(WmWindow* window) override;
+ // views::WidgetRemovalsObserver
+ void OnWillRemoveView(views::Widget* widget, views::View* view) override;
+
+ // views::ViewObserver
+ void OnChildViewRemoved(views::View* view, views::View* parent) override;
+ void OnChildViewAdded(views::View* view) override;
+ void OnChildViewReordered(views::View*) override;
+
WmWindow* GetWindowFromNodeId(int nodeId);
views::Widget* GetWidgetFromNodeId(int nodeId);
views::View* GetViewFromNodeId(int nodeId);
@@ -61,9 +73,12 @@ class ASH_EXPORT AshDevToolsDOMAgent
void RemoveWindowTree(WmWindow* window, bool remove_observer);
void RemoveWindowNode(WmWindow* window, bool remove_observer);
+ // Don't need AddWidgetTree because |widget| will always be inside a window,
+ // so when windows are created, their widget nodes are created as well.
void RemoveWidgetTree(views::Widget* widget, bool remove_observer);
void RemoveWidgetNode(views::Widget* widget, bool remove_observer);
+ void AddViewTree(views::View* view);
void RemoveViewTree(views::View* view,
views::View* parent,
bool remove_observer);
@@ -71,7 +86,7 @@ class ASH_EXPORT AshDevToolsDOMAgent
views::View* parent,
bool remove_observer);
- void RemoveObserverFromAllWindows();
+ void RemoveObservers();
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