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

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

Issue 1812293002: Add new NTP layout with snippet cards and hide it behind a flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase + CR comments + added background color to new NTP Created 4 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
Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
index dd5c437b371f3beb5b8acb58a6e6eaf22b6f577b..7c87217dde729ede67a4c08bbf5e644538f94371 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
@@ -246,7 +246,8 @@ public class NewTabPage
@Override
public boolean isToolbarEnabled() {
- return ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_TOOLBAR);
+ return ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_TOOLBAR)
+ && !ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_SNIPPETS);
}
private void recordOpenedMostVisitedItem(MostVisitedItem item) {
@@ -565,7 +566,9 @@ public class NewTabPage
mProfile = tab.getProfile();
mTitle = activity.getResources().getString(R.string.button_new_tab);
- mBackgroundColor = ApiCompatibilityUtils.getColor(activity.getResources(), R.color.ntp_bg);
+ mBackgroundColor = ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_SNIPPETS)
+ ? ApiCompatibilityUtils.getColor(activity.getResources(), R.color.ntp_with_cards_bg)
+ : ApiCompatibilityUtils.getColor(activity.getResources(), R.color.ntp_bg);
mThemeColor = ApiCompatibilityUtils.getColor(
activity.getResources(), R.color.default_primary_color);
TemplateUrlService.getInstance().addObserver(this);
@@ -657,13 +660,8 @@ public class NewTabPage
}
private void updateSearchProviderHasLogo() {
- if (ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_SNIPPETS)) {
- mSearchProviderHasLogo = false;
- if (mNewTabPageView != null) mNewTabPageView.setSearchProviderHasLogo(false);
- } else {
- mSearchProviderHasLogo = !mOptOutPromoShown
- && TemplateUrlService.getInstance().isDefaultSearchEngineGoogle();
- }
+ mSearchProviderHasLogo = !mOptOutPromoShown
+ && TemplateUrlService.getInstance().isDefaultSearchEngineGoogle();
}
private void onSearchEngineUpdated() {

Powered by Google App Engine
This is Rietveld 408576698