Upstream version 11.39.256.0
[platform/framework/web/crosswalk.git] / src / xwalk / runtime / browser / devtools / xwalk_devtools_delegate.h
index 2a35fd6..614348b 100644 (file)
@@ -16,6 +16,7 @@
 #include "content/public/browser/devtools_http_handler_delegate.h"
 #include "content/public/browser/devtools_manager_delegate.h"
 #include "url/gurl.h"
+#include "xwalk/runtime/browser/runtime.h"
 
 namespace content {
 class DevToolsHttpHandler;
@@ -23,7 +24,7 @@ class DevToolsHttpHandler;
 
 namespace xwalk {
 
-class RuntimeContext;
+class XWalkBrowserContext;
 
 class XWalkDevToolsHttpHandlerDelegate :
     public content::DevToolsHttpHandlerDelegate {
@@ -43,9 +44,10 @@ class XWalkDevToolsHttpHandlerDelegate :
   DISALLOW_COPY_AND_ASSIGN(XWalkDevToolsHttpHandlerDelegate);
 };
 
-class XWalkDevToolsDelegate : public content::DevToolsManagerDelegate {
+class XWalkDevToolsDelegate : public content::DevToolsManagerDelegate,
+                              public Runtime::Observer {
  public:
-  explicit XWalkDevToolsDelegate(RuntimeContext* runtime_context);
+  explicit XWalkDevToolsDelegate(XWalkBrowserContext* browser_context);
   virtual ~XWalkDevToolsDelegate();
 
   virtual void Inspect(
@@ -65,9 +67,13 @@ class XWalkDevToolsDelegate : public content::DevToolsManagerDelegate {
                                scoped_refptr<base::RefCountedBytes> png);
 
  private:
+  // Runtime::Observer
+  virtual void OnNewRuntimeAdded(Runtime* runtime) override;
+  virtual void OnRuntimeClosed(Runtime* runtime) override;
+
   using ThumbnailMap = std::map<GURL, std::string>;
   ThumbnailMap thumbnail_map_;
-  RuntimeContext* runtime_context_;
+  XWalkBrowserContext* browser_context_;
   base::WeakPtrFactory<XWalkDevToolsDelegate> weak_factory_;
   DISALLOW_COPY_AND_ASSIGN(XWalkDevToolsDelegate);
 };