overlay_agent.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright 2018 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. #ifndef COMPONENTS_UI_DEVTOOLS_OVERLAY_AGENT_H_
  5. #define COMPONENTS_UI_DEVTOOLS_OVERLAY_AGENT_H_
  6. #include "components/ui_devtools/dom_agent.h"
  7. #include "components/ui_devtools/overlay.h"
  8. namespace ui_devtools {
  9. class UI_DEVTOOLS_EXPORT OverlayAgent
  10. : public UiDevToolsBaseAgent<protocol::Overlay::Metainfo> {
  11. public:
  12. explicit OverlayAgent(DOMAgent* dom_agent);
  13. OverlayAgent(const OverlayAgent&) = delete;
  14. OverlayAgent& operator=(const OverlayAgent&) = delete;
  15. ~OverlayAgent() override;
  16. // Overlay::Backend:
  17. protocol::Response setInspectMode(
  18. const protocol::String& in_mode,
  19. protocol::Maybe<protocol::Overlay::HighlightConfig> in_highlightConfig)
  20. override;
  21. protocol::Response highlightNode(
  22. std::unique_ptr<protocol::Overlay::HighlightConfig> highlight_config,
  23. protocol::Maybe<int> node_id) override;
  24. protocol::Response hideHighlight() override;
  25. protected:
  26. DOMAgent* dom_agent() const { return dom_agent_; }
  27. private:
  28. DOMAgent* const dom_agent_;
  29. };
  30. } // namespace ui_devtools
  31. #endif // COMPONENTS_UI_DEVTOOLS_OVERLAY_AGENT_H_