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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ui_devtools/views/ui_devtools_css_agent.h
diff --git a/components/ui_devtools/views/ui_devtools_css_agent.h b/components/ui_devtools/views/ui_devtools_css_agent.h
new file mode 100644
index 0000000000000000000000000000000000000000..ef88dccce1dc487850d9b54785af9b4b4cc9dee5
--- /dev/null
+++ b/components/ui_devtools/views/ui_devtools_css_agent.h
@@ -0,0 +1,53 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_UI_DEVTOOLS_VIEWS_UI_DEVTOOLS_CSS_AGENT_H_
+#define COMPONENTS_UI_DEVTOOLS_VIEWS_UI_DEVTOOLS_CSS_AGENT_H_
+
+#include "base/macros.h"
+#include "components/ui_devtools/CSS.h"
+#include "components/ui_devtools/views/ui_devtools_dom_agent.h"
+
+namespace ui_devtools {
+
+class UIDevToolsCSSAgent : public ui_devtools::UiDevToolsBaseAgent<
+ ui_devtools::protocol::CSS::Metainfo>,
+ public UIDevToolsDOMAgentObserver {
+ public:
+ explicit UIDevToolsCSSAgent(UIDevToolsDOMAgent* dom_agent);
+ ~UIDevToolsCSSAgent() override;
+
+ // CSS::Backend:
+ ui_devtools::protocol::Response enable() override;
+ ui_devtools::protocol::Response disable() override;
+ ui_devtools::protocol::Response getMatchedStylesForNode(
+ int node_id,
+ ui_devtools::protocol::Maybe<ui_devtools::protocol::CSS::CSSStyle>*
+ inline_style) override;
+ ui_devtools::protocol::Response setStyleTexts(
+ std::unique_ptr<ui_devtools::protocol::Array<
+ ui_devtools::protocol::CSS::StyleDeclarationEdit>> edits,
+ std::unique_ptr<
+ ui_devtools::protocol::Array<ui_devtools::protocol::CSS::CSSStyle>>*
+ result) override;
+
+ // UIDevToolsDOMAgentObserver:
+ void OnNodeBoundsChanged(int node_id) override;
+
+ private:
+ std::unique_ptr<ui_devtools::protocol::CSS::CSSStyle> GetStylesForNode(
+ int node_id);
+ void InvalidateStyleSheet(int node_id);
+ bool GetPropertiesForNodeId(int node_id, gfx::Rect* bounds, bool* visible);
+ bool SetPropertiesForNodeId(int node_id,
+ const gfx::Rect& bounds,
+ bool visible);
+ UIDevToolsDOMAgent* dom_agent_;
+
+ DISALLOW_COPY_AND_ASSIGN(UIDevToolsCSSAgent);
+};
+
+} // namespace ui_devtools
+
+#endif // COMPONENTS_UI_DEVTOOLS_VIEWS_UI_DEVTOOLS_CSS_AGENT_H_
« 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