Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1038)

Unified Diff: android_webview/browser/aw_browser_context.h

Issue 11860014: Android WebView visited link highlighting implementation part 1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move VisitedLinkMaster to AwBrowserContext Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..40e42b5ef909faa5b646d5d3a5c1b7f4d0fdb609 100644
--- a/android_webview/browser/aw_browser_context.h
+++ b/android_webview/browser/aw_browser_context.h
@@ -5,28 +5,46 @@
#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 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();
+ // Returns the AwBrowserContext corresponding to the given browser context.
+ static AwBrowserContext* FromBrowserContext(
+ content::BrowserContext* browser_context);
+
// Called before BrowserThreads are created.
void InitializeBeforeThreadCreation();
+ // Maps to BrowserMainParts::PreMainMessageLoopRun.
+ void PreMainMessageLoopRun();
+
// content::BrowserContext implementation.
virtual FilePath GetPath() OVERRIDE;
virtual bool IsOffTheRecord() const OVERRIDE;
@@ -50,6 +68,18 @@ class AwBrowserContext : public content::BrowserContext {
GetSpeechRecognitionPreferences() OVERRIDE;
virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE;
+ // These methods map to Add methods in components::VisitedLinkMaster.
+ void AddVisitedURL(const GURL& url);
+ void AddVisitedURLs(const std::vector<GURL>& urls);
joth 2013/01/16 01:10:02 nit: put this up before all the virtual overrides.
boliu 2013/01/16 01:58:44 Done, and cc file too
+
+ // components::VisitedLinkDelegate implementation.
+ virtual bool PersistToDisk() const OVERRIDE;
+ virtual bool AreEquivalentContexts(
+ content::BrowserContext* context1,
+ content::BrowserContext* context2) OVERRIDE;
+ virtual void RebuildTable(
+ const scoped_refptr<URLEnumerator>& enumerator) OVERRIDE;
+
private:
// The file path where data for this context is persisted.
@@ -62,6 +92,8 @@ class AwBrowserContext : public content::BrowserContext {
AwDownloadManagerDelegate download_manager_delegate_;
+ scoped_ptr<components::VisitedLinkMaster> visitedlink_master_;
+
DISALLOW_COPY_AND_ASSIGN(AwBrowserContext);
};

Powered by Google App Engine
This is Rietveld 408576698