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

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

Issue 2741843003: [Home] Add more null checks for LayoutManagerChrome (Closed)
Patch Set: Created 3 years, 9 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/ChromeHomeNewTabPage.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/ChromeHomeNewTabPage.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/ChromeHomeNewTabPage.java
index 7d770e3d926987771108b10f35560b79015236f5..8517a18a64203cc4503dfe839972fd27bef2c417 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/ChromeHomeNewTabPage.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/ChromeHomeNewTabPage.java
@@ -188,7 +188,7 @@ public class ChromeHomeNewTabPage implements NativePage, TemplateUrlServiceObser
// OverviewModeBehavior, we have no good signal to show the BottomSheet when an NTP is
// selected in the tab switcher. Eventually this won't matter because we will not allow
// NTPs to remain open after the user leaves them.
- if (getLayoutManager().overviewVisible()) return;
+ if (getLayoutManager() != null && getLayoutManager().overviewVisible()) return;
mBottomSheet.setSheetState(BottomSheet.SHEET_STATE_HALF, true);
}
@@ -218,7 +218,9 @@ public class ChromeHomeNewTabPage implements NativePage, TemplateUrlServiceObser
@Override
public void onClick(View v) {
mBottomSheet.setSheetState(BottomSheet.SHEET_STATE_PEEK, true);
- if (mShowOverviewOnClose) getLayoutManager().showOverview(false);
+ if (mShowOverviewOnClose && getLayoutManager() != null) {
+ getLayoutManager().showOverview(false);
+ }
// Close the tab after showing the overview mode so the bottom sheet doesn't open
// if another NTP is selected when this one is closed.
« 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