Index: android_webview/browser/aw_browser_context.h |
diff --git a/android_webview/browser/aw_browser_context.h b/android_webview/browser/aw_browser_context.h |
index 0e4708bae163bc87d502f7f73105a321e85868a3..ae2b39589e536676ca1b6401e65cc9ee77c87510 100644 |
--- a/android_webview/browser/aw_browser_context.h |
+++ b/android_webview/browser/aw_browser_context.h |
@@ -5,28 +5,55 @@ |
#ifndef ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_ |
#define ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_ |
+#include <vector> |
+ |
#include "android_webview/browser/aw_download_manager_delegate.h" |
#include "base/file_path.h" |
#include "base/memory/ref_counted.h" |
+#include "components/visitedlink/browser/visitedlink_delegate.h" |
#include "content/public/browser/browser_context.h" |
#include "content/public/browser/geolocation_permission_context.h" |
+class GURL; |
+ |
+namespace components { |
+class VisitedLinkMaster; |
+} // namespace components |
+ |
+namespace content { |
+class WebContents; |
+} // namespace content |
+ |
namespace android_webview { |
class AwURLRequestContextGetter; |
typedef content::GeolocationPermissionContext* GeolocationPermissionFactoryFn(); |
-class AwBrowserContext : public content::BrowserContext { |
+class AwBrowserContext : public content::BrowserContext, |
+ public components::VisitedLinkDelegate { |
public: |
+ |
AwBrowserContext( |
const FilePath path, |
GeolocationPermissionFactoryFn* geolocation_permission_factory); |
virtual ~AwBrowserContext(); |
+ // Convenience method to returns the AwBrowserContext corresponding to the |
+ // given WebContents. |
+ static AwBrowserContext* FromWebContents( |
+ content::WebContents* web_contents); |
+ |
// Called before BrowserThreads are created. |
void InitializeBeforeThreadCreation(); |
+ // Maps to BrowserMainParts::PreMainMessageLoopRun. |
+ void PreMainMessageLoopRun(); |
+ |
+ // These methods map to Add methods in components::VisitedLinkMaster. |
+ void AddVisitedURL(const GURL& url); |
+ void AddVisitedURLs(const std::vector<GURL>& urls); |
+ |
// content::BrowserContext implementation. |
virtual FilePath GetPath() OVERRIDE; |
virtual bool IsOffTheRecord() const OVERRIDE; |
@@ -50,6 +77,10 @@ class AwBrowserContext : public content::BrowserContext { |
GetSpeechRecognitionPreferences() OVERRIDE; |
virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; |
+ // components::VisitedLinkDelegate implementation. |
+ virtual void RebuildTable( |
+ const scoped_refptr<URLEnumerator>& enumerator) OVERRIDE; |
+ |
private: |
// The file path where data for this context is persisted. |
@@ -62,6 +93,8 @@ class AwBrowserContext : public content::BrowserContext { |
AwDownloadManagerDelegate download_manager_delegate_; |
+ scoped_ptr<components::VisitedLinkMaster> visitedlink_master_; |
+ |
DISALLOW_COPY_AND_ASSIGN(AwBrowserContext); |
}; |