| Index: third_party/WebKit/Source/web/InspectorOverlayAgent.h | 
| diff --git a/third_party/WebKit/Source/web/InspectorOverlay.h b/third_party/WebKit/Source/web/InspectorOverlayAgent.h | 
| similarity index 55% | 
| rename from third_party/WebKit/Source/web/InspectorOverlay.h | 
| rename to third_party/WebKit/Source/web/InspectorOverlayAgent.h | 
| index 6cc0a65135893c29a84184d732aba2f407628b6b..9662583e0d2c910b929f899126da0057c9b11190 100644 | 
| --- a/third_party/WebKit/Source/web/InspectorOverlay.h | 
| +++ b/third_party/WebKit/Source/web/InspectorOverlayAgent.h | 
| @@ -26,14 +26,15 @@ | 
| * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 
| */ | 
|  | 
| -#ifndef InspectorOverlay_h | 
| -#define InspectorOverlay_h | 
| +#ifndef InspectorOverlayAgent_h | 
| +#define InspectorOverlayAgent_h | 
|  | 
| #include <v8-inspector.h> | 
| #include <memory> | 
| -#include "core/inspector/InspectorDOMAgent.h" | 
| +#include "core/inspector/InspectorBaseAgent.h" | 
| +#include "core/inspector/InspectorHighlight.h" | 
| #include "core/inspector/InspectorOverlayHost.h" | 
| -#include "core/inspector/protocol/Forward.h" | 
| +#include "core/inspector/protocol/Overlay.h" | 
| #include "platform/Timer.h" | 
| #include "platform/geometry/FloatQuad.h" | 
| #include "platform/geometry/LayoutRect.h" | 
| @@ -46,6 +47,8 @@ | 
| namespace blink { | 
|  | 
| class Color; | 
| +class InspectedFrames; | 
| +class InspectorDOMAgent; | 
| class LocalFrame; | 
| class Node; | 
| class Page; | 
| @@ -55,36 +58,68 @@ class WebMouseEvent; | 
| class WebLocalFrameImpl; | 
| class WebTouchEvent; | 
|  | 
| -namespace protocol { | 
| -class Value; | 
| -} | 
| - | 
| -class InspectorOverlay final | 
| -    : public GarbageCollectedFinalized<InspectorOverlay>, | 
| -      public InspectorDOMAgent::Client, | 
| +class InspectorOverlayAgent final | 
| +    : public InspectorBaseAgent<protocol::Overlay::Metainfo>, | 
| public InspectorOverlayHost::Listener { | 
| -  USING_GARBAGE_COLLECTED_MIXIN(InspectorOverlay); | 
| +  USING_GARBAGE_COLLECTED_MIXIN(InspectorOverlayAgent); | 
|  | 
| public: | 
| -  explicit InspectorOverlay(WebLocalFrameImpl*); | 
| -  ~InspectorOverlay() override; | 
| +  InspectorOverlayAgent(WebLocalFrameImpl*, | 
| +                        InspectedFrames*, | 
| +                        v8_inspector::V8InspectorSession*, | 
| +                        InspectorDOMAgent*); | 
| +  ~InspectorOverlayAgent() override; | 
| DECLARE_TRACE(); | 
|  | 
| -  void Init(v8_inspector::V8InspectorSession*, InspectorDOMAgent*); | 
| +  // protocol::Dispatcher::OverlayCommandHandler implementation. | 
| +  protocol::Response enable() override; | 
| +  protocol::Response disable() override; | 
| +  protocol::Response setShowPaintRects(bool) override; | 
| +  protocol::Response setShowDebugBorders(bool) override; | 
| +  protocol::Response setShowFPSCounter(bool) override; | 
| +  protocol::Response setShowScrollBottleneckRects(bool) override; | 
| +  protocol::Response setShowViewportSizeOnResize(bool) override; | 
| +  protocol::Response setPausedInDebuggerMessage( | 
| +      protocol::Maybe<String>) override; | 
| +  protocol::Response setSuspended(bool) override; | 
| +  protocol::Response setInspectMode( | 
| +      const String& mode, | 
| +      protocol::Maybe<protocol::Overlay::HighlightConfig>) override; | 
| +  protocol::Response highlightRect( | 
| +      int x, | 
| +      int y, | 
| +      int width, | 
| +      int height, | 
| +      protocol::Maybe<protocol::DOM::RGBA> color, | 
| +      protocol::Maybe<protocol::DOM::RGBA> outline_color) override; | 
| +  protocol::Response highlightQuad( | 
| +      std::unique_ptr<protocol::Array<double>> quad, | 
| +      protocol::Maybe<protocol::DOM::RGBA> color, | 
| +      protocol::Maybe<protocol::DOM::RGBA> outline_color) override; | 
| +  protocol::Response highlightNode( | 
| +      std::unique_ptr<protocol::Overlay::HighlightConfig>, | 
| +      protocol::Maybe<int> node_id, | 
| +      protocol::Maybe<int> backend_node_id, | 
| +      protocol::Maybe<String> object_id) override; | 
| +  protocol::Response hideHighlight() override; | 
| +  protocol::Response highlightFrame( | 
| +      const String& frame_id, | 
| +      protocol::Maybe<protocol::DOM::RGBA> content_color, | 
| +      protocol::Maybe<protocol::DOM::RGBA> content_outline_color) override; | 
| +  protocol::Response getHighlightObjectForTest( | 
| +      int node_id, | 
| +      std::unique_ptr<protocol::DictionaryValue>* highlight) override; | 
| + | 
| +  // InspectorBaseAgent overrides. | 
| +  void Restore() override; | 
|  | 
| -  void Clear(); | 
| -  void Suspend(); | 
| -  void Resume(); | 
| +  void Inspect(Node*); | 
| bool HandleInputEvent(const WebInputEvent&); | 
| void PageLayoutInvalidated(bool resized); | 
| -  void SetShowViewportSizeOnResize(bool); | 
| void ShowReloadingBlanket(); | 
| void HideReloadingBlanket(); | 
| -  void SetPausedInDebuggerMessage(const String&); | 
| - | 
| // Does not yet include paint. | 
| void UpdateAllLifecyclePhases(); | 
| - | 
| PageOverlay* GetPageOverlay() { return page_overlay_.get(); }; | 
| String EvaluateInOverlayForTest(const String&); | 
|  | 
| @@ -92,24 +127,16 @@ class InspectorOverlay final | 
| class InspectorOverlayChromeClient; | 
| class InspectorPageOverlayDelegate; | 
|  | 
| +  enum SearchMode { | 
| +    kNotSearching, | 
| +    kSearchingForNormal, | 
| +    kSearchingForUAShadow, | 
| +  }; | 
| + | 
| // InspectorOverlayHost::Listener implementation. | 
| void OverlayResumed() override; | 
| void OverlaySteppedOver() override; | 
|  | 
| -  // InspectorDOMAgent::Client implementation. | 
| -  void HideHighlight() override; | 
| -  void HighlightNode(Node*, | 
| -                     const InspectorHighlightConfig&, | 
| -                     bool omit_tooltip) override; | 
| -  void HighlightQuad(std::unique_ptr<FloatQuad>, | 
| -                     const InspectorHighlightConfig&) override; | 
| -  void SetInspectMode(InspectorDOMAgent::SearchMode, | 
| -                      std::unique_ptr<InspectorHighlightConfig>) override; | 
| - | 
| -  void HighlightNode(Node*, | 
| -                     Node* event_target, | 
| -                     const InspectorHighlightConfig&, | 
| -                     bool omit_tooltip); | 
| bool IsEmpty(); | 
| void DrawNodeHighlight(); | 
| void DrawQuadHighlight(); | 
| @@ -136,10 +163,30 @@ class InspectorOverlay final | 
| bool HandleGestureEvent(const WebGestureEvent&); | 
| bool HandleTouchEvent(const WebTouchEvent&); | 
| bool HandleMouseMove(const WebMouseEvent&); | 
| + | 
| +  protocol::Response CompositingEnabled(); | 
| + | 
| bool ShouldSearchForNode(); | 
| -  void Inspect(Node*); | 
| +  void NodeHighlightRequested(Node*); | 
| +  protocol::Response SetSearchingForNode( | 
| +      SearchMode, | 
| +      protocol::Maybe<protocol::Overlay::HighlightConfig>); | 
| +  protocol::Response HighlightConfigFromInspectorObject( | 
| +      protocol::Maybe<protocol::Overlay::HighlightConfig> | 
| +          highlight_inspector_object, | 
| +      std::unique_ptr<InspectorHighlightConfig>*); | 
| +  void InnerHighlightQuad(std::unique_ptr<FloatQuad>, | 
| +                          protocol::Maybe<protocol::DOM::RGBA> color, | 
| +                          protocol::Maybe<protocol::DOM::RGBA> outline_color); | 
| +  void InnerHighlightNode(Node*, | 
| +                          Node* event_target, | 
| +                          const InspectorHighlightConfig&, | 
| +                          bool omit_tooltip); | 
| +  void InnerHideHighlight(); | 
|  | 
| Member<WebLocalFrameImpl> frame_impl_; | 
| +  Member<InspectedFrames> inspected_frames_; | 
| +  bool enabled_; | 
| String paused_in_debugger_message_; | 
| Member<Node> highlight_node_; | 
| Member<Node> event_target_node_; | 
| @@ -148,11 +195,12 @@ class InspectorOverlay final | 
| Member<Page> overlay_page_; | 
| Member<InspectorOverlayChromeClient> overlay_chrome_client_; | 
| Member<InspectorOverlayHost> overlay_host_; | 
| -  InspectorHighlightConfig quad_highlight_config_; | 
| +  Color quad_content_color_; | 
| +  Color quad_content_outline_color_; | 
| bool draw_view_size_; | 
| bool resize_timer_active_; | 
| bool omit_tooltip_; | 
| -  TaskRunnerTimer<InspectorOverlay> timer_; | 
| +  TaskRunnerTimer<InspectorOverlayAgent> timer_; | 
| bool suspended_; | 
| bool show_reloading_blanket_; | 
| bool in_layout_; | 
| @@ -162,10 +210,11 @@ class InspectorOverlay final | 
| std::unique_ptr<PageOverlay> page_overlay_; | 
| Member<Node> hovered_node_for_inspect_mode_; | 
| bool swallow_next_mouse_up_; | 
| -  InspectorDOMAgent::SearchMode inspect_mode_; | 
| +  SearchMode inspect_mode_; | 
| std::unique_ptr<InspectorHighlightConfig> inspect_mode_highlight_config_; | 
| +  int backend_node_id_to_inspect_; | 
| }; | 
|  | 
| }  // namespace blink | 
|  | 
| -#endif  // InspectorOverlay_h | 
| +#endif  // InspectorOverlayAgent_h | 
|  |