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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/TabListSceneLayer.java

Issue 2045733002: Replace tab switcher borders with single asset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move var Created 4 years, 6 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/compositor/scene_layer/TabListSceneLayer.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/TabListSceneLayer.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/TabListSceneLayer.java
index d25354d8a4cb65ba65eaf56449931671b6933232..805d2d097af9a97f720051817fd23e6301b98b1f 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/TabListSceneLayer.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/TabListSceneLayer.java
@@ -58,17 +58,18 @@ public class TabListSceneLayer extends SceneLayer {
assert t.isVisible() : "LayoutTab in that list should be visible";
final float decoration = t.getDecorationAlpha();
- boolean isDarkTheme = t.isIncognito();
+ int defaultThemeColor = t.isIncognito()
+ ? ApiCompatibilityUtils.getColor(res, R.color.incognito_primary_color)
+ : ApiCompatibilityUtils.getColor(res, R.color.default_primary_color);
// If theme colors are enabled in the tab switcher, the theme might require lighter
// text.
+ boolean isDarkTheme = t.isIncognito();
if (FeatureUtilities.areTabSwitcherThemeColorsEnabled()) {
isDarkTheme |= ColorUtils.shoudUseLightForegroundOnBackground(
t.getToolbarBackgroundColor());
}
- int borderResource = t.isIncognito() ? R.drawable.tabswitcher_border_frame_incognito
- : R.drawable.tabswitcher_border_frame;
int closeBtnResource = isDarkTheme ? R.drawable.btn_tab_close_white_normal
: R.drawable.btn_tab_close_normal;
int borderColorResource =
@@ -77,7 +78,8 @@ public class TabListSceneLayer extends SceneLayer {
nativePutTabLayer(mNativePtr, t.getId(), R.id.control_container, closeBtnResource,
R.drawable.tabswitcher_border_frame_shadow,
R.drawable.tabswitcher_border_frame_decoration, R.drawable.logo_card_back,
- borderResource, R.drawable.tabswitcher_border_frame_inner_shadow,
+ R.drawable.tabswitcher_border_frame,
+ R.drawable.tabswitcher_border_frame_inner_shadow,
t.canUseLiveTexture(), t.getBackgroundColor(),
ApiCompatibilityUtils.getColor(res, borderColorResource), t.isIncognito(),
layout.getOrientation() == Orientation.PORTRAIT, t.getRenderX() * dpToPx,
@@ -93,10 +95,10 @@ public class TabListSceneLayer extends SceneLayer {
t.getShadowOpacity() * decoration, t.getBorderCloseButtonAlpha() * decoration,
LayoutTab.CLOSE_BUTTON_WIDTH_DP * dpToPx, t.getStaticToViewBlend(),
t.getBorderScale(), t.getSaturation(), t.getBrightness(), t.showToolbar(),
- t.getToolbarBackgroundColor(), t.anonymizeToolbar(), R.drawable.textbox,
- t.getTextBoxBackgroundColor(), t.getTextBoxAlpha(), t.getToolbarAlpha(),
- t.getToolbarYOffset() * dpToPx, t.getSideBorderScale(), true,
- t.insetBorderVertical());
+ defaultThemeColor, t.getToolbarBackgroundColor(), t.anonymizeToolbar(),
+ R.drawable.textbox, t.getTextBoxBackgroundColor(), t.getTextBoxAlpha(),
+ t.getToolbarAlpha(), t.getToolbarYOffset() * dpToPx, t.getSideBorderScale(),
+ true, t.insetBorderVertical());
}
nativeFinishBuildingFrame(mNativePtr);
}
@@ -143,8 +145,9 @@ public class TabListSceneLayer extends SceneLayer {
float pivotY, float rotationX, float rotationY, float alpha, float borderAlpha,
float borderInnerShadowAlpha, float contourAlpha, float shadowAlpha, float closeAlpha,
float closeBtnWidth, float staticToViewBlend, float borderScale, float saturation,
- float brightness, boolean showToolbar, int toolbarBackgroundColor,
- boolean anonymizeToolbar, int toolbarTextBoxResource, int toolbarTextBoxBackgroundColor,
- float toolbarTextBoxAlpha, float toolbarAlpha, float toolbarYOffset,
- float sideBorderScale, boolean attachContent, boolean insetVerticalBorder);
+ float brightness, boolean showToolbar, int defaultThemeColor,
+ int toolbarBackgroundColor, boolean anonymizeToolbar, int toolbarTextBoxResource,
+ int toolbarTextBoxBackgroundColor, float toolbarTextBoxAlpha, float toolbarAlpha,
+ float toolbarYOffset, float sideBorderScale, boolean attachContent,
+ boolean insetVerticalBorder);
}

Powered by Google App Engine
This is Rietveld 408576698