Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3901)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/ChromeHomeNewTabPageBase.java

Issue 2850623003: [Home] Don't cache FadingBackgroundView (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698