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

Side by Side Diff: ash/common/devtools/ash_devtools_dom_agent.h

Issue 2476353002: Fix bug where removed (but not deleted) windows are not reflected in the tree properly (Closed)
Patch Set: Remove old_parent parameter 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ASH_COMMON_DEVTOOLS_ASH_DEVTOOLS_DOM_AGENT_H_ 5 #ifndef ASH_COMMON_DEVTOOLS_ASH_DEVTOOLS_DOM_AGENT_H_
6 #define ASH_COMMON_DEVTOOLS_ASH_DEVTOOLS_DOM_AGENT_H_ 6 #define ASH_COMMON_DEVTOOLS_ASH_DEVTOOLS_DOM_AGENT_H_
7 7
8 #include "ash/common/wm_shell.h" 8 #include "ash/common/wm_shell.h"
9 #include "ash/common/wm_window_observer.h" 9 #include "ash/common/wm_window_observer.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 10 matching lines...) Expand all
21 public: 21 public:
22 explicit AshDevToolsDOMAgent(ash::WmShell* shell); 22 explicit AshDevToolsDOMAgent(ash::WmShell* shell);
23 ~AshDevToolsDOMAgent() override; 23 ~AshDevToolsDOMAgent() override;
24 24
25 // DOM::Backend 25 // DOM::Backend
26 ui::devtools::protocol::Response disable() override; 26 ui::devtools::protocol::Response disable() override;
27 ui::devtools::protocol::Response getDocument( 27 ui::devtools::protocol::Response getDocument(
28 std::unique_ptr<ui::devtools::protocol::DOM::Node>* out_root) override; 28 std::unique_ptr<ui::devtools::protocol::DOM::Node>* out_root) override;
29 29
30 // WindowObserver 30 // WindowObserver
31 void OnWindowDestroying(WmWindow* window) override; 31 void OnWindowTreeChanging(WmWindow* window,
32 const TreeChangeParams& params) override;
32 void OnWindowTreeChanged(WmWindow* window, 33 void OnWindowTreeChanged(WmWindow* window,
33 const TreeChangeParams& params) override; 34 const TreeChangeParams& params) override;
34 void OnWindowStackingChanged(WmWindow* window) override; 35 void OnWindowStackingChanged(WmWindow* window) override;
35 36
36 private: 37 private:
37 std::unique_ptr<ui::devtools::protocol::DOM::Node> BuildTreeForWindow( 38 std::unique_ptr<ui::devtools::protocol::DOM::Node> BuildTreeForWindow(
38 WmWindow* window); 39 WmWindow* window);
39 std::unique_ptr<ui::devtools::protocol::DOM::Node> BuildInitialTree(); 40 std::unique_ptr<ui::devtools::protocol::DOM::Node> BuildInitialTree();
40 void AddWindowNode(WmWindow* window); 41 void AddWindowNode(WmWindow* window);
41 void RemoveWindowNode(WmWindow* window, WmWindow* old_parent); 42 void RemoveWindowNode(WmWindow* window);
42 void RemoveObserverFromAllWindows(); 43 void RemoveObserverFromAllWindows();
43 void AddRootWindowObservers(); 44 void AddRootWindowObservers();
44 void Reset(); 45 void Reset();
45 46
46 ash::WmShell* shell_; 47 ash::WmShell* shell_;
47 48
48 using WindowToNodeIdMap = std::unordered_map<WmWindow*, int>; 49 using WindowToNodeIdMap = std::unordered_map<WmWindow*, int>;
49 WindowToNodeIdMap window_to_node_id_map_; 50 WindowToNodeIdMap window_to_node_id_map_;
50 51
51 DISALLOW_COPY_AND_ASSIGN(AshDevToolsDOMAgent); 52 DISALLOW_COPY_AND_ASSIGN(AshDevToolsDOMAgent);
52 }; 53 };
53 54
54 } // namespace devtools 55 } // namespace devtools
55 } // namespace ash 56 } // namespace ash
56 57
57 #endif // ASH_COMMON_DEVTOOLS_ASH_DEVTOOLS_DOM_AGENT_H_ 58 #endif // ASH_COMMON_DEVTOOLS_ASH_DEVTOOLS_DOM_AGENT_H_
OLDNEW
« no previous file with comments | « no previous file | ash/common/devtools/ash_devtools_dom_agent.cc » ('j') | ash/common/devtools/ash_devtools_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698