summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLeon Scroggins III <scroggo@google.com>2010-06-30 15:49:18 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-06-30 15:49:18 -0700
commit2176c40a781cb1450e06b947b8e5521438d6a0f6 (patch)
treeea4b569bc6a6ebaa4e1262bed5157c1ae194917a /src
parent87cc65d95c80c5e3a1c343ad5177a7dc2de874f6 (diff)
parenta3fb156b7cdd11822819dbebe6726d3842d3628c (diff)
downloadpackages_apps_Browser-2176c40a781cb1450e06b947b8e5521438d6a0f6.zip
packages_apps_Browser-2176c40a781cb1450e06b947b8e5521438d6a0f6.tar.gz
packages_apps_Browser-2176c40a781cb1450e06b947b8e5521438d6a0f6.tar.bz2
am a3fb156b: am c1f5ae26: Log if a user clicked on a link from voice search results.
Merge commit 'a3fb156b7cdd11822819dbebe6726d3842d3628c' * commit 'a3fb156b7cdd11822819dbebe6726d3842d3628c': Log if a user clicked on a link from voice search results.
Diffstat (limited to 'src')
-rw-r--r--src/com/android/browser/Tab.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index 9994945..f7438da 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 {