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 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" | 5 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" |
6 | 6 |
7 #include "android_webview/browser/aw_browser_context.h" | 7 #include "android_webview/browser/aw_browser_context.h" |
8 #include "android_webview/browser/scoped_allow_wait_for_legacy_web_view_api.h" | 8 #include "android_webview/browser/scoped_allow_wait_for_legacy_web_view_api.h" |
9 #include "android_webview/common/aw_switches.h" | 9 #include "android_webview/common/aw_switches.h" |
10 #include "android_webview/common/render_view_messages.h" | 10 #include "android_webview/common/render_view_messages.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 if (web_contents()->GetRenderViewHost()) { | 93 if (web_contents()->GetRenderViewHost()) { |
94 Send(new AwViewMsg_SetBackgroundColor(web_contents()->GetRoutingID(), | 94 Send(new AwViewMsg_SetBackgroundColor(web_contents()->GetRoutingID(), |
95 background_color_)); | 95 background_color_)); |
96 } | 96 } |
97 } | 97 } |
98 | 98 |
99 void AwRenderViewHostExt::SetJsOnlineProperty(bool network_up) { | 99 void AwRenderViewHostExt::SetJsOnlineProperty(bool network_up) { |
100 Send(new AwViewMsg_SetJsOnlineProperty(network_up)); | 100 Send(new AwViewMsg_SetJsOnlineProperty(network_up)); |
101 } | 101 } |
102 | 102 |
| 103 void AwRenderViewHostExt::EnableContentsSizeNotifications() { |
| 104 Send(new AwViewMsg_EnableContentsSizeNotifications( |
| 105 web_contents()->GetRoutingID())); |
| 106 } |
| 107 |
103 void AwRenderViewHostExt::RenderViewCreated( | 108 void AwRenderViewHostExt::RenderViewCreated( |
104 content::RenderViewHost* render_view_host) { | 109 content::RenderViewHost* render_view_host) { |
105 Send(new AwViewMsg_SetBackgroundColor(web_contents()->GetRoutingID(), | 110 Send(new AwViewMsg_SetBackgroundColor(web_contents()->GetRoutingID(), |
106 background_color_)); | 111 background_color_)); |
107 } | 112 } |
108 | 113 |
109 void AwRenderViewHostExt::RenderProcessGone(base::TerminationStatus status) { | 114 void AwRenderViewHostExt::RenderProcessGone(base::TerminationStatus status) { |
110 DCHECK(CalledOnValidThread()); | 115 DCHECK(CalledOnValidThread()); |
111 for (std::map<int, DocumentHasImagesResult>::iterator pending_req = | 116 for (std::map<int, DocumentHasImagesResult>::iterator pending_req = |
112 pending_document_has_images_requests_.begin(); | 117 pending_document_has_images_requests_.begin(); |
(...skipping 14 matching lines...) Expand all Loading... |
127 | 132 |
128 bool AwRenderViewHostExt::OnMessageReceived(const IPC::Message& message) { | 133 bool AwRenderViewHostExt::OnMessageReceived(const IPC::Message& message) { |
129 bool handled = true; | 134 bool handled = true; |
130 IPC_BEGIN_MESSAGE_MAP(AwRenderViewHostExt, message) | 135 IPC_BEGIN_MESSAGE_MAP(AwRenderViewHostExt, message) |
131 IPC_MESSAGE_HANDLER(AwViewHostMsg_DocumentHasImagesResponse, | 136 IPC_MESSAGE_HANDLER(AwViewHostMsg_DocumentHasImagesResponse, |
132 OnDocumentHasImagesResponse) | 137 OnDocumentHasImagesResponse) |
133 IPC_MESSAGE_HANDLER(AwViewHostMsg_UpdateHitTestData, | 138 IPC_MESSAGE_HANDLER(AwViewHostMsg_UpdateHitTestData, |
134 OnUpdateHitTestData) | 139 OnUpdateHitTestData) |
135 IPC_MESSAGE_HANDLER(AwViewHostMsg_PageScaleFactorChanged, | 140 IPC_MESSAGE_HANDLER(AwViewHostMsg_PageScaleFactorChanged, |
136 OnPageScaleFactorChanged) | 141 OnPageScaleFactorChanged) |
| 142 IPC_MESSAGE_HANDLER(AwViewHostMsg_OnContentsSizeChanged, |
| 143 OnContentsSizeChanged) |
137 IPC_MESSAGE_UNHANDLED(handled = false) | 144 IPC_MESSAGE_UNHANDLED(handled = false) |
138 IPC_END_MESSAGE_MAP() | 145 IPC_END_MESSAGE_MAP() |
139 | 146 |
140 return handled ? true : WebContentsObserver::OnMessageReceived(message); | 147 return handled ? true : WebContentsObserver::OnMessageReceived(message); |
141 } | 148 } |
142 | 149 |
143 void AwRenderViewHostExt::OnDocumentHasImagesResponse(int msg_id, | 150 void AwRenderViewHostExt::OnDocumentHasImagesResponse(int msg_id, |
144 bool has_images) { | 151 bool has_images) { |
145 DCHECK(CalledOnValidThread()); | 152 DCHECK(CalledOnValidThread()); |
146 std::map<int, DocumentHasImagesResult>::iterator pending_req = | 153 std::map<int, DocumentHasImagesResult>::iterator pending_req = |
(...skipping 10 matching lines...) Expand all Loading... |
157 const AwHitTestData& hit_test_data) { | 164 const AwHitTestData& hit_test_data) { |
158 DCHECK(CalledOnValidThread()); | 165 DCHECK(CalledOnValidThread()); |
159 last_hit_test_data_ = hit_test_data; | 166 last_hit_test_data_ = hit_test_data; |
160 has_new_hit_test_data_ = true; | 167 has_new_hit_test_data_ = true; |
161 } | 168 } |
162 | 169 |
163 void AwRenderViewHostExt::OnPageScaleFactorChanged(float page_scale_factor) { | 170 void AwRenderViewHostExt::OnPageScaleFactorChanged(float page_scale_factor) { |
164 client_->OnWebLayoutPageScaleFactorChanged(page_scale_factor); | 171 client_->OnWebLayoutPageScaleFactorChanged(page_scale_factor); |
165 } | 172 } |
166 | 173 |
| 174 void AwRenderViewHostExt::OnContentsSizeChanged( |
| 175 const gfx::Size& contents_size) { |
| 176 client_->OnWebLayoutContentsSizeChanged(contents_size); |
| 177 } |
| 178 |
167 } // namespace android_webview | 179 } // namespace android_webview |
OLD | NEW |