| 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
|
| +//
|
| +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_
|
|
|