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 "third_party/skia/include/core/SkColor.h" | 13 #include "third_party/skia/include/core/SkColor.h" |
| 14 #include "ui/gfx/size.h" |
14 | 15 |
15 class GURL; | 16 class GURL; |
16 | 17 |
17 namespace content { | 18 namespace content { |
18 struct FrameNavigateParams; | 19 struct FrameNavigateParams; |
19 struct LoadCommittedDetails; | 20 struct LoadCommittedDetails; |
20 } // namespace content | 21 } // namespace content |
21 | 22 |
22 namespace android_webview { | 23 namespace android_webview { |
23 | 24 |
24 class AwRenderViewHostExtClient { | 25 class AwRenderViewHostExtClient { |
25 public: | 26 public: |
26 // Called when the RenderView page scale changes. | 27 // Called when the RenderView page scale changes. |
27 virtual void OnWebLayoutPageScaleFactorChanged(float page_scale_factor) = 0; | 28 virtual void OnWebLayoutPageScaleFactorChanged(float page_scale_factor) = 0; |
| 29 virtual void OnWebLayoutContentsSizeChanged( |
| 30 const gfx::Size& contents_size) = 0; |
28 | 31 |
29 protected: | 32 protected: |
30 virtual ~AwRenderViewHostExtClient() {} | 33 virtual ~AwRenderViewHostExtClient() {} |
31 }; | 34 }; |
32 | 35 |
33 // Provides RenderViewHost wrapper functionality for sending WebView-specific | 36 // Provides RenderViewHost wrapper functionality for sending WebView-specific |
34 // IPC messages to the renderer and from there to WebKit. | 37 // IPC messages to the renderer and from there to WebKit. |
35 class AwRenderViewHostExt : public content::WebContentsObserver, | 38 class AwRenderViewHostExt : public content::WebContentsObserver, |
36 public base::NonThreadSafe { | 39 public base::NonThreadSafe { |
37 public: | 40 public: |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 virtual void RenderViewCreated(content::RenderViewHost* view_host) OVERRIDE; | 82 virtual void RenderViewCreated(content::RenderViewHost* view_host) OVERRIDE; |
80 virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE; | 83 virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE; |
81 virtual void DidNavigateAnyFrame( | 84 virtual void DidNavigateAnyFrame( |
82 const content::LoadCommittedDetails& details, | 85 const content::LoadCommittedDetails& details, |
83 const content::FrameNavigateParams& params) OVERRIDE; | 86 const content::FrameNavigateParams& params) OVERRIDE; |
84 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 87 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
85 | 88 |
86 void OnDocumentHasImagesResponse(int msg_id, bool has_images); | 89 void OnDocumentHasImagesResponse(int msg_id, bool has_images); |
87 void OnUpdateHitTestData(const AwHitTestData& hit_test_data); | 90 void OnUpdateHitTestData(const AwHitTestData& hit_test_data); |
88 void OnPageScaleFactorChanged(float page_scale_factor); | 91 void OnPageScaleFactorChanged(float page_scale_factor); |
| 92 void OnContentsSizeChanged(const gfx::Size& contents_size); |
89 | 93 |
90 bool IsRenderViewReady() const; | 94 bool IsRenderViewReady() const; |
91 | 95 |
92 AwRenderViewHostExtClient* client_; | 96 AwRenderViewHostExtClient* client_; |
93 | 97 |
94 SkColor background_color_; | 98 SkColor background_color_; |
95 | 99 |
96 std::map<int, DocumentHasImagesResult> pending_document_has_images_requests_; | 100 std::map<int, DocumentHasImagesResult> pending_document_has_images_requests_; |
97 | 101 |
98 // Master copy of hit test data on the browser side. This is updated | 102 // Master copy of hit test data on the browser side. This is updated |
99 // as a result of DoHitTest called explicitly or when the FocusedNodeChanged | 103 // as a result of DoHitTest called explicitly or when the FocusedNodeChanged |
100 // is called in AwRenderViewExt. | 104 // is called in AwRenderViewExt. |
101 AwHitTestData last_hit_test_data_; | 105 AwHitTestData last_hit_test_data_; |
102 | 106 |
103 bool has_new_hit_test_data_; | 107 bool has_new_hit_test_data_; |
104 | 108 |
105 DISALLOW_COPY_AND_ASSIGN(AwRenderViewHostExt); | 109 DISALLOW_COPY_AND_ASSIGN(AwRenderViewHostExt); |
106 }; | 110 }; |
107 | 111 |
108 } // namespace android_webview | 112 } // namespace android_webview |
109 | 113 |
110 #endif // ANDROID_WEBVIEW_BROWSER_RENDER_HOST_RENDER_VIEW_HOST_EXT_H_ | 114 #endif // ANDROID_WEBVIEW_BROWSER_RENDER_HOST_RENDER_VIEW_HOST_EXT_H_ |
OLD | NEW |