Commit 4622186c authored by Gang Wu's avatar Gang Wu Committed by Commit Bot

[duet] No IPH of duet for landscape mode

Duet won't show in landscape mode, so IPH for duet show not show up in
landscape mode as well.

Here is related clank cl.
https://chrome-internal-review.googlesource.com/c/clank/internal/apps/+/2256299

Bug: 966792
Change-Id: I4ed882dfefa289ddfcaf3ec2204c4ac6f41043c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1947383
Commit-Queue: Gang Wu <gangwu@chromium.org>
Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721322}
parent 268ad6ce
...@@ -109,6 +109,7 @@ class BottomToolbarCoordinator { ...@@ -109,6 +109,7 @@ class BottomToolbarCoordinator {
if (mTabSwitcherModeCoordinator != null) { if (mTabSwitcherModeCoordinator != null) {
mTabSwitcherModeCoordinator.showToolbarOnTop(!isVisible); mTabSwitcherModeCoordinator.showToolbarOnTop(!isVisible);
} }
mBrowsingModeCoordinator.onVisibilityChanged(isVisible);
} }
/** /**
......
...@@ -156,6 +156,17 @@ public class BrowsingModeBottomToolbarCoordinator { ...@@ -156,6 +156,17 @@ public class BrowsingModeBottomToolbarCoordinator {
}); });
} }
/**
* @param isVisible Whether the bottom toolbar is visible.
*/
void onVisibilityChanged(boolean isVisible) {
if (isVisible) return;
TabImpl tabImpl = (TabImpl) mTabProvider.get();
if (tabImpl != null) {
mMediator.dismissIPH(tabImpl.getActivity());
}
}
/** /**
* Initialize the bottom toolbar with the components that had native initialization * Initialize the bottom toolbar with the components that had native initialization
* dependencies. * dependencies.
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
package org.chromium.chrome.browser.toolbar.bottom; package org.chromium.chrome.browser.toolbar.bottom;
import android.support.v7.app.AppCompatActivity;
import android.view.View; import android.view.View;
import androidx.annotation.ColorInt; import androidx.annotation.ColorInt;
...@@ -108,6 +109,14 @@ class BrowsingModeBottomToolbarMediator implements ThemeColorObserver { ...@@ -108,6 +109,14 @@ class BrowsingModeBottomToolbarMediator implements ThemeColorObserver {
anchor.postDelayed(() -> tracker.dismissed(feature), DUET_IPH_BUBBLE_SHOW_DURATION_MS); anchor.postDelayed(() -> tracker.dismissed(feature), DUET_IPH_BUBBLE_SHOW_DURATION_MS);
} }
/**
* Dismiss the IPH bubble for Chrome Duet.
* @param activity An activity to attach the IPH to.
*/
void dismissIPH(AppCompatActivity activity) {
FeatureHighlightProvider.getInstance().dismiss(activity);
}
/** /**
* Clean up anything that needs to be when the bottom toolbar is destroyed. * Clean up anything that needs to be when the bottom toolbar is destroyed.
*/ */
......
...@@ -63,4 +63,10 @@ public class FeatureHighlightProvider { ...@@ -63,4 +63,10 @@ public class FeatureHighlightProvider {
@TextAlignment int bodyAlignment, @StyleRes int bodyStyle, @ColorInt int pulseColor, @TextAlignment int bodyAlignment, @StyleRes int bodyStyle, @ColorInt int pulseColor,
@ColorInt int outerColor, @ColorInt int scrimColor, long timeoutMs, @ColorInt int outerColor, @ColorInt int scrimColor, long timeoutMs,
Runnable completeRunnable) {} Runnable completeRunnable) {}
/**
* Dismiss the feature highlight bubble for a particular view.
* @param activity An activity to attach the IPH to.
*/
public void dismiss(AppCompatActivity activity) {}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment