[M49_2623] Chromium upversion to m49_2623 branch.
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / efl_integration / devtools_delegate_efl.h
1 // Copyright 2014 Samsung Electronics. 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
5 #ifndef DEVTOOLS_DELEGATE_EFL_H_
6 #define DEVTOOLS_DELEGATE_EFL_H_
7
8
9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "components/devtools_http_handler/devtools_http_handler_delegate.h"
12
13 namespace content {
14 class BrowserContext;
15 }
16
17 namespace devtools_http_handler {
18
19 class DevToolsHttpHandler;
20
21 // This class is to create RemoteInspector Server(Remote Debugger) and return devtools front resources.
22 // This class implements DevToolsHttpHandlerDelegate interface.
23 // This class is similar to ShellDevToolsDelegate, which also implements DevToolsHttpHandlerDelegate interface.
24 class DevToolsDelegateEfl : public DevToolsHttpHandlerDelegate {
25  public:
26   // explicit ChromiumEflDevToolsDelegate();
27   explicit DevToolsDelegateEfl(int = 0);
28   virtual ~DevToolsDelegateEfl();
29
30   // Stops http server.
31   void Stop();
32
33   // ChromiumDevToolsHttpHandler::Delegate overrides.
34   virtual std::string GetDiscoveryPageHTML() override;
35   virtual std::string GetFrontendResource(const std::string& path) override;
36   virtual std::string GetPageThumbnailData(const GURL& url) override;
37
38   // Allows embedder to handle custom websocket-based protocol connection
39   // pointing remote debugging port. Returns ownership.
40   virtual content::DevToolsExternalAgentProxyDelegate*
41       HandleWebSocketConnection(const std::string& path) override;
42
43
44   DevToolsHttpHandler* devtools_http_handler() {
45     return devtools_http_handler_.get();
46   }
47   int port() const {
48     return port_;
49   }
50
51  private:
52   int port_;
53   content::BrowserContext* browser_context_;
54   scoped_ptr<DevToolsHttpHandler> devtools_http_handler_;
55 };
56
57 } // namespace content
58
59 #endif  // DEVTOOLS_DELEGATE_EFL_H_