OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 package org.chromium.chrome.browser.contextualsearch; | 5 package org.chromium.chrome.browser.contextualsearch; |
6 | 6 |
7 import android.util.Pair; | 7 import android.util.Pair; |
8 | 8 |
9 import org.chromium.base.metrics.RecordHistogram; | 9 import org.chromium.base.metrics.RecordHistogram; |
10 import org.chromium.base.metrics.RecordUserAction; | 10 import org.chromium.base.metrics.RecordUserAction; |
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 * @param wasPanelSeen Whether the panel was seen. | 704 * @param wasPanelSeen Whether the panel was seen. |
705 * @param wasTap Whether the gesture that originally caused the panel to sho
w was a Tap. | 705 * @param wasTap Whether the gesture that originally caused the panel to sho
w was a Tap. |
706 */ | 706 */ |
707 public static void logResultsSeen(boolean wasPanelSeen, boolean wasTap) { | 707 public static void logResultsSeen(boolean wasPanelSeen, boolean wasTap) { |
708 RecordHistogram.recordEnumeratedHistogram("Search.ContextualSearchResult
sSeen", | 708 RecordHistogram.recordEnumeratedHistogram("Search.ContextualSearchResult
sSeen", |
709 wasPanelSeen ? RESULTS_SEEN : RESULTS_NOT_SEEN, RESULTS_SEEN_BOU
NDARY); | 709 wasPanelSeen ? RESULTS_SEEN : RESULTS_NOT_SEEN, RESULTS_SEEN_BOU
NDARY); |
710 logHistogramByGesture(wasPanelSeen, wasTap, "Search.ContextualSearchResu
ltsSeenByGesture"); | 710 logHistogramByGesture(wasPanelSeen, wasTap, "Search.ContextualSearchResu
ltsSeenByGesture"); |
711 } | 711 } |
712 | 712 |
713 /** | 713 /** |
714 * Logs whether search results were seen when the selection was part of a UR
L. | |
715 * Unlike ContextualSearchResultsSeen, this histogram is logged for both dec
ided and undecided | |
716 * users. | |
717 * @param wasPanelSeen Whether the panel was seen. | |
718 * @param wasTap Whether the gesture that originally caused the panel to sho
w was a Tap. | |
719 */ | |
720 public static void logResultsSeenSelectionIsUrl(boolean wasPanelSeen, boolea
n wasTap) { | |
721 int result = wasPanelSeen ? (wasTap ? RESULTS_SEEN_FROM_TAP : RESULTS_SE
EN_FROM_LONG_PRESS) | |
722 : (wasTap ? RESULTS_NOT_SEEN_FROM_TAP : RESULTS_NOT_SEEN_FROM_LO
NG_PRESS); | |
723 RecordHistogram.recordEnumeratedHistogram( | |
724 "Search.ContextualSearchResultsSeenSelectionWasUrl", result, | |
725 RESULTS_BY_GESTURE_BOUNDARY); | |
726 } | |
727 | |
728 /** | |
729 * Logs the whether the panel was seen and the type of the trigger and if Ba
r nearly overlapped. | 714 * Logs the whether the panel was seen and the type of the trigger and if Ba
r nearly overlapped. |
730 * @param wasPanelSeen Whether the panel was seen. | 715 * @param wasPanelSeen Whether the panel was seen. |
731 * @param wasTap Whether the gesture was a Tap or not. | 716 * @param wasTap Whether the gesture was a Tap or not. |
732 * @param wasBarOverlap Whether the trigger location overlapped the Bar area
. | 717 * @param wasBarOverlap Whether the trigger location overlapped the Bar area
. |
733 */ | 718 */ |
734 public static void logBarOverlapResultsSeen( | 719 public static void logBarOverlapResultsSeen( |
735 boolean wasPanelSeen, boolean wasTap, boolean wasBarOverlap) { | 720 boolean wasPanelSeen, boolean wasTap, boolean wasBarOverlap) { |
736 RecordHistogram.recordEnumeratedHistogram("Search.ContextualSearchBarOve
rlapSeen", | 721 RecordHistogram.recordEnumeratedHistogram("Search.ContextualSearchBarOve
rlapSeen", |
737 getBarOverlapEnum(wasBarOverlap, wasPanelSeen, wasTap), | 722 getBarOverlapEnum(wasBarOverlap, wasPanelSeen, wasTap), |
738 BAR_OVERLAP_RESULTS_BOUNDARY); | 723 BAR_OVERLAP_RESULTS_BOUNDARY); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 wasSearchContentViewSeen ? RESULTS_SEEN : RESULTS_NOT_SEEN, | 797 wasSearchContentViewSeen ? RESULTS_SEEN : RESULTS_NOT_SEEN, |
813 RESULTS_SEEN_BOUNDARY); | 798 RESULTS_SEEN_BOUNDARY); |
814 } else { | 799 } else { |
815 RecordHistogram.recordEnumeratedHistogram("Search.ContextualSearchTa
pSuppressionSeen", | 800 RecordHistogram.recordEnumeratedHistogram("Search.ContextualSearchTa
pSuppressionSeen", |
816 wasSearchContentViewSeen ? RESULTS_SEEN : RESULTS_NOT_SEEN, | 801 wasSearchContentViewSeen ? RESULTS_SEEN : RESULTS_NOT_SEEN, |
817 RESULTS_SEEN_BOUNDARY); | 802 RESULTS_SEEN_BOUNDARY); |
818 } | 803 } |
819 } | 804 } |
820 | 805 |
821 /** | 806 /** |
822 * Logs whether results were seen when the selected text consisted of all ca
pital letters. | |
823 * @param wasSearchContentViewSeen If the panel was opened. | |
824 */ | |
825 public static void logAllCapsResultsSeen(boolean wasSearchContentViewSeen) { | |
826 RecordHistogram.recordEnumeratedHistogram("Search.ContextualSearchAllCap
sResultsSeen", | |
827 wasSearchContentViewSeen ? RESULTS_SEEN : RESULTS_NOT_SEEN, | |
828 RESULTS_SEEN_BOUNDARY); | |
829 } | |
830 | |
831 /** | |
832 * Logs whether results were seen when the selected text started with a capi
tal letter but was | 807 * Logs whether results were seen when the selected text started with a capi
tal letter but was |
833 * not all capital letters. | 808 * not all capital letters. |
834 * @param wasSearchContentViewSeen If the panel was opened. | 809 * @param wasSearchContentViewSeen If the panel was opened. |
835 */ | 810 */ |
836 public static void logStartedWithCapitalResultsSeen(boolean wasSearchContent
ViewSeen) { | 811 public static void logStartedWithCapitalResultsSeen(boolean wasSearchContent
ViewSeen) { |
837 RecordHistogram.recordEnumeratedHistogram( | 812 RecordHistogram.recordEnumeratedHistogram( |
838 "Search.ContextualSearchStartedWithCapitalResultsSeen", | 813 "Search.ContextualSearchStartedWithCapitalResultsSeen", |
839 wasSearchContentViewSeen ? RESULTS_SEEN : RESULTS_NOT_SEEN, | 814 wasSearchContentViewSeen ? RESULTS_SEEN : RESULTS_NOT_SEEN, |
840 RESULTS_SEEN_BOUNDARY); | 815 RESULTS_SEEN_BOUNDARY); |
841 } | 816 } |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1356 return "Event"; | 1331 return "Event"; |
1357 case QuickActionCategory.PHONE: | 1332 case QuickActionCategory.PHONE: |
1358 return "Phone"; | 1333 return "Phone"; |
1359 case QuickActionCategory.WEBSITE: | 1334 case QuickActionCategory.WEBSITE: |
1360 return "Website"; | 1335 return "Website"; |
1361 default: | 1336 default: |
1362 return "None"; | 1337 return "None"; |
1363 } | 1338 } |
1364 } | 1339 } |
1365 } | 1340 } |
OLD | NEW |