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

Side by Side Diff: ash/devtools/ash_devtools_css_agent.h

Issue 2776543002: Create a unified UIElement interface for Widget, View and Window. (Closed)
Patch Set: nits Created 3 years, 7 months 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_DEVTOOLS_ASH_DEVTOOLS_CSS_AGENT_H_ 5 #ifndef ASH_DEVTOOLS_ASH_DEVTOOLS_CSS_AGENT_H_
6 #define ASH_DEVTOOLS_ASH_DEVTOOLS_CSS_AGENT_H_ 6 #define ASH_DEVTOOLS_ASH_DEVTOOLS_CSS_AGENT_H_
7 7
8 #include "ash/ash_export.h"
8 #include "ash/devtools/ash_devtools_dom_agent.h" 9 #include "ash/devtools/ash_devtools_dom_agent.h"
10 #include "base/macros.h"
9 #include "components/ui_devtools/CSS.h" 11 #include "components/ui_devtools/CSS.h"
10 #include "ui/views/widget/widget_observer.h"
11 12
12 namespace ash { 13 namespace ash {
13 namespace devtools { 14 namespace devtools {
14 15
15 class ASH_EXPORT AshDevToolsCSSAgent 16 class ASH_EXPORT AshDevToolsCSSAgent
16 : public NON_EXPORTED_BASE(ui::devtools::UiDevToolsBaseAgent< 17 : public NON_EXPORTED_BASE(ui::devtools::UiDevToolsBaseAgent<
17 ui::devtools::protocol::CSS::Metainfo>), 18 ui::devtools::protocol::CSS::Metainfo>),
18 public AshDevToolsDOMAgentObserver { 19 public AshDevToolsDOMAgentObserver {
19 public: 20 public:
20 explicit AshDevToolsCSSAgent(AshDevToolsDOMAgent* dom_agent); 21 explicit AshDevToolsCSSAgent(AshDevToolsDOMAgent* dom_agent);
21 ~AshDevToolsCSSAgent() override; 22 ~AshDevToolsCSSAgent() override;
22 23
23 // CSS::Backend 24 // CSS::Backend:
24 ui::devtools::protocol::Response enable() override; 25 ui::devtools::protocol::Response enable() override;
25 ui::devtools::protocol::Response disable() override; 26 ui::devtools::protocol::Response disable() override;
26 ui::devtools::protocol::Response getMatchedStylesForNode( 27 ui::devtools::protocol::Response getMatchedStylesForNode(
27 int node_id, 28 int node_id,
28 ui::devtools::protocol::Maybe<ui::devtools::protocol::CSS::CSSStyle>* 29 ui::devtools::protocol::Maybe<ui::devtools::protocol::CSS::CSSStyle>*
29 inline_style) override; 30 inline_style) override;
30 ui::devtools::protocol::Response setStyleTexts( 31 ui::devtools::protocol::Response setStyleTexts(
31 std::unique_ptr<ui::devtools::protocol::Array< 32 std::unique_ptr<ui::devtools::protocol::Array<
32 ui::devtools::protocol::CSS::StyleDeclarationEdit>> edits, 33 ui::devtools::protocol::CSS::StyleDeclarationEdit>> edits,
33 std::unique_ptr< 34 std::unique_ptr<
34 ui::devtools::protocol::Array<ui::devtools::protocol::CSS::CSSStyle>>* 35 ui::devtools::protocol::Array<ui::devtools::protocol::CSS::CSSStyle>>*
35 result) override; 36 result) override;
36 37
37 // AshDevToolsDOMAgentObserver 38 // AshDevToolsDOMAgentObserver:
38 void OnWindowBoundsChanged(aura::Window* window) override; 39 void OnNodeBoundsChanged(int node_id) override;
39 void OnWidgetBoundsChanged(views::Widget* widget) override;
40 void OnViewBoundsChanged(views::View* view) override;
41 40
42 private: 41 private:
43 std::unique_ptr<ui::devtools::protocol::CSS::CSSStyle> GetStylesForNode( 42 std::unique_ptr<ui::devtools::protocol::CSS::CSSStyle> GetStylesForNode(
44 int node_id); 43 int node_id);
45 void InvalidateStyleSheet(int node_id); 44 void InvalidateStyleSheet(int node_id);
46 bool GetPropertiesForNodeId(int node_id, gfx::Rect* bounds, bool* visible); 45 bool GetPropertiesForNodeId(int node_id, gfx::Rect* bounds, bool* visible);
47 bool SetPropertiesForNodeId(int node_id, 46 bool SetPropertiesForNodeId(int node_id,
48 const gfx::Rect& bounds, 47 const gfx::Rect& bounds,
49 bool visible); 48 bool visible);
50 AshDevToolsDOMAgent* dom_agent_; 49 AshDevToolsDOMAgent* dom_agent_;
51 50
52 DISALLOW_COPY_AND_ASSIGN(AshDevToolsCSSAgent); 51 DISALLOW_COPY_AND_ASSIGN(AshDevToolsCSSAgent);
53 }; 52 };
54 53
55 } // namespace devtools 54 } // namespace devtools
56 } // namespace ash 55 } // namespace ash
57 56
58 #endif // ASH_DEVTOOLS_ASH_DEVTOOLS_CSS_AGENT_H_ 57 #endif // ASH_DEVTOOLS_ASH_DEVTOOLS_CSS_AGENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698