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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerDocument.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/layouts/LayoutManagerDocument.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerDocument.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerDocument.java
index 6794f2b1f86eb1063cbf2ea8889bab265971f2bb..99fbef5e33ffc8318bb2e38855f8333a622fd458 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerDocument.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerDocument.java
@@ -133,6 +133,8 @@ public class LayoutManagerDocument extends LayoutManager
// Initialize Layouts
mStaticLayout.setTabModelSelector(selector, content);
+ mToolbarOverlay.setTabModelSelector(selector);
+
// Initialize Contextual Search Panel
mContextualSearchPanel.setManagementDelegate(contextualSearchDelegate);
@@ -260,10 +262,13 @@ public class LayoutManagerDocument extends LayoutManager
String url = tab.getUrl();
boolean isNativePage = url != null && url.startsWith(UrlConstants.CHROME_NATIVE_SCHEME);
int themeColor = tab.getThemeColor();
+ boolean needsToolbarShadow = tab.getNativePage() == null
+ ? true : tab.getNativePage().needsToolbarShadow();
boolean canUseLiveTexture =
tab.getContentViewCore() != null && !tab.isShowingSadTab() && !isNativePage;
- boolean needsUpdate = layoutTab.initFromHost(tab.getBackgroundColor(), tab.shouldStall(),
- canUseLiveTexture, themeColor, ColorUtils.getTextBoxColorForToolbarBackground(
+ boolean needsUpdate = layoutTab.initFromHost(needsToolbarShadow, tab.getBackgroundColor(),
+ tab.shouldStall(), canUseLiveTexture, themeColor,
+ ColorUtils.getTextBoxColorForToolbarBackground(
mContext.getResources(), tab, themeColor),
ColorUtils.getTextBoxAlphaForToolbarBackground(tab));
if (needsUpdate) requestUpdate();
@@ -276,7 +281,10 @@ public class LayoutManagerDocument extends LayoutManager
boolean isTitleNeeded, float maxContentWidth, float maxContentHeight) {
LayoutTab tab = mTabCache.get(id);
if (tab == null) {
- tab = new LayoutTab(id, incognito, mLastContentWidthDp, mLastContentHeightDp,
+ boolean isNative = false;
+ Tab realTab = getTabModelSelector().getTabById(id);
+ if (realTab != null) isNative = realTab.isNativePage();
+ tab = new LayoutTab(id, incognito, isNative, mLastContentWidthDp, mLastContentHeightDp,
showCloseButton, isTitleNeeded);
mTabCache.put(id, tab);
} else {

Powered by Google App Engine
This is Rietveld 408576698