OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ANDROID_WEBVIEW_BROWSER_RENDER_HOST_RENDER_VIEW_HOST_EXT_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_RENDER_HOST_RENDER_VIEW_HOST_EXT_H_ |
6 #define ANDROID_WEBVIEW_BROWSER_RENDER_HOST_RENDER_VIEW_HOST_EXT_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_RENDER_HOST_RENDER_VIEW_HOST_EXT_H_ |
7 | 7 |
8 #include "content/public/browser/web_contents_observer.h" | 8 #include "content/public/browser/web_contents_observer.h" |
9 | 9 |
10 #include "android_webview/common/aw_hit_test_data.h" | 10 #include "android_webview/common/aw_hit_test_data.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 void RequestNewHitTestDataAt(int view_x, int view_y); | 43 void RequestNewHitTestDataAt(int view_x, int view_y); |
44 | 44 |
45 // Optimization to avoid unnecessary Java object creation on hit test. | 45 // Optimization to avoid unnecessary Java object creation on hit test. |
46 bool HasNewHitTestData() const; | 46 bool HasNewHitTestData() const; |
47 void MarkHitTestDataRead(); | 47 void MarkHitTestDataRead(); |
48 | 48 |
49 // Return |last_hit_test_data_|. Note that this is unavoidably racy; | 49 // Return |last_hit_test_data_|. Note that this is unavoidably racy; |
50 // the corresponding public WebView API is as well. | 50 // the corresponding public WebView API is as well. |
51 const AwHitTestData& GetLastHitTestData() const; | 51 const AwHitTestData& GetLastHitTestData() const; |
52 | 52 |
| 53 // Enables updating picture piles on every new frame. |
| 54 // OnPictureUpdated is called when a new picture is available, |
| 55 // stored by renderer id in RendererPictureMap. |
| 56 void EnableCapturePictureCallback(bool enabled); |
| 57 |
| 58 // Captures the latest available picture pile synchronously. |
| 59 void CapturePictureSync(); |
| 60 |
53 private: | 61 private: |
54 // content::WebContentsObserver implementation. | 62 // content::WebContentsObserver implementation. |
55 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; | 63 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; |
56 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 64 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
57 | 65 |
58 void OnDocumentHasImagesResponse(int msg_id, bool has_images); | 66 void OnDocumentHasImagesResponse(int msg_id, bool has_images); |
59 void OnUpdateHitTestData(const AwHitTestData& hit_test_data); | 67 void OnUpdateHitTestData(const AwHitTestData& hit_test_data); |
60 void OnPictureUpdated(); | 68 void OnPictureUpdated(); |
61 | 69 |
62 std::map<int, DocumentHasImagesResult> pending_document_has_images_requests_; | 70 std::map<int, DocumentHasImagesResult> pending_document_has_images_requests_; |
63 | 71 |
64 // Master copy of hit test data on the browser side. This is updated | 72 // Master copy of hit test data on the browser side. This is updated |
65 // as a result of DoHitTest called explicitly or when the FocusedNodeChanged | 73 // as a result of DoHitTest called explicitly or when the FocusedNodeChanged |
66 // is called in AwRenderViewExt. | 74 // is called in AwRenderViewExt. |
67 AwHitTestData last_hit_test_data_; | 75 AwHitTestData last_hit_test_data_; |
68 | 76 |
69 bool has_new_hit_test_data_; | 77 bool has_new_hit_test_data_; |
70 | 78 |
71 Client* client_; | 79 Client* client_; |
72 | 80 |
73 DISALLOW_COPY_AND_ASSIGN(AwRenderViewHostExt); | 81 DISALLOW_COPY_AND_ASSIGN(AwRenderViewHostExt); |
74 }; | 82 }; |
75 | 83 |
76 } // namespace android_webview | 84 } // namespace android_webview |
77 | 85 |
78 #endif // ANDROID_WEBVIEW_BROWSER_RENDER_HOST_RENDER_VIEW_HOST_EXT_H_ | 86 #endif // ANDROID_WEBVIEW_BROWSER_RENDER_HOST_RENDER_VIEW_HOST_EXT_H_ |
OLD | NEW |