| Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/ChromeHomeNewTabPageBase.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/ChromeHomeNewTabPageBase.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/ChromeHomeNewTabPageBase.java
|
| index 4515d9746faf7addecc195bb992be1ad7de7410d..3cbd1643a04caf4d09eae5ba5c5eb2b3a2c1c27d 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/ChromeHomeNewTabPageBase.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/ChromeHomeNewTabPageBase.java
|
| @@ -36,7 +36,6 @@ public abstract class ChromeHomeNewTabPageBase implements NativePage {
|
| @Nullable
|
| final LayoutManagerChrome mLayoutManager;
|
| final BottomSheet mBottomSheet;
|
| - final View mFadingBackgroundView;
|
| final String mTitle;
|
|
|
| private boolean mShowOverviewOnClose;
|
| @@ -57,7 +56,6 @@ public abstract class ChromeHomeNewTabPageBase implements NativePage {
|
| mTab = tab;
|
| mTabModelSelector = tabModelSelector;
|
| mLayoutManager = layoutManager;
|
| - mFadingBackgroundView = mTab.getActivity().getFadingBackgroundView();
|
| mBottomSheet = mTab.getActivity().getBottomSheet();
|
| mTitle = context.getResources().getString(R.string.button_new_tab);
|
|
|
| @@ -87,7 +85,7 @@ public abstract class ChromeHomeNewTabPageBase implements NativePage {
|
|
|
| @Override
|
| public void onHidden(Tab tab) {
|
| - mFadingBackgroundView.setEnabled(true);
|
| + mTab.getActivity().getFadingBackgroundView().setEnabled(true);
|
| if (!mTab.isClosing()) mShowOverviewOnClose = false;
|
| }
|
| };
|
| @@ -130,7 +128,7 @@ public abstract class ChromeHomeNewTabPageBase implements NativePage {
|
| public void destroy() {
|
| // The next tab will be selected before this one is destroyed. If the currently selected
|
| // tab is a Chrome Home new tab page, the FadingBackgroundView should not be enabled.
|
| - mFadingBackgroundView.setEnabled(
|
| + mTab.getActivity().getFadingBackgroundView().setEnabled(
|
| !isTabChromeHomeNewTabPage(mTabModelSelector.getCurrentTab()));
|
|
|
| if (mLayoutManager != null) {
|
| @@ -140,7 +138,9 @@ public abstract class ChromeHomeNewTabPageBase implements NativePage {
|
| }
|
|
|
| private void onNewTabPageShown() {
|
| - mFadingBackgroundView.setEnabled(false);
|
| + if (mTab.getActivity().getFadingBackgroundView() != null) {
|
| + mTab.getActivity().getFadingBackgroundView().setEnabled(false);
|
| + }
|
|
|
| // This method may be called when an NTP is selected due to the user switching tab models.
|
| // In this case, we do not want the bottom sheet to open. Unfortunately, without observing
|
|
|