| OLD | NEW |
| (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_ |
| OLD | NEW |