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

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

Issue 10890024: Implement DocuementHasImages (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix test Created 8 years, 4 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: android_webview/browser/renderer_host/aw_render_view_host_ext.h
diff --git a/android_webview/browser/renderer_host/aw_render_view_host_ext.h b/android_webview/browser/renderer_host/aw_render_view_host_ext.h
new file mode 100644
index 0000000000000000000000000000000000000000..351293f23e270ed69a523d77dc150b750c60e7b5
--- /dev/null
+++ b/android_webview/browser/renderer_host/aw_render_view_host_ext.h
@@ -0,0 +1,39 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ANDROID_WEBVIEW_LIB_RENDERER_HOST_AW_RESOURCE_DISPATCHER_HOST_DELEGATE_H_
+#define ANDROID_WEBVIEW_LIB_RENDERER_HOST_AW_RESOURCE_DISPATCHER_HOST_DELEGATE_H_
+
+#include "content/public/browser/web_contents_observer.h"
+
+namespace android_webview {
+
+// Provides a convenience methods around a RenderViewHost for sending android
benm (inactive) 2012/08/30 13:30:46 nix first 'a'? for sending android ...?
joth 2012/08/30 17:26:53 Done. // Provides RenderViewHost wrapper function
+//
+class AwRenderViewHostExt : public content::WebContentsObserver {
+ public:
+ // To send receive messages to a RenderView we take the WebContents instance,
+ // as it internally handles RenderViewHost instances changing underneath us.
+ AwRenderViewHostExt(content::WebContents* contents);
+ virtual ~AwRenderViewHostExt();
+
+ // |result| will be invoked with the outcome of the request.
+ typedef base::Callback<void(bool)> DocumentHasImagesResult;
+ void DocumentHasImages(DocumentHasImagesResult result);
+
+ private:
+ // content::WebContentsObserver implementation.
+ virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE;
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+
+ void OnDocumentHasImagesResponse(int msg_id, bool has_images);
+
+ std::map<int, DocumentHasImagesResult> pending_document_has_images_requests_;
+
+ DISALLOW_COPY_AND_ASSIGN(AwRenderViewHostExt);
+};
+
+} // namespace android_webview
+
+#endif // ANDROID_WEBVIEW_LIB_RENDERER_HOST_AW_RESOURCE_DISPATCHER_HOST_H_

Powered by Google App Engine
This is Rietveld 408576698