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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheet.java

Issue 2754313002: [Home] Record some user actions for the Chrome Home BottomSheet (Closed)
Patch Set: Update tests Created 3 years, 9 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/widget/bottomsheet/BottomSheet.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheet.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheet.java
index 6549ec5fe1feca81f3b860b7d38edc3b3ba23241..f634239ca001844ced957478ac3a524e538be4f6 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheet.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheet.java
@@ -182,6 +182,11 @@ public class BottomSheet
* Called to destroy the BottomSheetContent when it is no longer in use.
*/
void destroy();
+
+ /**
+ * @return The String to use when recording user metrics related to this content.
+ */
+ String getMetricsName();
}
/**
@@ -271,6 +276,8 @@ public class BottomSheet
mGestureDetector = new GestureDetector(context, new BottomSheetSwipeDetector());
mGestureDetector.setIsLongpressEnabled(false);
+
+ new BottomSheetMetrics(this);
}
@Override
@@ -505,6 +512,11 @@ public class BottomSheet
} else {
mDefaultToolbarView.setVisibility(View.VISIBLE);
}
+
+
+ for (BottomSheetObserver o : mObservers) {
+ o.onSheetContentChanged(mSheetContent);
+ }
}
/**
@@ -728,6 +740,7 @@ public class BottomSheet
* move there instantly.
*/
public void setSheetState(@SheetState int state, boolean animate) {
+ boolean stateChanged = state != mCurrentState;
mCurrentState = state;
if (animate) {
@@ -735,6 +748,11 @@ public class BottomSheet
} else {
setSheetOffsetFromBottom(getSheetHeightForState(state));
}
+
+ if (!stateChanged) return;
+ for (BottomSheetObserver o : mObservers) {
+ o.onSheetStateChanged(mCurrentState);
mdjones 2017/03/17 18:17:26 Admittedly the sheet state concept in this class i
Theresa 2017/03/17 20:26:30 As discussed offline, waiting until onAnimationEnd
+ }
}
/**

Powered by Google App Engine
This is Rietveld 408576698