OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 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_VIEW_RENDERER_HOST_H_ |
| 6 #define ANDROID_WEBVIEW_BROWSER_RENDER_HOST_VIEW_RENDERER_HOST_H_ |
| 7 |
| 8 #include "base/threading/non_thread_safe.h" |
| 9 #include "content/public/browser/web_contents_observer.h" |
| 10 |
| 11 namespace android_webview { |
| 12 |
| 13 // Provides RenderViewHost wrapper functionality for sending WebView-specific |
| 14 // IPC messages to the renderer and from there to WebKit. |
| 15 class ViewRendererHost : public content::WebContentsObserver, |
| 16 public base::NonThreadSafe { |
| 17 public: |
| 18 class Client { |
| 19 public: |
| 20 virtual void OnPictureUpdated(int process_id, int render_view_id) = 0; |
| 21 |
| 22 protected: |
| 23 virtual ~Client() {} |
| 24 }; |
| 25 |
| 26 ViewRendererHost(content::WebContents* contents, Client* client); |
| 27 virtual ~ViewRendererHost(); |
| 28 |
| 29 // Captures the latest available picture pile synchronously. |
| 30 void CapturePictureSync(); |
| 31 |
| 32 // Enables updating picture piles on every new frame. |
| 33 // OnPictureUpdated is called when a new picture is available, |
| 34 // stored by renderer id in RendererPictureMap. |
| 35 void EnableCapturePictureCallback(bool enabled); |
| 36 |
| 37 using content::WebContentsObserver::Observe; |
| 38 |
| 39 private: |
| 40 // content::WebContentsObserver implementation. |
| 41 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; |
| 42 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 43 |
| 44 void OnPictureUpdated(); |
| 45 bool IsRenderViewReady() const; |
| 46 |
| 47 Client* client_; |
| 48 }; |
| 49 |
| 50 } // namespace android_webview |
| 51 |
| 52 #endif // ANDROID_WEBVIEW_BROWSER_RENDER_HOST_VIEW_RENDERER_HOST_H_ |
OLD | NEW |