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

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: Updated comments on RenderViewHost.DocumentHasImages 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
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.h ('k') | content/common/view_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f2910cedff5063a1c9d90746329e716726840547..321f61202f7ed41f3481d0329b9d0c21293ea089 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
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.h ('k') | content/common/view_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698