Upstream version 6.34.113.0
[platform/framework/web/crosswalk.git] / src / xwalk / runtime / browser / runtime_context.h
index a1120e4..37ededa 100644 (file)
@@ -9,10 +9,13 @@
 #include <string>
 #endif
 
+#include <vector>
+
 #include "base/compiler_specific.h"
 #include "base/files/file_path.h"
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"
+#include "components/visitedlink/browser/visitedlink_delegate.h"
 #include "content/public/browser/browser_context.h"
 #include "content/public/browser/content_browser_client.h"
 #include "content/public/browser/geolocation_permission_context.h"
@@ -25,12 +28,21 @@ namespace content {
 class DownloadManagerDelegate;
 }
 
+namespace visitedlink {
+class VisitedLinkMaster;
+}
+
 namespace xwalk {
 
 class RuntimeDownloadManagerDelegate;
 class RuntimeURLRequestContextGetter;
 
-class RuntimeContext : public content::BrowserContext {
+class RuntimeContext
+    : public content::BrowserContext
+#if defined(OS_ANDROID)
+      , public visitedlink::VisitedLinkDelegate
+#endif
+{
  public:
   RuntimeContext();
   virtual ~RuntimeContext();
@@ -88,6 +100,11 @@ class RuntimeContext : public content::BrowserContext {
 #if defined(OS_ANDROID)
   void SetCSPString(const std::string& csp);
   std::string GetCSPString() const;
+  // These methods map to Add methods in visitedlink::VisitedLinkMaster.
+  void AddVisitedURLs(const std::vector<GURL>& urls);
+  // visitedlink::VisitedLinkDelegate implementation.
+  virtual void RebuildTable(
+      const scoped_refptr<URLEnumerator>& enumerator) OVERRIDE;
 #endif
 
  private:
@@ -97,6 +114,11 @@ class RuntimeContext : public content::BrowserContext {
   // allowed on the current thread.
   void InitWhileIOAllowed();
 
+#if defined(OS_ANDROID)
+  // Reset visitedlink master and initialize it.
+  void InitVisitedLinkMaster();
+#endif
+
   scoped_ptr<RuntimeResourceContext> resource_context_;
   scoped_refptr<RuntimeDownloadManagerDelegate> download_manager_delegate_;
   scoped_refptr<RuntimeURLRequestContextGetter> url_request_getter_;
@@ -104,7 +126,9 @@ class RuntimeContext : public content::BrowserContext {
        geolocation_permission_context_;
 #if defined(OS_ANDROID)
   std::string csp_;
+  scoped_ptr<visitedlink::VisitedLinkMaster> visitedlink_master_;
 #endif
+
   DISALLOW_COPY_AND_ASSIGN(RuntimeContext);
 };