| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_CLIENT_H_ | 5 #ifndef CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_CLIENT_H_ |
| 6 #define CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_CLIENT_H_ | 6 #define CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "content/public/renderer/render_view_observer.h" | 12 #include "content/public/renderer/render_frame_observer.h" |
| 13 #include "third_party/WebKit/public/web/WebDevToolsFrontendClient.h" | 13 #include "third_party/WebKit/public/web/WebDevToolsFrontendClient.h" |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 class WebDevToolsFrontend; | 16 class WebDevToolsFrontend; |
| 17 class WebString; | 17 class WebString; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace content { | 20 namespace content { |
| 21 | 21 |
| 22 class RenderViewImpl; | |
| 23 | |
| 24 // Developer tools UI end of communication channel between the render process of | 22 // Developer tools UI end of communication channel between the render process of |
| 25 // the page being inspected and tools UI renderer process. All messages will | 23 // the page being inspected and tools UI renderer process. All messages will |
| 26 // go through browser process. On the side of the inspected page there's | 24 // go through browser process. On the side of the inspected page there's |
| 27 // corresponding DevToolsAgent object. | 25 // corresponding DevToolsAgent object. |
| 28 // TODO(yurys): now the client is almost empty later it will delegate calls to | 26 // TODO(yurys): now the client is almost empty later it will delegate calls to |
| 29 // code in glue | 27 // code in glue |
| 30 class CONTENT_EXPORT DevToolsClient | 28 class CONTENT_EXPORT DevToolsClient |
| 31 : public RenderViewObserver, | 29 : public RenderFrameObserver, |
| 32 NON_EXPORTED_BASE(public blink::WebDevToolsFrontendClient) { | 30 NON_EXPORTED_BASE(public blink::WebDevToolsFrontendClient) { |
| 33 public: | 31 public: |
| 34 explicit DevToolsClient(RenderViewImpl* render_view); | 32 explicit DevToolsClient(RenderFrame* main_render_frame); |
| 35 virtual ~DevToolsClient(); | 33 virtual ~DevToolsClient(); |
| 36 | 34 |
| 37 private: | 35 private: |
| 38 // WebDevToolsFrontendClient implementation. | 36 // WebDevToolsFrontendClient implementation. |
| 39 virtual void sendMessageToBackend(const blink::WebString&) override; | 37 virtual void sendMessageToBackend(const blink::WebString&) override; |
| 40 virtual void sendMessageToEmbedder(const blink::WebString&) override; | 38 virtual void sendMessageToEmbedder(const blink::WebString&) override; |
| 41 | 39 |
| 42 virtual bool isUnderTest() override; | 40 virtual bool isUnderTest() override; |
| 43 | 41 |
| 44 void OnDispatchOnInspectorFrontend(const std::string& message, | 42 void OnDispatchOnInspectorFrontend(const std::string& message, |
| 45 uint32 total_size); | 43 uint32 total_size); |
| 46 | 44 |
| 47 scoped_ptr<blink::WebDevToolsFrontend> web_tools_frontend_; | 45 scoped_ptr<blink::WebDevToolsFrontend> web_tools_frontend_; |
| 48 | 46 |
| 49 DISALLOW_COPY_AND_ASSIGN(DevToolsClient); | 47 DISALLOW_COPY_AND_ASSIGN(DevToolsClient); |
| 50 }; | 48 }; |
| 51 | 49 |
| 52 } // namespace content | 50 } // namespace content |
| 53 | 51 |
| 54 #endif // CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_CLIENT_H_ | 52 #endif // CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_CLIENT_H_ |
| OLD | NEW |