| 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/renderer/aw_render_view_ext.h" | 5 #include "android_webview/renderer/aw_render_view_ext.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "android_webview/common/aw_hit_test_data.h" | 9 #include "android_webview/common/aw_hit_test_data.h" |
| 10 #include "android_webview/common/render_view_messages.h" | 10 #include "android_webview/common/render_view_messages.h" |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 GetAbsoluteSrcUrl(child_img); | 258 GetAbsoluteSrcUrl(child_img); |
| 259 } | 259 } |
| 260 | 260 |
| 261 PopulateHitTestData(absolute_link_url, | 261 PopulateHitTestData(absolute_link_url, |
| 262 absolute_image_url, | 262 absolute_image_url, |
| 263 render_view()->IsEditableNode(node), | 263 render_view()->IsEditableNode(node), |
| 264 &data); | 264 &data); |
| 265 Send(new AwViewHostMsg_UpdateHitTestData(routing_id(), data)); | 265 Send(new AwViewHostMsg_UpdateHitTestData(routing_id(), data)); |
| 266 } | 266 } |
| 267 | 267 |
| 268 void AwRenderViewExt::OnDoHitTest(int view_x, int view_y) { | 268 void AwRenderViewExt::OnDoHitTest(const gfx::PointF& touch_center, |
| 269 const gfx::SizeF& touch_area) { |
| 269 if (!render_view() || !render_view()->GetWebView()) | 270 if (!render_view() || !render_view()->GetWebView()) |
| 270 return; | 271 return; |
| 271 | 272 |
| 272 const blink::WebHitTestResult result = | 273 const blink::WebHitTestResult result = |
| 273 render_view()->GetWebView()->hitTestResultAt( | 274 render_view()->GetWebView()->hitTestResultForTap( |
| 274 blink::WebPoint(view_x, view_y)); | 275 blink::WebPoint(touch_center.x(), touch_center.y()), |
| 276 blink::WebSize(touch_area.width(), touch_area.height())); |
| 275 AwHitTestData data; | 277 AwHitTestData data; |
| 276 | 278 |
| 277 if (!result.urlElement().isNull()) { | 279 if (!result.urlElement().isNull()) { |
| 278 data.anchor_text = result.urlElement().innerText(); | 280 data.anchor_text = result.urlElement().innerText(); |
| 279 data.href = GetHref(result.urlElement()); | 281 data.href = GetHref(result.urlElement()); |
| 280 } | 282 } |
| 281 | 283 |
| 282 PopulateHitTestData(result.absoluteLinkURL(), | 284 PopulateHitTestData(result.absoluteLinkURL(), |
| 283 result.absoluteImageURL(), | 285 result.absoluteImageURL(), |
| 284 result.isContentEditable(), | 286 result.isContentEditable(), |
| (...skipping 22 matching lines...) Expand all Loading... |
| 307 page_scale_factor); | 309 page_scale_factor); |
| 308 } | 310 } |
| 309 | 311 |
| 310 void AwRenderViewExt::OnSetBackgroundColor(SkColor c) { | 312 void AwRenderViewExt::OnSetBackgroundColor(SkColor c) { |
| 311 if (!render_view() || !render_view()->GetWebView()) | 313 if (!render_view() || !render_view()->GetWebView()) |
| 312 return; | 314 return; |
| 313 render_view()->GetWebView()->setBaseBackgroundColor(c); | 315 render_view()->GetWebView()->setBaseBackgroundColor(c); |
| 314 } | 316 } |
| 315 | 317 |
| 316 } // namespace android_webview | 318 } // namespace android_webview |
| OLD | NEW |