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" |
11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
12 #include "base/threading/non_thread_safe.h" | 12 #include "base/threading/non_thread_safe.h" |
| 13 #include "components/visitedlink/browser/visitedlink_delegate.h" |
| 14 #include "components/visitedlink/browser/visitedlink_master.h" |
| 15 |
| 16 namespace content { |
| 17 struct FrameNavigateParams; |
| 18 struct LoadCommittedDetails; |
| 19 } // namespace content |
13 | 20 |
14 namespace android_webview { | 21 namespace android_webview { |
15 | 22 |
16 // Provides RenderViewHost wrapper functionality for sending WebView-specific | 23 // Provides RenderViewHost wrapper functionality for sending WebView-specific |
17 // IPC messages to the renderer and from there to WebKit. | 24 // IPC messages to the renderer and from there to WebKit. |
18 class AwRenderViewHostExt : public content::WebContentsObserver, | 25 class AwRenderViewHostExt : public content::WebContentsObserver, |
19 public base::NonThreadSafe { | 26 public base::NonThreadSafe, |
| 27 public components::VisitedLinkDelegate { |
20 public: | 28 public: |
21 class Client { | 29 class Client { |
22 public: | 30 public: |
23 virtual void OnPictureUpdated(int process_id, int render_view_id) = 0; | 31 virtual void OnPictureUpdated(int process_id, int render_view_id) = 0; |
24 | 32 |
25 protected: | 33 protected: |
26 virtual ~Client() {} | 34 virtual ~Client() {} |
27 }; | 35 }; |
28 | 36 |
29 // To send receive messages to a RenderView we take the WebContents instance, | 37 // To send receive messages to a RenderView we take the WebContents instance, |
(...skipping 16 matching lines...) Expand all Loading... |
46 bool HasNewHitTestData() const; | 54 bool HasNewHitTestData() const; |
47 void MarkHitTestDataRead(); | 55 void MarkHitTestDataRead(); |
48 | 56 |
49 // Return |last_hit_test_data_|. Note that this is unavoidably racy; | 57 // Return |last_hit_test_data_|. Note that this is unavoidably racy; |
50 // the corresponding public WebView API is as well. | 58 // the corresponding public WebView API is as well. |
51 const AwHitTestData& GetLastHitTestData() const; | 59 const AwHitTestData& GetLastHitTestData() const; |
52 | 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; |
| 64 virtual void DidNavigateAnyFrame( |
| 65 const content::LoadCommittedDetails& details, |
| 66 const content::FrameNavigateParams& params) OVERRIDE; |
56 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 67 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
57 | 68 |
| 69 // components::VisitedLinkDelegate implementation. |
| 70 virtual bool PersistToDisk() const OVERRIDE; |
| 71 virtual bool AreEquivalentContexts( |
| 72 content::BrowserContext* context1, |
| 73 content::BrowserContext* context2) OVERRIDE; |
| 74 virtual void RebuildTable( |
| 75 const scoped_refptr<URLEnumerator>& enumerator) OVERRIDE; |
| 76 |
58 void OnDocumentHasImagesResponse(int msg_id, bool has_images); | 77 void OnDocumentHasImagesResponse(int msg_id, bool has_images); |
59 void OnUpdateHitTestData(const AwHitTestData& hit_test_data); | 78 void OnUpdateHitTestData(const AwHitTestData& hit_test_data); |
60 void OnPictureUpdated(); | 79 void OnPictureUpdated(); |
61 | 80 |
62 std::map<int, DocumentHasImagesResult> pending_document_has_images_requests_; | 81 std::map<int, DocumentHasImagesResult> pending_document_has_images_requests_; |
63 | 82 |
64 // Master copy of hit test data on the browser side. This is updated | 83 // 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 | 84 // as a result of DoHitTest called explicitly or when the FocusedNodeChanged |
66 // is called in AwRenderViewExt. | 85 // is called in AwRenderViewExt. |
67 AwHitTestData last_hit_test_data_; | 86 AwHitTestData last_hit_test_data_; |
68 | 87 |
69 bool has_new_hit_test_data_; | 88 bool has_new_hit_test_data_; |
70 | 89 |
| 90 components::VisitedLinkMaster visitedlink_master_; |
| 91 |
71 Client* client_; | 92 Client* client_; |
72 | 93 |
73 DISALLOW_COPY_AND_ASSIGN(AwRenderViewHostExt); | 94 DISALLOW_COPY_AND_ASSIGN(AwRenderViewHostExt); |
74 }; | 95 }; |
75 | 96 |
76 } // namespace android_webview | 97 } // namespace android_webview |
77 | 98 |
78 #endif // ANDROID_WEBVIEW_BROWSER_RENDER_HOST_RENDER_VIEW_HOST_EXT_H_ | 99 #endif // ANDROID_WEBVIEW_BROWSER_RENDER_HOST_RENDER_VIEW_HOST_EXT_H_ |
OLD | NEW |