| Index: chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetContentController.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetContentController.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetContentController.java
|
| index 934766087ee965315b4879d9b43419e599f1ba4b..01c8a110f299c49ec0ae80451871338d6c161514 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetContentController.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetContentController.java
|
| @@ -132,9 +132,12 @@ public class BottomSheetContentController extends BottomNavigationView
|
| private boolean mDefaultContentInitialized;
|
| private ChromeActivity mActivity;
|
| private boolean mShouldOpenSheetOnNextContentChange;
|
| + private PlaceholderSheetContent mPlaceholderContent;
|
|
|
| public BottomSheetContentController(Context context, AttributeSet atts) {
|
| super(context, atts);
|
| +
|
| + mPlaceholderContent = new PlaceholderSheetContent(context);
|
| }
|
|
|
| /**
|
| @@ -155,6 +158,7 @@ public class BottomSheetContentController extends BottomNavigationView
|
| public void onTabModelSelected(TabModel newModel, TabModel oldModel) {
|
| updateVisuals(newModel.isIncognito());
|
| showBottomSheetContent(R.id.action_home);
|
| + mPlaceholderContent.setIsIncognito(newModel.isIncognito());
|
|
|
| // Release incognito bottom sheet content so that it can be garbage collected.
|
| if (!newModel.isIncognito()
|
| @@ -212,16 +216,14 @@ public class BottomSheetContentController extends BottomNavigationView
|
| * @param hasFocus Whether or not the omnibox has focus.
|
| */
|
| public void onOmniboxFocusChange(boolean hasFocus) {
|
| - BottomSheetContent placeHolder = getSheetContentForId(PLACEHOLDER_ID);
|
| -
|
| // If the omnibox is being focused, show the placeholder.
|
| if (hasFocus && mBottomSheet.getSheetState() != BottomSheet.SHEET_STATE_HALF
|
| && mBottomSheet.getSheetState() != BottomSheet.SHEET_STATE_FULL) {
|
| - mBottomSheet.showContent(placeHolder);
|
| + mBottomSheet.showContent(mPlaceholderContent);
|
| mBottomSheet.endTransitionAnimations();
|
| }
|
|
|
| - if (!hasFocus && mBottomSheet.getCurrentSheetContent() == placeHolder) {
|
| + if (!hasFocus && mBottomSheet.getCurrentSheetContent() == mPlaceholderContent) {
|
| showBottomSheetContent(R.id.action_home);
|
| }
|
| }
|
| @@ -276,8 +278,6 @@ public class BottomSheetContentController extends BottomNavigationView
|
| content = new HistorySheetContent(mActivity, mSnackbarManager);
|
| } else if (navItemId == INCOGNITO_HOME_ID) {
|
| content = new IncognitoBottomSheetContent(mActivity);
|
| - } else if (navItemId == PLACEHOLDER_ID) {
|
| - content = new PlaceholderSheetContent(getContext());
|
| }
|
|
|
| mBottomSheetContents.put(navItemId, content);
|
|
|