Commit d9981360 authored by gogerald's avatar gogerald Committed by Commit Bot

[StartSurface] Do not show start home page on tablet

Bug: 1045018
Change-Id: I7be550116de433e73fc8c61001110edca9f8e594
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2017045Reviewed-by: default avatarWei-Yin Chen (陳威尹) <wychen@chromium.org>
Commit-Queue: Ganggui Tang <gogerald@chromium.org>
Cr-Commit-Position: refs/heads/master@{#734542}
parent 834e78e6
...@@ -10,6 +10,7 @@ import android.text.TextUtils; ...@@ -10,6 +10,7 @@ import android.text.TextUtils;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
import org.chromium.base.ApplicationStatus; import org.chromium.base.ApplicationStatus;
import org.chromium.base.ContextUtils;
import org.chromium.base.Log; import org.chromium.base.Log;
import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.metrics.RecordHistogram;
import org.chromium.base.metrics.RecordUserAction; import org.chromium.base.metrics.RecordUserAction;
...@@ -23,6 +24,7 @@ import org.chromium.chrome.browser.tab.TabLaunchType; ...@@ -23,6 +24,7 @@ import org.chromium.chrome.browser.tab.TabLaunchType;
import org.chromium.chrome.browser.tabmodel.TabModel; import org.chromium.chrome.browser.tabmodel.TabModel;
import org.chromium.chrome.browser.util.AccessibilityUtil; import org.chromium.chrome.browser.util.AccessibilityUtil;
import org.chromium.content_public.browser.LoadUrlParams; import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.ui.base.DeviceFormFactor;
import org.chromium.ui.base.PageTransition; import org.chromium.ui.base.PageTransition;
/** /**
...@@ -182,10 +184,12 @@ public final class ReturnToChromeExperimentsUtil { ...@@ -182,10 +184,12 @@ public final class ReturnToChromeExperimentsUtil {
*/ */
public static boolean shouldShowStartSurfaceAsTheHomePage() { public static boolean shouldShowStartSurfaceAsTheHomePage() {
// Note that we should only show StartSurface as the HomePage if Single Pane is enabled, // Note that we should only show StartSurface as the HomePage if Single Pane is enabled,
// HomePage is not customized and accessibility is not enabled. // HomePage is not customized, accessibility is not enabled and not on tablet.
String homePageUrl = HomepageManager.getHomepageUri(); String homePageUrl = HomepageManager.getHomepageUri();
return FeatureUtilities.isStartSurfaceSinglePaneEnabled() return FeatureUtilities.isStartSurfaceSinglePaneEnabled()
&& (TextUtils.isEmpty(homePageUrl) || NewTabPage.isNTPUrl(homePageUrl)) && (TextUtils.isEmpty(homePageUrl) || NewTabPage.isNTPUrl(homePageUrl))
&& !AccessibilityUtil.isAccessibilityEnabled(); && !AccessibilityUtil.isAccessibilityEnabled()
&& !DeviceFormFactor.isNonMultiDisplayContextOnTablet(
ContextUtils.getApplicationContext());
} }
} }
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