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

Side by Side Diff: components/ui_devtools/views/ui_devtools_css_agent.h

Issue 2899783002: Move DevTools out of ash and turn it to a component. (Closed)
Patch Set: add README.md Created 3 years, 6 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_UI_DEVTOOLS_VIEWS_UI_DEVTOOLS_CSS_AGENT_H_
6 #define COMPONENTS_UI_DEVTOOLS_VIEWS_UI_DEVTOOLS_CSS_AGENT_H_
7
8 #include "base/macros.h"
9 #include "components/ui_devtools/CSS.h"
10 #include "components/ui_devtools/views/ui_devtools_dom_agent.h"
11
12 namespace ui_devtools {
13
14 class UIDevToolsCSSAgent : public ui_devtools::UiDevToolsBaseAgent<
15 ui_devtools::protocol::CSS::Metainfo>,
16 public UIDevToolsDOMAgentObserver {
17 public:
18 explicit UIDevToolsCSSAgent(UIDevToolsDOMAgent* dom_agent);
19 ~UIDevToolsCSSAgent() override;
20
21 // CSS::Backend:
22 ui_devtools::protocol::Response enable() override;
23 ui_devtools::protocol::Response disable() override;
24 ui_devtools::protocol::Response getMatchedStylesForNode(
25 int node_id,
26 ui_devtools::protocol::Maybe<ui_devtools::protocol::CSS::CSSStyle>*
27 inline_style) override;
28 ui_devtools::protocol::Response setStyleTexts(
29 std::unique_ptr<ui_devtools::protocol::Array<
30 ui_devtools::protocol::CSS::StyleDeclarationEdit>> edits,
31 std::unique_ptr<
32 ui_devtools::protocol::Array<ui_devtools::protocol::CSS::CSSStyle>>*
33 result) override;
34
35 // UIDevToolsDOMAgentObserver:
36 void OnNodeBoundsChanged(int node_id) override;
37
38 private:
39 std::unique_ptr<ui_devtools::protocol::CSS::CSSStyle> GetStylesForNode(
40 int node_id);
41 void InvalidateStyleSheet(int node_id);
42 bool GetPropertiesForNodeId(int node_id, gfx::Rect* bounds, bool* visible);
43 bool SetPropertiesForNodeId(int node_id,
44 const gfx::Rect& bounds,
45 bool visible);
46 UIDevToolsDOMAgent* dom_agent_;
47
48 DISALLOW_COPY_AND_ASSIGN(UIDevToolsCSSAgent);
49 };
50
51 } // namespace ui_devtools
52
53 #endif // COMPONENTS_UI_DEVTOOLS_VIEWS_UI_DEVTOOLS_CSS_AGENT_H_
OLDNEW
« no previous file with comments | « components/ui_devtools/views/OWNERS ('k') | components/ui_devtools/views/ui_devtools_css_agent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698