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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUma.java

Issue 2798123002: Remove crushed sprite resource and layer (Closed)
Patch Set: Rebase and fix my nits Created 3 years, 8 months 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
Index: chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUma.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUma.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUma.java
index ecbe405aa047a5862b626ce20e24d38e94cfa175..2c6135f96b3fa9eac2f367ba09ee51cf9fd71fd8 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUma.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUma.java
@@ -171,12 +171,6 @@ public class ContextualSearchUma {
private static final int PROMO_UNDECIDED_FROM_LONG_PRESS = 5;
private static final int PROMO_BY_GESTURE_BOUNDARY = 6;
- // Constants used to log UMA "enum" histograms with summary counts for SERP loading times.
- private static final int PREFETCHED_PARIALLY_LOADED = 0;
- private static final int PREFETCHED_FULLY_LOADED = 1;
- private static final int NOT_PREFETCHED = 2;
- private static final int PREFETCH_BOUNDARY = 3;
-
// Constants used to log UMA "enum" histograms for HTTP / HTTPS.
private static final int PROTOCOL_IS_HTTP = 0;
private static final int PROTOCOL_NOT_HTTP = 1;
@@ -187,29 +181,11 @@ public class ContextualSearchUma {
private static final int RESOLVED_MULTI_WORD = 1;
private static final int RESOLVED_BOUNDARY = 2;
- // Constants used to log UMA "enum" histograms for partially / fully loaded.
- private static final int PARTIALLY_LOADED = 0;
- private static final int FULLY_LOADED = 1;
- private static final int LOADED_BOUNDARY = 2;
-
// Constants used to log UMA "enum" histograms for triggering the Translate Onebox.
private static final int DID_FORCE_TRANSLATE = 0;
private static final int WOULD_FORCE_TRANSLATE = 1;
private static final int FORCE_TRANSLATE_BOUNDARY = 2;
- // Constants used to log UMA "enum" histograms with details about whether the search
- // provider sprite icon was animated, whether search results were seen and the triggering
- // gesture. All new values should be inserted right before ICON_SPRITE_BOUNDARY.
- private static final int ICON_SPRITE_ANIMATED_RESULTS_SEEN_FROM_TAP = 0;
- private static final int ICON_SPRITE_ANIMATED_RESULTS_NOT_SEEN_FROM_TAP = 1;
- private static final int ICON_SPRITE_NOT_ANIMATED_RESULTS_SEEN_FROM_TAP = 2;
- private static final int ICON_SPRITE_NOT_ANIMATED_RESULTS_NOT_SEEN_FROM_TAP = 3;
- private static final int ICON_SPRITE_ANIMATED_RESULTS_SEEN_FROM_LONG_PRESS = 4;
- private static final int ICON_SPRITE_ANIMATED_RESULTS_NOT_SEEN_FROM_LONG_PRESS = 5;
- private static final int ICON_SPRITE_NOT_ANIMATED_RESULTS_SEEN_FROM_LONG_PRESS = 6;
- private static final int ICON_SPRITE_NOT_ANIMATED_RESULTS_NOT_SEEN_FROM_LONG_PRESS = 7;
- private static final int ICON_SPRITE_BOUNDARY = 8;
-
// Constants used to log UMA "enum" histograms for Quick Answers.
private static final int QUICK_ANSWER_ACTIVATED_WAS_AN_ANSWER_SEEN = 0;
private static final int QUICK_ANSWER_ACTIVATED_WAS_AN_ANSWER_NOT_SEEN = 1;
@@ -268,47 +244,6 @@ public class ContextualSearchUma {
}
}
- static class IconSpriteAnimationKey {
- final boolean mWasIconSpriteAnimated;
- final boolean mWasPanelSeen;
- final boolean mWasTap;
- final int mHashCode;
-
- IconSpriteAnimationKey(boolean wasIconSpriteAnimated, boolean wasPanelSeen,
- boolean wasTap) {
- mWasIconSpriteAnimated = wasIconSpriteAnimated;
- mWasPanelSeen = wasPanelSeen;
- mWasTap = wasTap;
-
- // HashCode logic generated by Eclipse.
- final int prime = 31;
- int result = 1;
- result = prime * result + (mWasIconSpriteAnimated ? 1231 : 1237);
- result = prime * result + (mWasPanelSeen ? 1231 : 1237);
- result = prime * result + (mWasTap ? 1231 : 1237);
- mHashCode = result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (!(obj instanceof IconSpriteAnimationKey)) {
- return false;
- }
- if (obj == this) {
- return true;
- }
- IconSpriteAnimationKey other = (IconSpriteAnimationKey) obj;
- return other.mWasIconSpriteAnimated == mWasIconSpriteAnimated
- && other.mWasPanelSeen == mWasPanelSeen
- && other.mWasTap == mWasTap;
- }
-
- @Override
- public int hashCode() {
- return mHashCode;
- }
- }
-
// TODO(donnd): switch from using Maps to some method that does not require creation of a key.
// Entry code map: first entry into CLOSED.
@@ -521,29 +456,6 @@ public class ContextualSearchUma {
PROMO_BY_GESTURE_CODES = Collections.unmodifiableMap(codes);
}
- // Icon sprite animation code mapped: logged when ending a contextual search.
- private static final Map<IconSpriteAnimationKey, Integer> ICON_SPRITE_ANIMATION_CODES;
- static {
- Map<IconSpriteAnimationKey, Integer> codes = new HashMap<IconSpriteAnimationKey, Integer>();
- codes.put(new IconSpriteAnimationKey(true, true, true),
- ICON_SPRITE_ANIMATED_RESULTS_SEEN_FROM_TAP);
- codes.put(new IconSpriteAnimationKey(true, false, true),
- ICON_SPRITE_ANIMATED_RESULTS_NOT_SEEN_FROM_TAP);
- codes.put(new IconSpriteAnimationKey(false, true, true),
- ICON_SPRITE_NOT_ANIMATED_RESULTS_SEEN_FROM_TAP);
- codes.put(new IconSpriteAnimationKey(false, false, true),
- ICON_SPRITE_NOT_ANIMATED_RESULTS_NOT_SEEN_FROM_TAP);
- codes.put(new IconSpriteAnimationKey(true, true, false),
- ICON_SPRITE_ANIMATED_RESULTS_SEEN_FROM_LONG_PRESS);
- codes.put(new IconSpriteAnimationKey(true, false, false),
- ICON_SPRITE_ANIMATED_RESULTS_NOT_SEEN_FROM_LONG_PRESS);
- codes.put(new IconSpriteAnimationKey(false, true, false),
- ICON_SPRITE_NOT_ANIMATED_RESULTS_SEEN_FROM_LONG_PRESS);
- codes.put(new IconSpriteAnimationKey(false, false, false),
- ICON_SPRITE_NOT_ANIMATED_RESULTS_NOT_SEEN_FROM_LONG_PRESS);
- ICON_SPRITE_ANIMATION_CODES = Collections.unmodifiableMap(codes);
- }
-
/**
* Logs the state of the Contextual Search preference. This function should be called if the
* Contextual Search feature is active, and will track the different preference settings
@@ -952,22 +864,6 @@ public class ContextualSearchUma {
}
/**
- * Logs whether search results were seen, whether the search provider icon sprite was animated
- * when the panel first appeared, and the triggering gesture.
- * @param wasIconSpriteAnimated Whether the search provider icon sprite was animated when the
- * the panel first appeared.
- * @param wasPanelSeen Whether the panel was seen.
- * @param wasTap Whether the gesture that originally caused the panel to show was a Tap.
- */
- public static void logIconSpriteAnimated(boolean wasIconSpriteAnimated, boolean wasPanelSeen,
- boolean wasTap) {
- RecordHistogram.recordEnumeratedHistogram("Search.ContextualSearchIconSpriteAnimated",
- ICON_SPRITE_ANIMATION_CODES.get(new IconSpriteAnimationKey(wasIconSpriteAnimated,
- wasPanelSeen, wasTap)),
- ICON_SPRITE_BOUNDARY);
- }
-
- /**
* Logs whether a selection is valid.
* @param isSelectionValid Whether the selection is valid.
*/

Powered by Google App Engine
This is Rietveld 408576698