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

Side by Side 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: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" 5 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h"
6 6
7 #include "android_webview/browser/aw_browser_context.h"
7 #include "android_webview/common/render_view_messages.h" 8 #include "android_webview/common/render_view_messages.h"
8 #include "base/android/scoped_java_ref.h" 9 #include "base/android/scoped_java_ref.h"
9 #include "base/callback.h" 10 #include "base/callback.h"
10 #include "base/logging.h" 11 #include "base/logging.h"
11 #include "content/public/browser/render_process_host.h" 12 #include "content/public/browser/render_process_host.h"
12 #include "content/public/browser/user_metrics.h" 13 #include "content/public/browser/user_metrics.h"
13 #include "content/public/browser/web_contents.h" 14 #include "content/public/browser/web_contents.h"
15 #include "content/public/common/frame_navigate_params.h"
14 16
15 namespace android_webview { 17 namespace android_webview {
16 18
17 AwRenderViewHostExt::AwRenderViewHostExt(content::WebContents* contents, 19 AwRenderViewHostExt::AwRenderViewHostExt(content::WebContents* contents,
18 Client* client) 20 Client* client)
19 : content::WebContentsObserver(contents), 21 : content::WebContentsObserver(contents),
20 has_new_hit_test_data_(false), 22 has_new_hit_test_data_(false),
21 client_(client) { 23 client_(client) {
22 } 24 }
23 25
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 void AwRenderViewHostExt::RenderViewGone(base::TerminationStatus status) { 66 void AwRenderViewHostExt::RenderViewGone(base::TerminationStatus status) {
65 DCHECK(CalledOnValidThread()); 67 DCHECK(CalledOnValidThread());
66 for (std::map<int, DocumentHasImagesResult>::iterator pending_req = 68 for (std::map<int, DocumentHasImagesResult>::iterator pending_req =
67 pending_document_has_images_requests_.begin(); 69 pending_document_has_images_requests_.begin();
68 pending_req != pending_document_has_images_requests_.end(); 70 pending_req != pending_document_has_images_requests_.end();
69 ++pending_req) { 71 ++pending_req) {
70 pending_req->second.Run(false); 72 pending_req->second.Run(false);
71 } 73 }
72 } 74 }
73 75
76 void AwRenderViewHostExt::DidNavigateAnyFrame(
77 const content::LoadCommittedDetails& details,
78 const content::FrameNavigateParams& params) {
79 DCHECK(CalledOnValidThread());
80
81 AwBrowserContext::FromBrowserContext(
82 web_contents()->GetBrowserContext())->AddVisitedURL(params.base_url);
benm (inactive) 2013/01/16 01:00:22 interesting, so we will alter the visited history
joth 2013/01/16 01:10:02 this is a slightly awkward dereferencing chain. It
boliu 2013/01/16 01:10:08 This is mostly copied from chrome implementation.
boliu 2013/01/16 01:35:34 I think this is fine On 2013/01/16 01:10:02, joth
boliu 2013/01/16 01:39:20 Oh, what we could have is AwBrowserContext::FromWe
boliu 2013/01/16 01:58:44 Use AwBrowserContext::FromWebContents. Lots of tim
83 }
84
74 bool AwRenderViewHostExt::OnMessageReceived(const IPC::Message& message) { 85 bool AwRenderViewHostExt::OnMessageReceived(const IPC::Message& message) {
75 bool handled = true; 86 bool handled = true;
76 IPC_BEGIN_MESSAGE_MAP(AwRenderViewHostExt, message) 87 IPC_BEGIN_MESSAGE_MAP(AwRenderViewHostExt, message)
77 IPC_MESSAGE_HANDLER(AwViewHostMsg_DocumentHasImagesResponse, 88 IPC_MESSAGE_HANDLER(AwViewHostMsg_DocumentHasImagesResponse,
78 OnDocumentHasImagesResponse) 89 OnDocumentHasImagesResponse)
79 IPC_MESSAGE_HANDLER(AwViewHostMsg_UpdateHitTestData, 90 IPC_MESSAGE_HANDLER(AwViewHostMsg_UpdateHitTestData,
80 OnUpdateHitTestData) 91 OnUpdateHitTestData)
81 IPC_MESSAGE_HANDLER(AwViewHostMsg_PictureUpdated, 92 IPC_MESSAGE_HANDLER(AwViewHostMsg_PictureUpdated,
82 OnPictureUpdated) 93 OnPictureUpdated)
83 IPC_MESSAGE_UNHANDLED(handled = false) 94 IPC_MESSAGE_UNHANDLED(handled = false)
(...skipping 22 matching lines...) Expand all
106 has_new_hit_test_data_ = true; 117 has_new_hit_test_data_ = true;
107 } 118 }
108 119
109 void AwRenderViewHostExt::OnPictureUpdated() { 120 void AwRenderViewHostExt::OnPictureUpdated() {
110 if (client_) 121 if (client_)
111 client_->OnPictureUpdated(web_contents()->GetRenderProcessHost()->GetID(), 122 client_->OnPictureUpdated(web_contents()->GetRenderProcessHost()->GetID(),
112 routing_id()); 123 routing_id());
113 } 124 }
114 125
115 } // namespace android_webview 126 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698