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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/PlaceholderSheetContent.java

Issue 2892673002: [Home] Fix placeholder color for incognito (Closed)
Patch Set: Created 3 years, 7 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 | « chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetContentController.java ('k') | 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/widget/bottomsheet/PlaceholderSheetContent.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/PlaceholderSheetContent.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/PlaceholderSheetContent.java
index 551fab1bc678a801e7ea9e4638f584d97f0884eb..7a20a78a22481c1d1d65389387ed9840c3ac2de6 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/PlaceholderSheetContent.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/PlaceholderSheetContent.java
@@ -19,13 +19,29 @@ class PlaceholderSheetContent implements BottomSheet.BottomSheetContent {
/** The view that represents this placeholder. */
private View mView;
+ /** Whether or not the content is using incognito colors. */
+ private boolean mIsIncongitoThemed;
+
public PlaceholderSheetContent(Context context) {
mView = new View(context);
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
mView.setLayoutParams(params);
- mView.setBackgroundColor(ApiCompatibilityUtils.getColor(
- context.getResources(), R.color.default_primary_color));
+ setIsIncognito(false);
+ }
+
+ /**
+ * Set whether or not the placeholder content is being used in an incognito sheet. This affects
+ * the color used in the background.
+ * @param isIncognito Whether or not the sheet is incognito.
+ */
+ public void setIsIncognito(boolean isIncognito) {
+ mIsIncongitoThemed = isIncognito;
+
+ int colorId = isIncognito ? R.color.incognito_primary_color : R.color.default_primary_color;
+
+ mView.setBackgroundColor(
+ ApiCompatibilityUtils.getColor(mView.getContext().getResources(), colorId));
}
@Override
@@ -40,10 +56,16 @@ class PlaceholderSheetContent implements BottomSheet.BottomSheetContent {
@Override
public boolean isUsingLightToolbarTheme() {
+ // This value doesn't matter since this content does not provide a toolbar.
return false;
}
@Override
+ public boolean isIncognitoThemedContent() {
+ return mIsIncongitoThemed;
+ }
+
+ @Override
public int getVerticalScrollOffset() {
return 0;
}
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetContentController.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698