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

Unified Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 10553014: Added RenderView.DocumentHasImages query method (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 6 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: content/browser/renderer_host/render_view_host_impl.cc
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index 9ea4705701cb7ec91d645f43dd3291fe8b191b07..a43d14cc5216b400f2a85be8b3d9cca4744552fa 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -611,6 +611,12 @@ void RenderViewHostImpl::DesktopNotificationPostClick(int notification_id) {
Send(new DesktopNotificationMsg_PostClick(GetRoutingID(), notification_id));
}
+int RenderViewHostImpl::DocumentHasImages() {
+ static int next_id = 1;
+ Send(new ViewMsg_DocumentHasImages(GetRoutingID(), next_id));
+ return next_id++;
+}
+
void RenderViewHostImpl::ExecuteJavascriptInWebFrame(
const string16& frame_xpath,
const string16& jscript) {
@@ -925,6 +931,8 @@ bool RenderViewHostImpl::OnMessageReceived(const IPC::Message& msg) {
OnDomOperationResponse)
IPC_MESSAGE_HANDLER(AccessibilityHostMsg_Notifications,
OnAccessibilityNotifications)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_DocumentHasImagesResponse,
+ OnDocumentHasImagesResponse)
// Have the super handle all other messages.
IPC_MESSAGE_UNHANDLED(
handled = RenderWidgetHostImpl::OnMessageReceived(msg))
@@ -1852,4 +1860,12 @@ void RenderViewHostImpl::ClearPowerSaveBlockers() {
STLDeleteValues(&power_save_blockers_);
}
+void RenderViewHostImpl::OnDocumentHasImagesResponse(int id, bool has_images) {
+ std::pair<int, bool> details(id, has_images);
+ content::NotificationService::current()->Notify(
+ content::NOTIFICATION_DOCUMENT_HAS_IMAGES_RESPONSE,
+ content::Source<RenderViewHost>(this),
+ content::Details<std::pair<int, bool> >(&details));
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698