Commit 493b108e authored by Theresa's avatar Theresa Committed by Commit Bot

[EoC] Restrict EoC to ChromeTabbedActivity

Prevent the contextual suggestions bottom sheet from appearing in CCTs
and other sub-classes of ChromeActivity that aren't ChromeTabbedActivity.

BUG=823987

Change-Id: I56c4ccfbc30ae078668d39cd8252e74468ae4dd7
Reviewed-on: https://chromium-review.googlesource.com/1005497Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Commit-Queue: Theresa <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549592}
parent a831fdca
......@@ -1289,7 +1289,8 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
mCompositorViewHolder.getLayoutManager(), coordinator);
}
if (FeatureUtilities.isContextualSuggestionsBottomSheetEnabled(isTablet())) {
if (supportsContextualSuggestionsBottomSheet()
&& FeatureUtilities.isContextualSuggestionsBottomSheetEnabled(isTablet())) {
ViewGroup coordinator = (ViewGroup) findViewById(R.id.coordinator);
getLayoutInflater().inflate(R.layout.bottom_sheet, coordinator);
mBottomSheet = coordinator.findViewById(R.id.bottom_sheet);
......@@ -2280,6 +2281,13 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
return false;
}
/**
* @return Whether this Activity supports showing contextual suggestions in a bottom sheet.
*/
public boolean supportsContextualSuggestionsBottomSheet() {
return false;
}
/**
* @return the reference pool for this activity.
* @deprecated Use {@link ChromeApplication#getReferencePool} instead.
......
......@@ -2345,6 +2345,11 @@ public class ChromeTabbedActivity
return true;
}
@Override
public boolean supportsContextualSuggestionsBottomSheet() {
return true;
}
@Override
public void onScreenshotTaken() {
Tracker tracker = TrackerFactory.getTrackerForProfile(Profile.getLastUsedProfile());
......
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