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

Unified Diff: android_webview/browser/renderer_host/aw_render_view_host_ext.cc

Issue 11860014: Android WebView visited link highlighting implementation part 1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More deletes. 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/renderer_host/aw_render_view_host_ext.h ('k') | android_webview/renderer/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/browser/renderer_host/aw_render_view_host_ext.cc
diff --git a/android_webview/browser/renderer_host/aw_render_view_host_ext.cc b/android_webview/browser/renderer_host/aw_render_view_host_ext.cc
index 73bcad0c5482ac625d9af265876a9950c29aa6cd..a9a9694d9f10321deaa46b31b52c59854131f15d 100644
--- a/android_webview/browser/renderer_host/aw_render_view_host_ext.cc
+++ b/android_webview/browser/renderer_host/aw_render_view_host_ext.cc
@@ -11,6 +11,7 @@
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/user_metrics.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/common/frame_navigate_params.h"
namespace android_webview {
@@ -18,10 +19,19 @@ AwRenderViewHostExt::AwRenderViewHostExt(content::WebContents* contents,
Client* client)
: content::WebContentsObserver(contents),
has_new_hit_test_data_(false),
+ visitedlink_master_(contents->GetBrowserContext(), this),
client_(client) {
+ visitedlink_master_.Init();
+
+ // TODO(boliu): Add option to master so it never writes or rebuilds from
+ // disk then remove this and the one in the destructor. The app handles
+ // persistencing these urls.
mkosiba (inactive) 2013/01/14 11:56:20 nit: persisting
+ visitedlink_master_.DeleteAllURLs();
}
-AwRenderViewHostExt::~AwRenderViewHostExt() {}
+AwRenderViewHostExt::~AwRenderViewHostExt() {
+ visitedlink_master_.DeleteAllURLs();
+}
void AwRenderViewHostExt::DocumentHasImages(DocumentHasImagesResult result) {
DCHECK(CalledOnValidThread());
@@ -71,6 +81,14 @@ void AwRenderViewHostExt::RenderViewGone(base::TerminationStatus status) {
}
}
+void AwRenderViewHostExt::DidNavigateAnyFrame(
+ const content::LoadCommittedDetails& details,
+ const content::FrameNavigateParams& params) {
+ DCHECK(CalledOnValidThread());
+
+ visitedlink_master_.AddURL(params.base_url);
+}
+
bool AwRenderViewHostExt::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(AwRenderViewHostExt, message)
@@ -86,6 +104,26 @@ bool AwRenderViewHostExt::OnMessageReceived(const IPC::Message& message) {
return handled ? true : WebContentsObserver::OnMessageReceived(message);
}
+bool AwRenderViewHostExt::AreEquivalentContexts(
+ content::BrowserContext* context1,
+ content::BrowserContext* context2) {
+ DCHECK(CalledOnValidThread());
+
+ // Raw pointer comparison since Android WebView does not have sub-contexts
+ // like incognito.
+ return context1 == context2;
+}
+
+void AwRenderViewHostExt::RebuildTable(
+ const scoped_refptr<URLEnumerator>& enumerator) {
+ DCHECK(CalledOnValidThread());
+
+ // Android WebView rebuilds from WebChromeClient which can change in the
+ // lifetime of this WebView and may not yet be set here. This initialization
+ // path is not used.
+ enumerator->OnComplete(true);
+}
+
void AwRenderViewHostExt::OnDocumentHasImagesResponse(int msg_id,
bool has_images) {
DCHECK(CalledOnValidThread());
« no previous file with comments | « android_webview/browser/renderer_host/aw_render_view_host_ext.h ('k') | android_webview/renderer/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698