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

Unified Diff: android_webview/browser/aw_browser_context.cc

Issue 11860014: Android WebView visited link highlighting implementation part 1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to pass no_disk parameter instead of using delegate. 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
« no previous file with comments | « android_webview/browser/aw_browser_context.h ('k') | android_webview/browser/aw_browser_main_parts.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/browser/aw_browser_context.cc
diff --git a/android_webview/browser/aw_browser_context.cc b/android_webview/browser/aw_browser_context.cc
index 8a9230c49ee1ee3c69e739d497075ba28d986d41..010d692ca75f107e4b6f635bc6d3c3b5ef45ee19 100644
--- a/android_webview/browser/aw_browser_context.cc
+++ b/android_webview/browser/aw_browser_context.cc
@@ -5,6 +5,8 @@
#include "android_webview/browser/aw_browser_context.h"
#include "android_webview/browser/net/aw_url_request_context_getter.h"
+#include "components/visitedlink/browser/visitedlink_master.h"
+#include "content/public/browser/web_contents.h"
namespace android_webview {
@@ -18,11 +20,34 @@ AwBrowserContext::AwBrowserContext(
AwBrowserContext::~AwBrowserContext() {
}
+// static
+AwBrowserContext* AwBrowserContext::FromWebContents(
+ content::WebContents* web_contents) {
+ // This is safe; this is the only implementation of the browser context.
+ return static_cast<AwBrowserContext*>(web_contents->GetBrowserContext());
+}
+
void AwBrowserContext::InitializeBeforeThreadCreation() {
DCHECK(!url_request_context_getter_);
url_request_context_getter_ = new AwURLRequestContextGetter(this);
}
+void AwBrowserContext::PreMainMessageLoopRun() {
+ visitedlink_master_.reset(
+ new components::VisitedLinkMaster(this, this, false));
+ visitedlink_master_->Init();
+}
+
+void AwBrowserContext::AddVisitedURL(const GURL& url) {
+ DCHECK(visitedlink_master_);
+ visitedlink_master_->AddURL(url);
+}
+
+void AwBrowserContext::AddVisitedURLs(const std::vector<GURL>& urls) {
+ DCHECK(visitedlink_master_);
+ visitedlink_master_->AddURLs(urls);
+}
+
FilePath AwBrowserContext::GetPath() {
return context_storage_path_;
}
@@ -96,4 +121,12 @@ quota::SpecialStoragePolicy* AwBrowserContext::GetSpecialStoragePolicy() {
return NULL;
}
+void AwBrowserContext::RebuildTable(
+ const scoped_refptr<URLEnumerator>& enumerator) {
+ // Android WebView rebuilds from WebChromeClient.getVisitedHistory. The client
+ // can change in the lifetime of this WebView and may not yet be set here.
+ // Therefore this initialization path is not used.
+ enumerator->OnComplete(true);
+}
+
} // namespace android_webview
« no previous file with comments | « android_webview/browser/aw_browser_context.h ('k') | android_webview/browser/aw_browser_main_parts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698