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

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

Issue 2228823003: When possible, draw the toolbar shadow with the compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 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 6415820c0f4fc388a036f13d87e208498b4bc16f..0938b0feae3fd0500aa698b9fc9b7a4239890d83 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
@@ -73,8 +73,14 @@ public class TabListSceneLayer extends SceneLayer {
int borderColorResource =
t.isIncognito() ? R.color.tab_back_incognito : R.color.tab_back;
+
+ // Do not show the toolbar shadow if exiting the tab switcher to a native page.
+ boolean needsToolbarShadow =
+ t.needsToolbarShadow() || (t.isNativePage() && t.getToolbarAlpha() < 1.0f);
+
// TODO(dtrainor, clholgat): remove "* dpToPx" once the native part fully supports dp.
nativePutTabLayer(mNativePtr, t.getId(), R.id.control_container,
+ R.drawable.toolbar_shadow,
R.drawable.btn_tab_close,
R.drawable.tabswitcher_border_frame_shadow,
R.drawable.tabswitcher_border_frame_decoration, R.drawable.logo_card_back,
@@ -98,7 +104,7 @@ public class TabListSceneLayer extends SceneLayer {
defaultThemeColor, t.getToolbarBackgroundColor(), closeButtonColor,
t.anonymizeToolbar(), R.drawable.textbox, t.getTextBoxBackgroundColor(),
t.getTextBoxAlpha(), t.getToolbarAlpha(), t.getToolbarYOffset() * dpToPx,
- t.getSideBorderScale(), true, t.insetBorderVertical());
+ t.getSideBorderScale(), true, t.insetBorderVertical(), needsToolbarShadow);
}
nativeFinishBuildingFrame(mNativePtr);
}
@@ -136,7 +142,8 @@ public class TabListSceneLayer extends SceneLayer {
LayerTitleCache layerTitleCache, TabContentManager tabContentManager,
ResourceManager resourceManager);
private native void nativePutTabLayer(long nativeTabListSceneLayer, int id,
- int toolbarResourceId, int closeButtonResourceId, int shadowResourceId,
+ int toolbarResourceId, int toolbarShadowResourceId,
+ int closeButtonResourceId, int shadowResourceId,
int contourResourceId, int backLogoResourceId, int borderResourceId,
int borderInnerShadowResourceId, boolean canUseLiveLayer, int tabBackgroundColor,
int backLogoColor, boolean incognito, boolean isPortrait, float x, float y, float width,
@@ -149,5 +156,6 @@ public class TabListSceneLayer extends SceneLayer {
int toolbarBackgroundColor, int closeButtonColor, boolean anonymizeToolbar,
int toolbarTextBoxResource, int toolbarTextBoxBackgroundColor,
float toolbarTextBoxAlpha, float toolbarAlpha, float toolbarYOffset,
- float sideBorderScale, boolean attachContent, boolean insetVerticalBorder);
+ float sideBorderScale, boolean attachContent, boolean insetVerticalBorder,
+ boolean needsToolbarShadow);
}

Powered by Google App Engine
This is Rietveld 408576698