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