Upstreaming browser/ui/uikit_ui_util from iOS.
[chromium-blink-merge.git] / content / renderer / devtools / devtools_client.h
blob764714c1fe2aa37b6ce160de747a5ea0c28148ae
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_CLIENT_H_
6 #define CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_CLIENT_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "content/public/renderer/render_frame_observer.h"
13 #include "third_party/WebKit/public/web/WebDevToolsFrontendClient.h"
15 namespace blink {
16 class WebDevToolsFrontend;
17 class WebString;
20 namespace content {
22 // Developer tools UI end of communication channel between the render process of
23 // the page being inspected and tools UI renderer process. All messages will
24 // go through browser process. On the side of the inspected page there's
25 // corresponding DevToolsAgent object.
26 // TODO(yurys): now the client is almost empty later it will delegate calls to
27 // code in glue
28 class CONTENT_EXPORT DevToolsClient
29 : public RenderFrameObserver,
30 NON_EXPORTED_BASE(public blink::WebDevToolsFrontendClient) {
31 public:
32 DevToolsClient(RenderFrame* main_render_frame,
33 const std::string& compatibility_script);
34 virtual ~DevToolsClient();
36 private:
37 // RenderFrameObserver overrides.
38 void DidClearWindowObject() override;
40 // WebDevToolsFrontendClient implementation.
41 virtual void sendMessageToBackend(const blink::WebString&) override;
42 virtual void sendMessageToEmbedder(const blink::WebString&) override;
44 virtual bool isUnderTest() override;
46 void OnDispatchOnInspectorFrontend(const std::string& message,
47 uint32 total_size);
49 scoped_ptr<blink::WebDevToolsFrontend> web_tools_frontend_;
50 std::string compatibility_script_;
52 DISALLOW_COPY_AND_ASSIGN(DevToolsClient);
55 } // namespace content
57 #endif // CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_CLIENT_H_