Chromium Code Reviews| 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_LIB_RENDERER_HOST_AW_RESOURCE_DISPATCHER_HOST_DELEGATE_H _ | |
| 6 #define ANDROID_WEBVIEW_LIB_RENDERER_HOST_AW_RESOURCE_DISPATCHER_HOST_DELEGATE_H _ | |
| 7 | |
| 8 #include "content/public/browser/web_contents_observer.h" | |
| 9 | |
| 10 namespace android_webview { | |
| 11 | |
| 12 // 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
| |
| 13 // | |
| 14 class AwRenderViewHostExt : public content::WebContentsObserver { | |
| 15 public: | |
| 16 // To send receive messages to a RenderView we take the WebContents instance, | |
| 17 // as it internally handles RenderViewHost instances changing underneath us. | |
| 18 AwRenderViewHostExt(content::WebContents* contents); | |
| 19 virtual ~AwRenderViewHostExt(); | |
| 20 | |
| 21 // |result| will be invoked with the outcome of the request. | |
| 22 typedef base::Callback<void(bool)> DocumentHasImagesResult; | |
| 23 void DocumentHasImages(DocumentHasImagesResult result); | |
| 24 | |
| 25 private: | |
| 26 // content::WebContentsObserver implementation. | |
| 27 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; | |
| 28 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | |
| 29 | |
| 30 void OnDocumentHasImagesResponse(int msg_id, bool has_images); | |
| 31 | |
| 32 std::map<int, DocumentHasImagesResult> pending_document_has_images_requests_; | |
| 33 | |
| 34 DISALLOW_COPY_AND_ASSIGN(AwRenderViewHostExt); | |
| 35 }; | |
| 36 | |
| 37 } // namespace android_webview | |
| 38 | |
| 39 #endif // ANDROID_WEBVIEW_LIB_RENDERER_HOST_AW_RESOURCE_DISPATCHER_HOST_H_ | |
| OLD | NEW |