Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2458)

Unified Diff: android_webview/renderer/aw_render_view_ext.cc

Issue 92903003: aw: Limit full url href hittest to only anchor type (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix SRC_IMAGE_LINK_TYPE as well Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « android_webview/javatests/src/org/chromium/android_webview/test/WebKitHitTestTest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/renderer/aw_render_view_ext.cc
diff --git a/android_webview/renderer/aw_render_view_ext.cc b/android_webview/renderer/aw_render_view_ext.cc
index f8061154c2d69930364260022837483ba568a67d..313554a0377739da16f661bdc9cfc3a125b18b25 100644
--- a/android_webview/renderer/aw_render_view_ext.cc
+++ b/android_webview/renderer/aw_render_view_ext.cc
@@ -108,6 +108,8 @@ void DistinguishAndAssignSrcLinkType(const GURL& url, AwHitTestData* data) {
} else {
data->type = AwHitTestData::SRC_LINK_TYPE;
data->extra_data_for_type = url.possibly_invalid_spec();
+ if (!data->extra_data_for_type.empty())
+ data->href = UTF8ToUTF16(data->extra_data_for_type);
}
}
@@ -132,6 +134,8 @@ void PopulateHitTestData(const GURL& absolute_link_url,
} else if (has_link_url && has_image_url && !is_javascript_scheme) {
data->type = AwHitTestData::SRC_IMAGE_LINK_TYPE;
data->extra_data_for_type = data->img_src.possibly_invalid_spec();
+ if (absolute_link_url.is_valid())
+ data->href = UTF8ToUTF16(absolute_link_url.possibly_invalid_spec());
} else if (!has_link_url && has_image_url) {
data->type = AwHitTestData::IMAGE_TYPE;
data->extra_data_for_type = data->img_src.possibly_invalid_spec();
« no previous file with comments | « android_webview/javatests/src/org/chromium/android_webview/test/WebKitHitTestTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698