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

Side by Side 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: rebased Created 8 years, 3 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef ANDROID_WEBVIEW_BROWSER_RENDER_HOST_RENDER_VIEW_HOST_EXT_H_
6 #define ANDROID_WEBVIEW_BROWSER_RENDER_HOST_RENDER_VIEW_HOST_EXT_H_
7
8 #include "content/public/browser/web_contents_observer.h"
9
10 #include "base/threading/non_thread_safe.h"
11
12 namespace android_webview {
13
14 // Provides RenderViewHost wrapper functionality for sending WebView-specific
15 // IPC messages to the renderer and from there to WebKit.
16 class AwRenderViewHostExt : public content::WebContentsObserver,
17 public base::NonThreadSafe {
18 public:
19 // To send receive messages to a RenderView we take the WebContents instance,
20 // as it internally handles RenderViewHost instances changing underneath us.
21 AwRenderViewHostExt(content::WebContents* contents);
22 virtual ~AwRenderViewHostExt();
23
24 // |result| will be invoked with the outcome of the request.
25 typedef base::Callback<void(bool)> DocumentHasImagesResult;
26 void DocumentHasImages(DocumentHasImagesResult result);
27
28 private:
29 // content::WebContentsObserver implementation.
30 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE;
31 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
32
33 void OnDocumentHasImagesResponse(int msg_id, bool has_images);
34
35 std::map<int, DocumentHasImagesResult> pending_document_has_images_requests_;
36
37 DISALLOW_COPY_AND_ASSIGN(AwRenderViewHostExt);
38 };
39
40 } // namespace android_webview
41
42 #endif // ANDROID_WEBVIEW_BROWSER_RENDER_HOST_RENDER_VIEW_HOST_EXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698