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(int view_x, int view_y, float touch_major) { |
| 269 if (!render_view() || !render_view()->GetWebView()) | 269 if (!render_view() || !render_view()->GetWebView()) |
| 270 return; | 270 return; |
| 271 | 271 |
| 272 // Using half of touch major as the radius. This follows what | |
| 273 // WebInputEventUtil::CreateWebTouchPoint is doing. | |
| 274 int radius = 0.5f * touch_major; | |
| 275 const blink::WebSize touch_area(radius, radius); | |
|
jdduke (slow)
2014/10/28 23:08:04
We shouldn't be using a radius here. Radii are onl
hush (inactive)
2014/10/30 00:25:19
Instead of passing touch_major, I will pass both t
| |
| 272 const blink::WebHitTestResult result = | 276 const blink::WebHitTestResult result = |
| 273 render_view()->GetWebView()->hitTestResultAt( | 277 render_view()->GetWebView()->hitTestResultForTap( |
|
hush (inactive)
2014/10/28 22:57:45
I only changed here in PS4. Others are just rebase
| |
| 274 blink::WebPoint(view_x, view_y)); | 278 blink::WebPoint(view_x, view_y), touch_area); |
| 275 AwHitTestData data; | 279 AwHitTestData data; |
| 276 | 280 |
| 277 if (!result.urlElement().isNull()) { | 281 if (!result.urlElement().isNull()) { |
| 278 data.anchor_text = result.urlElement().innerText(); | 282 data.anchor_text = result.urlElement().innerText(); |
| 279 data.href = GetHref(result.urlElement()); | 283 data.href = GetHref(result.urlElement()); |
| 280 } | 284 } |
| 281 | 285 |
| 282 PopulateHitTestData(result.absoluteLinkURL(), | 286 PopulateHitTestData(result.absoluteLinkURL(), |
| 283 result.absoluteImageURL(), | 287 result.absoluteImageURL(), |
| 284 result.isContentEditable(), | 288 result.isContentEditable(), |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 307 page_scale_factor); | 311 page_scale_factor); |
| 308 } | 312 } |
| 309 | 313 |
| 310 void AwRenderViewExt::OnSetBackgroundColor(SkColor c) { | 314 void AwRenderViewExt::OnSetBackgroundColor(SkColor c) { |
| 311 if (!render_view() || !render_view()->GetWebView()) | 315 if (!render_view() || !render_view()->GetWebView()) |
| 312 return; | 316 return; |
| 313 render_view()->GetWebView()->setBaseBackgroundColor(c); | 317 render_view()->GetWebView()->setBaseBackgroundColor(c); |
| 314 } | 318 } |
| 315 | 319 |
| 316 } // namespace android_webview | 320 } // namespace android_webview |
| OLD | NEW |