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

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

Issue 2815653003: IPH - connect data saver previews (Closed)
Patch Set: Cleaned up CL a bit 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..9dc153c5065fb653b5be703917d51273816cd994 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,8 @@ public class InfoBarContainer extends SwipableOverlayView {
private final InfoBarContainerLayout mLayout;
+ private final IPHInfoBarSupport mIPHSupport;
gone 2017/04/18 21:05:19 javadoc?
David Trainor- moved to gerrit 2017/04/25 05:01:05 Done.
+
/** Native InfoBarContainer pointer which will be set by nativeInit(). */
private final long mNativeInfoBarContainer;
@@ -173,6 +182,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();
@@ -213,7 +226,7 @@ public class InfoBarContainer extends SwipableOverlayView {
@VisibleForTesting
public void setAnimationListener(InfoBarAnimationListener listener) {
gone 2017/04/18 21:05:19 rename the function? set implies one
David Trainor- moved to gerrit 2017/04/25 05:01:05 Done.
- mLayout.setAnimationListener(listener);
+ mLayout.addAnimationListener(listener);
}
/**
@@ -298,6 +311,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