| Index: components/ui_devtools/views/ui_devtools_dom_agent.h
|
| diff --git a/ash/devtools/ash_devtools_dom_agent.h b/components/ui_devtools/views/ui_devtools_dom_agent.h
|
| similarity index 54%
|
| rename from ash/devtools/ash_devtools_dom_agent.h
|
| rename to components/ui_devtools/views/ui_devtools_dom_agent.h
|
| index 8a171fea93b71589b06cfba33769106936e97637..701547f6cca0ee5b50a062311f45d9e2529ee8d4 100644
|
| --- a/ash/devtools/ash_devtools_dom_agent.h
|
| +++ b/components/ui_devtools/views/ui_devtools_dom_agent.h
|
| @@ -2,14 +2,12 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef ASH_DEVTOOLS_ASH_DEVTOOLS_DOM_AGENT_H_
|
| -#define ASH_DEVTOOLS_ASH_DEVTOOLS_DOM_AGENT_H_
|
| +#ifndef COMPONENTS_UI_DEVTOOLS_VIEWS_UI_DEVTOOLS_DOM_AGENT_H_
|
| +#define COMPONENTS_UI_DEVTOOLS_VIEWS_UI_DEVTOOLS_DOM_AGENT_H_
|
|
|
| -#include "ash/ash_export.h"
|
| -#include "ash/devtools/ui_element_delegate.h"
|
| -#include "base/macros.h"
|
| #include "components/ui_devtools/DOM.h"
|
| #include "components/ui_devtools/devtools_base_agent.h"
|
| +#include "components/ui_devtools/views/ui_element_delegate.h"
|
| #include "ui/aura/env_observer.h"
|
| #include "ui/views/view.h"
|
| #include "ui/views/widget/widget.h"
|
| @@ -18,35 +16,33 @@ namespace aura {
|
| class Window;
|
| }
|
|
|
| -namespace ash {
|
| -namespace devtools {
|
| +namespace ui_devtools {
|
|
|
| class UIElement;
|
|
|
| -class ASH_EXPORT AshDevToolsDOMAgentObserver {
|
| +class UIDevToolsDOMAgentObserver {
|
| public:
|
| // TODO(thanhph): Use UIElement* as input argument instead.
|
| virtual void OnNodeBoundsChanged(int node_id) = 0;
|
| };
|
|
|
| -class ASH_EXPORT AshDevToolsDOMAgent
|
| - : public NON_EXPORTED_BASE(ui::devtools::UiDevToolsBaseAgent<
|
| - ui::devtools::protocol::DOM::Metainfo>),
|
| - public UIElementDelegate,
|
| - public aura::EnvObserver {
|
| +class UIDevToolsDOMAgent : public ui_devtools::UiDevToolsBaseAgent<
|
| + ui_devtools::protocol::DOM::Metainfo>,
|
| + public UIElementDelegate,
|
| + public aura::EnvObserver {
|
| public:
|
| - AshDevToolsDOMAgent();
|
| - ~AshDevToolsDOMAgent() override;
|
| + UIDevToolsDOMAgent();
|
| + ~UIDevToolsDOMAgent() override;
|
|
|
| // DOM::Backend:
|
| - ui::devtools::protocol::Response disable() override;
|
| - ui::devtools::protocol::Response getDocument(
|
| - std::unique_ptr<ui::devtools::protocol::DOM::Node>* out_root) override;
|
| - ui::devtools::protocol::Response highlightNode(
|
| - std::unique_ptr<ui::devtools::protocol::DOM::HighlightConfig>
|
| + ui_devtools::protocol::Response disable() override;
|
| + ui_devtools::protocol::Response getDocument(
|
| + std::unique_ptr<ui_devtools::protocol::DOM::Node>* out_root) override;
|
| + ui_devtools::protocol::Response highlightNode(
|
| + std::unique_ptr<ui_devtools::protocol::DOM::HighlightConfig>
|
| highlight_config,
|
| - ui::devtools::protocol::Maybe<int> node_id) override;
|
| - ui::devtools::protocol::Response hideHighlight() override;
|
| + ui_devtools::protocol::Maybe<int> node_id) override;
|
| + ui_devtools::protocol::Response hideHighlight() override;
|
|
|
| // UIElementDelegate:
|
| void OnUIElementAdded(UIElement* parent, UIElement* child) override;
|
| @@ -55,8 +51,8 @@ class ASH_EXPORT AshDevToolsDOMAgent
|
| void OnUIElementBoundsChanged(UIElement* ui_element) override;
|
| bool IsHighlightingWindow(aura::Window* window) override;
|
|
|
| - void AddObserver(AshDevToolsDOMAgentObserver* observer);
|
| - void RemoveObserver(AshDevToolsDOMAgentObserver* observer);
|
| + void AddObserver(UIDevToolsDOMAgentObserver* observer);
|
| + void RemoveObserver(UIDevToolsDOMAgentObserver* observer);
|
| UIElement* GetElementFromNodeId(int node_id);
|
| UIElement* window_element_root() const { return window_element_root_.get(); };
|
| const std::vector<aura::Window*>& root_windows() const {
|
| @@ -69,16 +65,16 @@ class ASH_EXPORT AshDevToolsDOMAgent
|
| void OnHostInitialized(aura::WindowTreeHost* host) override;
|
|
|
| void OnNodeBoundsChanged(int node_id);
|
| - std::unique_ptr<ui::devtools::protocol::DOM::Node> BuildInitialTree();
|
| - std::unique_ptr<ui::devtools::protocol::DOM::Node> BuildTreeForUIElement(
|
| + std::unique_ptr<ui_devtools::protocol::DOM::Node> BuildInitialTree();
|
| + std::unique_ptr<ui_devtools::protocol::DOM::Node> BuildTreeForUIElement(
|
| UIElement* ui_element);
|
| - std::unique_ptr<ui::devtools::protocol::DOM::Node> BuildTreeForWindow(
|
| + std::unique_ptr<ui_devtools::protocol::DOM::Node> BuildTreeForWindow(
|
| UIElement* window_element_root,
|
| aura::Window* window);
|
| - std::unique_ptr<ui::devtools::protocol::DOM::Node> BuildTreeForRootWidget(
|
| + std::unique_ptr<ui_devtools::protocol::DOM::Node> BuildTreeForRootWidget(
|
| UIElement* widget_element,
|
| views::Widget* widget);
|
| - std::unique_ptr<ui::devtools::protocol::DOM::Node> BuildTreeForView(
|
| + std::unique_ptr<ui_devtools::protocol::DOM::Node> BuildTreeForView(
|
| UIElement* view_element,
|
| views::View* view);
|
| void RemoveDomNode(UIElement* ui_element);
|
| @@ -88,8 +84,8 @@ class ASH_EXPORT AshDevToolsDOMAgent
|
| const std::pair<aura::Window*, gfx::Rect>& window_and_bounds,
|
| SkColor background,
|
| SkColor border);
|
| - ui::devtools::protocol::Response HighlightNode(
|
| - std::unique_ptr<ui::devtools::protocol::DOM::HighlightConfig>
|
| + ui_devtools::protocol::Response HighlightNode(
|
| + std::unique_ptr<ui_devtools::protocol::DOM::HighlightConfig>
|
| highlight_config,
|
| int node_id);
|
|
|
| @@ -98,12 +94,11 @@ class ASH_EXPORT AshDevToolsDOMAgent
|
| std::unordered_map<int, UIElement*> node_id_to_ui_element_;
|
| std::unique_ptr<views::Widget> widget_for_highlighting_;
|
| std::vector<aura::Window*> root_windows_;
|
| - base::ObserverList<AshDevToolsDOMAgentObserver> observers_;
|
| + base::ObserverList<UIDevToolsDOMAgentObserver> observers_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(AshDevToolsDOMAgent);
|
| + DISALLOW_COPY_AND_ASSIGN(UIDevToolsDOMAgent);
|
| };
|
|
|
| -} // namespace devtools
|
| -} // namespace ash
|
| +} // namespace ui_devtools
|
|
|
| -#endif // ASH_DEVTOOLS_ASH_DEVTOOLS_DOM_AGENT_H_
|
| +#endif // COMPONENTS_UI_DEVTOOLS_VIEWS_UI_DEVTOOLS_DOM_AGENT_H_
|
|
|