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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java

Issue 2815653003: IPH - connect data saver previews (Closed)
Patch Set: Addressed comments 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/infobar/InfoBarContainer.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java
index 236c9c93d87c9edf251beec7f9fdfcc02a108f81..63561edc1694c6809b21d6f5ebfbdaf9989bfa02 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java
@@ -15,6 +15,7 @@ import org.chromium.base.VisibleForTesting;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.banners.SwipableOverlayView;
+import org.chromium.chrome.browser.infobar.InfoBarContainerLayout.Item;
import org.chromium.chrome.browser.tab.EmptyTabObserver;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tab.TabObserver;
@@ -57,6 +58,12 @@ public class InfoBarContainer extends SwipableOverlayView {
* Notifies the subscriber when an animation is completed.
*/
void notifyAnimationFinished(int animationType);
+
+ /**
+ * Notifies the subscriber when all animations are finished.
+ * @param frontInfoBar The frontmost infobar or {@code null} if none are showing.
+ */
+ void notifyAllAnimationsFinished(Item frontInfoBar);
}
/**
@@ -130,6 +137,9 @@ public class InfoBarContainer extends SwipableOverlayView {
private final InfoBarContainerLayout mLayout;
+ /** Helper class to manage showing in-product help bubbles over specific info bars. */
+ private final IPHInfoBarSupport mIPHSupport;
+
/** Native InfoBarContainer pointer which will be set by nativeInit(). */
private final long mNativeInfoBarContainer;
@@ -173,6 +183,10 @@ public class InfoBarContainer extends SwipableOverlayView {
addView(mLayout, new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT, Gravity.CENTER_HORIZONTAL));
+ mIPHSupport = new IPHInfoBarSupport(context);
+ mLayout.addAnimationListener(mIPHSupport);
+ addObserver(mIPHSupport);
+
// Chromium's InfoBarContainer may add an InfoBar immediately during this initialization
// call, so make sure everything in the InfoBarContainer is completely ready beforehand.
mNativeInfoBarContainer = nativeInit();
@@ -212,8 +226,8 @@ public class InfoBarContainer extends SwipableOverlayView {
}
@VisibleForTesting
- public void setAnimationListener(InfoBarAnimationListener listener) {
- mLayout.setAnimationListener(listener);
+ public void addAnimationListener(InfoBarAnimationListener listener) {
+ mLayout.addAnimationListener(listener);
}
/**
@@ -298,6 +312,8 @@ public class InfoBarContainer extends SwipableOverlayView {
}
public void destroy() {
+ mLayout.removeAnimationListener(mIPHSupport);
+ removeObserver(mIPHSupport);
mDestroyed = true;
if (mNativeInfoBarContainer != 0) {
nativeDestroy(mNativeInfoBarContainer);

Powered by Google App Engine
This is Rietveld 408576698