| OLD | NEW |
| 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_DEVTOOLS_ASH_DEVTOOLS_CSS_AGENT_H_ | 5 #ifndef COMPONENTS_UI_DEVTOOLS_DEVTOOLS_UI_DEVTOOLS_CSS_AGENT_H_ |
| 6 #define ASH_DEVTOOLS_ASH_DEVTOOLS_CSS_AGENT_H_ | 6 #define COMPONENTS_UI_DEVTOOLS_DEVTOOLS_UI_DEVTOOLS_CSS_AGENT_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | |
| 9 #include "ash/devtools/ash_devtools_dom_agent.h" | |
| 10 #include "base/macros.h" | 8 #include "base/macros.h" |
| 11 #include "components/ui_devtools/CSS.h" | 9 #include "components/ui_devtools/CSS.h" |
| 10 #include "components/ui_devtools/devtools/ui_devtools_dom_agent.h" |
| 12 | 11 |
| 13 namespace ash { | 12 namespace ui { |
| 14 namespace devtools { | 13 namespace devtools { |
| 15 | 14 |
| 16 class ASH_EXPORT AshDevToolsCSSAgent | 15 class UIDevToolsCSSAgent |
| 17 : public NON_EXPORTED_BASE(ui::devtools::UiDevToolsBaseAgent< | 16 : public NON_EXPORTED_BASE(ui::devtools::UiDevToolsBaseAgent< |
| 18 ui::devtools::protocol::CSS::Metainfo>), | 17 ui::devtools::protocol::CSS::Metainfo>), |
| 19 public AshDevToolsDOMAgentObserver { | 18 public UIDevToolsDOMAgentObserver { |
| 20 public: | 19 public: |
| 21 explicit AshDevToolsCSSAgent(AshDevToolsDOMAgent* dom_agent); | 20 explicit UIDevToolsCSSAgent(UIDevToolsDOMAgent* dom_agent); |
| 22 ~AshDevToolsCSSAgent() override; | 21 ~UIDevToolsCSSAgent() override; |
| 23 | 22 |
| 24 // CSS::Backend: | 23 // CSS::Backend: |
| 25 ui::devtools::protocol::Response enable() override; | 24 ui::devtools::protocol::Response enable() override; |
| 26 ui::devtools::protocol::Response disable() override; | 25 ui::devtools::protocol::Response disable() override; |
| 27 ui::devtools::protocol::Response getMatchedStylesForNode( | 26 ui::devtools::protocol::Response getMatchedStylesForNode( |
| 28 int node_id, | 27 int node_id, |
| 29 ui::devtools::protocol::Maybe<ui::devtools::protocol::CSS::CSSStyle>* | 28 ui::devtools::protocol::Maybe<ui::devtools::protocol::CSS::CSSStyle>* |
| 30 inline_style) override; | 29 inline_style) override; |
| 31 ui::devtools::protocol::Response setStyleTexts( | 30 ui::devtools::protocol::Response setStyleTexts( |
| 32 std::unique_ptr<ui::devtools::protocol::Array< | 31 std::unique_ptr<ui::devtools::protocol::Array< |
| 33 ui::devtools::protocol::CSS::StyleDeclarationEdit>> edits, | 32 ui::devtools::protocol::CSS::StyleDeclarationEdit>> edits, |
| 34 std::unique_ptr< | 33 std::unique_ptr< |
| 35 ui::devtools::protocol::Array<ui::devtools::protocol::CSS::CSSStyle>>* | 34 ui::devtools::protocol::Array<ui::devtools::protocol::CSS::CSSStyle>>* |
| 36 result) override; | 35 result) override; |
| 37 | 36 |
| 38 // AshDevToolsDOMAgentObserver: | 37 // UIDevToolsDOMAgentObserver: |
| 39 void OnNodeBoundsChanged(int node_id) override; | 38 void OnNodeBoundsChanged(int node_id) override; |
| 40 | 39 |
| 41 private: | 40 private: |
| 42 std::unique_ptr<ui::devtools::protocol::CSS::CSSStyle> GetStylesForNode( | 41 std::unique_ptr<ui::devtools::protocol::CSS::CSSStyle> GetStylesForNode( |
| 43 int node_id); | 42 int node_id); |
| 44 void InvalidateStyleSheet(int node_id); | 43 void InvalidateStyleSheet(int node_id); |
| 45 bool GetPropertiesForNodeId(int node_id, gfx::Rect* bounds, bool* visible); | 44 bool GetPropertiesForNodeId(int node_id, gfx::Rect* bounds, bool* visible); |
| 46 bool SetPropertiesForNodeId(int node_id, | 45 bool SetPropertiesForNodeId(int node_id, |
| 47 const gfx::Rect& bounds, | 46 const gfx::Rect& bounds, |
| 48 bool visible); | 47 bool visible); |
| 49 AshDevToolsDOMAgent* dom_agent_; | 48 UIDevToolsDOMAgent* dom_agent_; |
| 50 | 49 |
| 51 DISALLOW_COPY_AND_ASSIGN(AshDevToolsCSSAgent); | 50 DISALLOW_COPY_AND_ASSIGN(UIDevToolsCSSAgent); |
| 52 }; | 51 }; |
| 53 | 52 |
| 54 } // namespace devtools | 53 } // namespace devtools |
| 55 } // namespace ash | 54 } // namespace ui |
| 56 | 55 |
| 57 #endif // ASH_DEVTOOLS_ASH_DEVTOOLS_CSS_AGENT_H_ | 56 #endif // COMPONENTS_UI_DEVTOOLS_DEVTOOLS_UI_DEVTOOLS_CSS_AGENT_H_ |
| OLD | NEW |