diff options
author | Leon Scroggins III <scroggo@google.com> | 2010-06-29 17:11:29 -0400 |
---|---|---|
committer | Leon Scroggins III <scroggo@google.com> | 2010-06-30 12:02:39 -0400 |
commit | c1f5ae26d76a49e6bac9f3224ddb14eee74d4974 (patch) | |
tree | 748d6d4c4a28396075b0108c35a31a024a84b064 /src/com/android | |
parent | d3b3bc4d5e0cdc6ba08d6800f262d937e7469acb (diff) | |
download | packages_apps_Browser-c1f5ae26d76a49e6bac9f3224ddb14eee74d4974.zip packages_apps_Browser-c1f5ae26d76a49e6bac9f3224ddb14eee74d4974.tar.gz packages_apps_Browser-c1f5ae26d76a49e6bac9f3224ddb14eee74d4974.tar.bz2 |
Log if a user clicked on a link from voice search results.
Bug: 2803980
Change-Id: Ide6c4411e0468c7156d05fad28e4b24cf1e746ce
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/browser/Tab.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java index 07310bf..d2fed22 100644 --- a/src/com/android/browser/Tab.java +++ b/src/com/android/browser/Tab.java @@ -171,8 +171,8 @@ class Tab { return mVoiceSearchData != null; } /** - * Return true if the voice search Intent came with a String identifying - * that Google provided the Intent. + * Return true if the Tab is in voice search mode and the voice search + * Intent came with a String identifying that Google provided the Intent. */ public boolean voiceSearchSourceIsGoogle() { return mVoiceSearchData != null && mVoiceSearchData.mSourceIsGoogle; @@ -529,6 +529,18 @@ class Tab { // return true if want to hijack the url to let another app to handle it @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { + if (voiceSearchSourceIsGoogle()) { + // This method is called when the user clicks on a link. + // VoiceSearchMode is turned off when the user leaves the + // Google results page, so at this point the user must be on + // that page. If the user clicked a link on that page, assume + // that the voice search was effective, and broadcast an Intent + // so a receiver can take note of that fact. + Intent logIntent = new Intent(LoggingEvents.ACTION_LOG_EVENT); + logIntent.putExtra(LoggingEvents.EXTRA_EVENT, + LoggingEvents.VoiceSearch.RESULT_CLICKED); + mActivity.sendBroadcast(logIntent); + } if (mInForeground) { return mActivity.shouldOverrideUrlLoading(view, url); } else { |