OLD | NEW |
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 Loading... |
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::FromWebContents(web_contents()) |
| 82 ->AddVisitedURL(params.base_url); |
| 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 Loading... |
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 |
OLD | NEW |