Chromium Code Reviews| 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(gfx::RectF touch_area) { |
| 269 if (!render_view() || !render_view()->GetWebView()) | 269 if (!render_view() || !render_view()->GetWebView()) |
| 270 return; | 270 return; |
| 271 | 271 |
| 272 const blink::WebHitTestResult result = | 272 const blink::WebHitTestResult result = |
| 273 render_view()->GetWebView()->hitTestResultAt( | 273 render_view()->GetWebView()->hitTestResultForTap( |
| 274 blink::WebPoint(view_x, view_y)); | 274 blink::WebPoint(touch_area.x(), touch_area.y()), |
|
jdduke (slow)
2014/10/30 19:54:58
Ugg, this is misleading. The x/y coordinate of you
hush (inactive)
2014/11/04 01:55:57
Yes, misleading. I will pass the point and padding
| |
| 275 gfx::Size(touch_area.width(), touch_area.height())); | |
| 275 AwHitTestData data; | 276 AwHitTestData data; |
| 276 | 277 |
| 277 if (!result.urlElement().isNull()) { | 278 if (!result.urlElement().isNull()) { |
| 278 data.anchor_text = result.urlElement().innerText(); | 279 data.anchor_text = result.urlElement().innerText(); |
| 279 data.href = GetHref(result.urlElement()); | 280 data.href = GetHref(result.urlElement()); |
| 280 } | 281 } |
| 281 | 282 |
| 282 PopulateHitTestData(result.absoluteLinkURL(), | 283 PopulateHitTestData(result.absoluteLinkURL(), |
| 283 result.absoluteImageURL(), | 284 result.absoluteImageURL(), |
| 284 result.isContentEditable(), | 285 result.isContentEditable(), |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 307 page_scale_factor); | 308 page_scale_factor); |
| 308 } | 309 } |
| 309 | 310 |
| 310 void AwRenderViewExt::OnSetBackgroundColor(SkColor c) { | 311 void AwRenderViewExt::OnSetBackgroundColor(SkColor c) { |
| 311 if (!render_view() || !render_view()->GetWebView()) | 312 if (!render_view() || !render_view()->GetWebView()) |
| 312 return; | 313 return; |
| 313 render_view()->GetWebView()->setBaseBackgroundColor(c); | 314 render_view()->GetWebView()->setBaseBackgroundColor(c); |
| 314 } | 315 } |
| 315 | 316 |
| 316 } // namespace android_webview | 317 } // namespace android_webview |
| OLD | NEW |