Commit 22cb3f63 authored by Donn Denman's avatar Donn Denman Committed by Commit Bot

[TTS][Overlay] Round the corners on the Bar, etc.

Uses the existing 9-patch image from the Bottom Sheet for the Preview Tab
Overlay Panel and Tap to Search as well.

Increases the Bar height slightly, and makes the height no longer
variable (was needed for the promo-in-the-bar).

BUG=961454

Change-Id: I9edfef49ce2c37c4ad8bfd8a5dc67f5128dae93c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1606582
Commit-Queue: Donn Denman <donnd@chromium.org>
Auto-Submit: Donn Denman <donnd@chromium.org>
Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Reviewed-by: default avatarJinsuk Kim <jinsukkim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#690044}
parent c2027249
...@@ -106,6 +106,7 @@ ...@@ -106,6 +106,7 @@
<!-- Overlay Panel colors --> <!-- Overlay Panel colors -->
<color name="overlay_panel_bar_background_color">@color/default_bg_color_elev_2</color> <color name="overlay_panel_bar_background_color">@color/default_bg_color_elev_2</color>
<color name="overlay_panel_separator_line_color">@color/modern_secondary_color</color>
<!-- Contextual Search colors --> <!-- Contextual Search colors -->
<color name="contextual_search_promo_background_color">@color/default_bg_color_elev_0</color> <color name="contextual_search_promo_background_color">@color/default_bg_color_elev_0</color>
......
...@@ -137,7 +137,8 @@ ...@@ -137,7 +137,8 @@
<dimen name="contextual_search_bubble_y_inset">-3dp</dimen> <dimen name="contextual_search_bubble_y_inset">-3dp</dimen>
<!-- Overlay panel dimensions --> <!-- Overlay panel dimensions -->
<dimen name="overlay_panel_bar_height">56dp</dimen> <dimen name="overlay_panel_bar_height_legacy">56dp</dimen>
<dimen name="overlay_panel_bar_height">60dp</dimen>
<!-- Autofill keyboard accessory dimensions --> <!-- Autofill keyboard accessory dimensions -->
<dimen name="keyboard_accessory_height_with_shadow">56dp</dimen> <dimen name="keyboard_accessory_height_with_shadow">56dp</dimen>
......
...@@ -110,15 +110,6 @@ abstract class OverlayPanelBase { ...@@ -110,15 +110,6 @@ abstract class OverlayPanelBase {
/** The height of the Toolbar in dps. */ /** The height of the Toolbar in dps. */
private float mToolbarHeight; private float mToolbarHeight;
/** The height of the Bar when the Panel is peeking, in dps. */
private final float mBarHeightPeeking;
/** The height of the Bar when the Panel is expanded, in dps. */
private final float mBarHeightExpanded;
/** The height of the Bar when the Panel is maximized, in dps. */
private final float mBarHeightMaximized;
/** The background color of the Bar. */ /** The background color of the Bar. */
private final @ColorInt int mBarBackgroundColor; private final @ColorInt int mBarBackgroundColor;
...@@ -154,18 +145,14 @@ abstract class OverlayPanelBase { ...@@ -154,18 +145,14 @@ abstract class OverlayPanelBase {
mContext = context; mContext = context;
mPxToDp = 1.f / mContext.getResources().getDisplayMetrics().density; mPxToDp = 1.f / mContext.getResources().getDisplayMetrics().density;
mBarHeightPeeking =
mContext.getResources().getDimension(R.dimen.overlay_panel_bar_height) * mPxToDp;
mBarHeightMaximized =
mContext.getResources().getDimension(R.dimen.toolbar_height_no_shadow) * mPxToDp;
mBarHeightExpanded = Math.round((mBarHeightPeeking + mBarHeightMaximized) / 2.f);
mBarMarginSide = BAR_ICON_SIDE_PADDING_DP; mBarMarginSide = BAR_ICON_SIDE_PADDING_DP;
mBarMarginTop = BAR_ICON_TOP_PADDING_DP; mBarMarginTop = BAR_ICON_TOP_PADDING_DP;
mProgressBarHeight = PROGRESS_BAR_HEIGHT_DP; mProgressBarHeight = PROGRESS_BAR_HEIGHT_DP;
mBarBorderHeight = BAR_BORDER_HEIGHT_DP; mBarBorderHeight = BAR_BORDER_HEIGHT_DP;
mBarHeight = mBarHeightPeeking; int bar_height_dimen = isNewLayout() ? R.dimen.overlay_panel_bar_height
: R.dimen.overlay_panel_bar_height_legacy;
mBarHeight = mContext.getResources().getDimension(bar_height_dimen) * mPxToDp;
final Resources resources = mContext.getResources(); final Resources resources = mContext.getResources();
mBarBackgroundColor = ApiCompatibilityUtils.getColor( mBarBackgroundColor = ApiCompatibilityUtils.getColor(
...@@ -175,6 +162,8 @@ abstract class OverlayPanelBase { ...@@ -175,6 +162,8 @@ abstract class OverlayPanelBase {
ApiCompatibilityUtils.getColor(resources, R.color.drag_handlebar_color); ApiCompatibilityUtils.getColor(resources, R.color.drag_handlebar_color);
mButtonPaddingDps = mButtonPaddingDps =
(int) (mPxToDp * resources.getDimension(R.dimen.overlay_panel_button_padding)); (int) (mPxToDp * resources.getDimension(R.dimen.overlay_panel_button_padding));
mBarShadowVisible = true;
mPanelShadowVisible = !isNewLayout();
} }
// ============================================================================================ // ============================================================================================
...@@ -356,20 +345,22 @@ abstract class OverlayPanelBase { ...@@ -356,20 +345,22 @@ abstract class OverlayPanelBase {
return getBarHeight(); return getBarHeight();
} }
/** /** @return The width of the Overlay Panel Content View in pixels. */
* @return The width of the Overlay Panel Content View in pixels.
*/
public int getContentViewWidthPx() { public int getContentViewWidthPx() {
return getMaximumWidthPx(); return getMaximumWidthPx();
} }
/** /** @return The height of the Overlay Panel Content View in pixels. */
* @return The height of the Overlay Panel Content View in pixels.
*/
public int getContentViewHeightPx() { public int getContentViewHeightPx() {
return Math.round(mMaximumHeight / mPxToDp); return Math.round(mMaximumHeight / mPxToDp);
} }
/** @return Whether we're using the new Overlay layout feature. */
private boolean isNewLayout() {
return ChromeFeatureList.isInitialized()
&& ChromeFeatureList.isEnabled(ChromeFeatureList.OVERLAY_NEW_LAYOUT);
}
// ============================================================================================ // ============================================================================================
// UI States // UI States
// ============================================================================================ // ============================================================================================
...@@ -423,13 +414,13 @@ abstract class OverlayPanelBase { ...@@ -423,13 +414,13 @@ abstract class OverlayPanelBase {
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------
private final float mBarMarginSide; private final float mBarMarginSide;
private final float mBarMarginTop; private final float mBarMarginTop;
private final boolean mBarShadowVisible;
private final boolean mPanelShadowVisible;
private float mBarHeight; private float mBarHeight;
private boolean mIsBarBorderVisible; private boolean mIsBarBorderVisible;
private float mBarBorderHeight; private float mBarBorderHeight;
private boolean mBarShadowVisible;
private float mBarShadowOpacity;
private float mArrowIconOpacity; private float mArrowIconOpacity;
private float mCloseIconOpacity; private float mCloseIconOpacity;
...@@ -473,24 +464,24 @@ abstract class OverlayPanelBase { ...@@ -473,24 +464,24 @@ abstract class OverlayPanelBase {
} }
/** /**
* @return Whether the Bar shadow is visible. * @return Whether the Bar shadow is visible (between the Bar and content).
*/ */
public boolean getBarShadowVisible() { public boolean getBarShadowVisible() {
return mBarShadowVisible; return mBarShadowVisible;
} }
/** /**
* @return The opacity of the Bar shadow. * @return The background color of the Bar.
*/ */
public float getBarShadowOpacity() { public int getBarBackgroundColor() {
return mBarShadowOpacity; return mBarBackgroundColor;
} }
/** /**
* @return The background color of the Bar. * @return Whether the shadow for the entire Panel & Bar is visible.
*/ */
public int getBarBackgroundColor() { public boolean getPanelShadowVisible() {
return mBarBackgroundColor; return mPanelShadowVisible;
} }
/** /**
...@@ -507,13 +498,17 @@ abstract class OverlayPanelBase { ...@@ -507,13 +498,17 @@ abstract class OverlayPanelBase {
return mDragHandlebarColor; return mDragHandlebarColor;
} }
/** @return the color to use to draw the separator between the Bar and Content. */
public int getSeparatorLineColor() {
return ApiCompatibilityUtils.getColor(
mContext.getResources(), R.color.overlay_panel_separator_line_color);
}
/** /**
* @return The opacity of the arrow icon. * @return The opacity of the arrow icon.
*/ */
public float getArrowIconOpacity() { public float getArrowIconOpacity() {
return ChromeFeatureList.isEnabled(ChromeFeatureList.OVERLAY_NEW_LAYOUT) return isNewLayout() ? ARROW_ICON_OPACITY_TRANSPARENT : mArrowIconOpacity;
? ARROW_ICON_OPACITY_TRANSPARENT
: mArrowIconOpacity;
} }
/** /**
...@@ -760,7 +755,7 @@ abstract class OverlayPanelBase { ...@@ -760,7 +755,7 @@ abstract class OverlayPanelBase {
* @return The peeked height of the panel in dps. * @return The peeked height of the panel in dps.
*/ */
protected float getPeekedHeight() { protected float getPeekedHeight() {
return mBarHeightPeeking; return getBarHeight();
} }
/** /**
...@@ -821,7 +816,8 @@ abstract class OverlayPanelBase { ...@@ -821,7 +816,8 @@ abstract class OverlayPanelBase {
int nextState = PanelState.UNDEFINED; int nextState = PanelState.UNDEFINED;
@PanelState @PanelState
int prevState = nextState; int prevState = nextState;
for (@PanelState int state = 0; state < PanelState.NUM_ENTRIES; state++) { for (@PanelState int state = PanelState.UNDEFINED; state < PanelState.NUM_ENTRIES;
state++) {
if (!isValidUiState(state)) continue; if (!isValidUiState(state)) continue;
prevState = nextState; prevState = nextState;
nextState = state; nextState = state;
...@@ -935,7 +931,8 @@ abstract class OverlayPanelBase { ...@@ -935,7 +931,8 @@ abstract class OverlayPanelBase {
// Iterate over all states and find the largest one which is being // Iterate over all states and find the largest one which is being
// transitioned to/from. // transitioned to/from.
for (@PanelState int state = 0; state < PanelState.NUM_ENTRIES; state++) { for (@PanelState int state = PanelState.UNDEFINED; state < PanelState.NUM_ENTRIES;
state++) {
if (!isValidUiState(state)) continue; if (!isValidUiState(state)) continue;
if (panelHeight <= getPanelHeightFromState(state)) { if (panelHeight <= getPanelHeightFromState(state)) {
stateFound = state; stateFound = state;
...@@ -986,9 +983,6 @@ abstract class OverlayPanelBase { ...@@ -986,9 +983,6 @@ abstract class OverlayPanelBase {
// Base page brightness. // Base page brightness.
mBasePageBrightness = BASE_PAGE_BRIGHTNESS_STATE_PEEKED; mBasePageBrightness = BASE_PAGE_BRIGHTNESS_STATE_PEEKED;
// Bar height.
mBarHeight = mBarHeightPeeking;
// Bar border. // Bar border.
mIsBarBorderVisible = false; mIsBarBorderVisible = false;
...@@ -1000,9 +994,6 @@ abstract class OverlayPanelBase { ...@@ -1000,9 +994,6 @@ abstract class OverlayPanelBase {
// Progress Bar. // Progress Bar.
mProgressBarOpacity = 0.f; mProgressBarOpacity = 0.f;
// Update the Bar Shadow.
updateBarShadow();
} }
/** /**
...@@ -1028,12 +1019,6 @@ abstract class OverlayPanelBase { ...@@ -1028,12 +1019,6 @@ abstract class OverlayPanelBase {
BASE_PAGE_BRIGHTNESS_STATE_EXPANDED, BASE_PAGE_BRIGHTNESS_STATE_EXPANDED,
percentage); percentage);
// Bar height.
mBarHeight = Math.round(MathUtils.interpolate(
mBarHeightPeeking,
getBarHeightExpanded(),
percentage));
// Bar border. // Bar border.
mIsBarBorderVisible = true; mIsBarBorderVisible = true;
...@@ -1062,9 +1047,6 @@ abstract class OverlayPanelBase { ...@@ -1062,9 +1047,6 @@ abstract class OverlayPanelBase {
// Fades the Progress Bar the closer it gets to the bottom of the // Fades the Progress Bar the closer it gets to the bottom of the
// screen. // screen.
mProgressBarOpacity = MathUtils.interpolate(0.f, 1.f, diff / threshold); mProgressBarOpacity = MathUtils.interpolate(0.f, 1.f, diff / threshold);
// Update the Bar Shadow.
updateBarShadow();
} }
/** /**
...@@ -1091,14 +1073,6 @@ abstract class OverlayPanelBase { ...@@ -1091,14 +1073,6 @@ abstract class OverlayPanelBase {
BASE_PAGE_BRIGHTNESS_STATE_MAXIMIZED, BASE_PAGE_BRIGHTNESS_STATE_MAXIMIZED,
percentage); percentage);
// Bar height.
float startBarHeight = supportsExpandedState
? getBarHeightExpanded() : getBarHeightPeeking();
mBarHeight = Math.round(MathUtils.interpolate(
startBarHeight,
getBarHeightMaximized(),
percentage));
// Bar border. // Bar border.
mIsBarBorderVisible = true; mIsBarBorderVisible = true;
...@@ -1110,9 +1084,6 @@ abstract class OverlayPanelBase { ...@@ -1110,9 +1084,6 @@ abstract class OverlayPanelBase {
// Progress Bar. // Progress Bar.
mProgressBarOpacity = 1.f; mProgressBarOpacity = 1.f;
// Update the Bar Shadow.
updateBarShadow();
} }
/** Updates the Status Bar. */ /** Updates the Status Bar. */
...@@ -1128,43 +1099,6 @@ abstract class OverlayPanelBase { ...@@ -1128,43 +1099,6 @@ abstract class OverlayPanelBase {
return BASE_PAGE_BRIGHTNESS_STATE_MAXIMIZED; return BASE_PAGE_BRIGHTNESS_STATE_MAXIMIZED;
} }
private float getBarHeightExpanded() {
return isFullWidthSizePanel() ? mBarHeightExpanded : mBarHeightPeeking;
}
private float getBarHeightMaximized() {
return isFullWidthSizePanel() ? mBarHeightMaximized : mBarHeightPeeking;
}
/**
* @return The peeking height of the panel's bar in dp.
*/
protected float getBarHeightPeeking() {
return mBarHeightPeeking;
}
/**
* Updates the UI state for Bar Shadow.
*/
protected void updateBarShadow() {
float barShadowOpacity = calculateBarShadowOpacity();
if (barShadowOpacity > 0.f) {
mBarShadowVisible = true;
mBarShadowOpacity = barShadowOpacity;
} else {
mBarShadowVisible = false;
mBarShadowOpacity = 0.f;
}
}
/**
* @return The new opacity value for the Bar Shadow.
*/
protected float calculateBarShadowOpacity() {
return 0.f;
}
// ============================================================================================ // ============================================================================================
// Base Page Offset // Base Page Offset
// ============================================================================================ // ============================================================================================
......
...@@ -27,7 +27,6 @@ import org.chromium.chrome.browser.contextualsearch.ContextualSearchFieldTrial; ...@@ -27,7 +27,6 @@ import org.chromium.chrome.browser.contextualsearch.ContextualSearchFieldTrial;
import org.chromium.chrome.browser.contextualsearch.ContextualSearchManagementDelegate; import org.chromium.chrome.browser.contextualsearch.ContextualSearchManagementDelegate;
import org.chromium.chrome.browser.contextualsearch.ResolvedSearchTerm.CardTag; import org.chromium.chrome.browser.contextualsearch.ResolvedSearchTerm.CardTag;
import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.util.MathUtils;
import org.chromium.chrome.browser.widget.ScrimView; import org.chromium.chrome.browser.widget.ScrimView;
import org.chromium.chrome.browser.widget.ScrimView.ScrimParams; import org.chromium.chrome.browser.widget.ScrimView.ScrimParams;
import org.chromium.ui.base.LocalizationUtils; import org.chromium.ui.base.LocalizationUtils;
...@@ -195,15 +194,6 @@ public class ContextualSearchPanel extends OverlayPanel { ...@@ -195,15 +194,6 @@ public class ContextualSearchPanel extends OverlayPanel {
return canDisplayContentInPanel() || state != PanelState.MAXIMIZED; return canDisplayContentInPanel() || state != PanelState.MAXIMIZED;
} }
@Override
protected float getExpandedHeight() {
if (canDisplayContentInPanel()) {
return super.getExpandedHeight();
} else {
return getBarHeightPeeking() + getPromoHeightPx() * mPxToDp;
}
}
@Override @Override
protected @PanelState int getProjectedState(float velocity) { protected @PanelState int getProjectedState(float velocity) {
@PanelState @PanelState
...@@ -374,18 +364,7 @@ public class ContextualSearchPanel extends OverlayPanel { ...@@ -374,18 +364,7 @@ public class ContextualSearchPanel extends OverlayPanel {
@Override @Override
protected float getPeekedHeight() { protected float getPeekedHeight() {
return getBarHeightPeeking() + getBarBannerControl().getHeightPeekingPx() * mPxToDp; return getBarHeight() + getBarBannerControl().getHeightPeekingPx() * mPxToDp;
}
@Override
protected float calculateBarShadowOpacity() {
float barShadowOpacity = 0.f;
if (getPromoHeightPx() > 0.f) {
float threshold = 2 * mBarShadowHeightPx;
barShadowOpacity = getPromoHeightPx() > mBarShadowHeightPx ? 1.f
: MathUtils.interpolate(0.f, 1.f, getPromoHeightPx() / threshold);
}
return barShadowOpacity;
} }
@Override @Override
...@@ -890,6 +869,7 @@ public class ContextualSearchPanel extends OverlayPanel { ...@@ -890,6 +869,7 @@ public class ContextualSearchPanel extends OverlayPanel {
} }
/** /**
* TODO(donnd): get rid of this promo stuff, no longer used.
* @return An implementation of {@link ContextualSearchPromoHost}. * @return An implementation of {@link ContextualSearchPromoHost}.
*/ */
private ContextualSearchPromoHost getContextualSearchPromoHost() { private ContextualSearchPromoHost getContextualSearchPromoHost() {
...@@ -909,9 +889,7 @@ public class ContextualSearchPanel extends OverlayPanel { ...@@ -909,9 +889,7 @@ public class ContextualSearchPanel extends OverlayPanel {
} }
@Override @Override
public void onUpdatePromoAppearance() { public void onUpdatePromoAppearance() {}
ContextualSearchPanel.this.updateBarShadow();
}
}; };
} }
......
...@@ -193,7 +193,7 @@ public class EphemeralTabPanel extends OverlayPanel { ...@@ -193,7 +193,7 @@ public class EphemeralTabPanel extends OverlayPanel {
@Override @Override
protected float getPeekedHeight() { protected float getPeekedHeight() {
return getBarHeightPeeking() * 1.5f; return getBarHeight() * 1.5f;
} }
@Override @Override
......
...@@ -113,7 +113,6 @@ public class ContextualSearchSceneLayer extends SceneOverlayLayer { ...@@ -113,7 +113,6 @@ public class ContextualSearchSceneLayer extends SceneOverlayLayer {
float searchBarBorderHeight = panel.getBarBorderHeight(); float searchBarBorderHeight = panel.getBarBorderHeight();
boolean searchBarShadowVisible = panel.getBarShadowVisible(); boolean searchBarShadowVisible = panel.getBarShadowVisible();
float searchBarShadowOpacity = panel.getBarShadowOpacity();
final int iconColor = panel.getIconColor(); final int iconColor = panel.getIconColor();
final int dragHandlebarColor = panel.getDragHandlebarColor(); final int dragHandlebarColor = panel.getDragHandlebarColor();
...@@ -141,7 +140,16 @@ public class ContextualSearchSceneLayer extends SceneOverlayLayer { ...@@ -141,7 +140,16 @@ public class ContextualSearchSceneLayer extends SceneOverlayLayer {
WebContents panelWebContents = panel.getWebContents(); WebContents panelWebContents = panel.getWebContents();
nativeUpdateContextualSearchLayer(mNativePtr, R.drawable.contextual_search_bar_background, int roundedBarTopResourceId =
ChromeFeatureList.isEnabled(ChromeFeatureList.OVERLAY_NEW_LAYOUT)
? R.drawable.top_round
: INVALID_RESOURCE_ID;
int separatorLineColor = panel.getSeparatorLineColor();
int panelShadowResourceId = panel.getPanelShadowVisible()
? R.drawable.contextual_search_bar_background
: INVALID_RESOURCE_ID;
nativeUpdateContextualSearchLayer(mNativePtr, panelShadowResourceId,
searchBarBackgroundColor, searchContextViewId, searchTermViewId, searchBarBackgroundColor, searchContextViewId, searchTermViewId,
searchCaptionViewId, R.drawable.modern_toolbar_shadow, searchCaptionViewId, R.drawable.modern_toolbar_shadow,
R.drawable.ic_logo_googleg_24dp, quickActionIconResId, R.drawable.breadcrumb_arrow, R.drawable.ic_logo_googleg_24dp, quickActionIconResId, R.drawable.breadcrumb_arrow,
...@@ -161,14 +169,14 @@ public class ContextualSearchSceneLayer extends SceneOverlayLayer { ...@@ -161,14 +169,14 @@ public class ContextualSearchSceneLayer extends SceneOverlayLayer {
searchBarControl.getTextLayerMinHeight(), searchTermOpacity, searchBarControl.getTextLayerMinHeight(), searchTermOpacity,
searchBarControl.getSearchTermCaptionSpacing(), searchCaptionAnimationPercentage, searchBarControl.getSearchTermCaptionSpacing(), searchCaptionAnimationPercentage,
searchCaptionVisible, searchBarBorderVisible, searchBarBorderHeight * mDpToPx, searchCaptionVisible, searchBarBorderVisible, searchBarBorderHeight * mDpToPx,
searchBarShadowVisible, searchBarShadowOpacity, quickActionIconVisible, searchBarShadowVisible, quickActionIconVisible, thumbnailVisible, thumbnailUrl,
thumbnailVisible, thumbnailUrl, customImageVisibilityPercentage, barImageSize, customImageVisibilityPercentage, barImageSize, iconColor, dragHandlebarColor,
iconColor, dragHandlebarColor, arrowIconOpacity, arrowIconRotation, arrowIconOpacity, arrowIconRotation, closeIconOpacity, isProgressBarVisible,
closeIconOpacity, isProgressBarVisible, progressBarHeight * mDpToPx, progressBarHeight * mDpToPx, progressBarOpacity, progressBarCompletion,
progressBarOpacity, progressBarCompletion, dividerLineVisibilityPercentage, dividerLineVisibilityPercentage, dividerLineWidth, dividerLineHeight,
dividerLineWidth, dividerLineHeight, dividerLineColor, dividerLineXOffset, dividerLineColor, dividerLineXOffset, touchHighlightVisible, touchHighlightXOffset,
touchHighlightVisible, touchHighlightXOffset, touchHighlightWidth, touchHighlightWidth, Profile.getLastUsedProfile(), roundedBarTopResourceId,
Profile.getLastUsedProfile()); separatorLineColor);
} }
@CalledByNative @CalledByNative
...@@ -235,13 +243,13 @@ public class ContextualSearchSceneLayer extends SceneOverlayLayer { ...@@ -235,13 +243,13 @@ public class ContextualSearchSceneLayer extends SceneOverlayLayer {
float searchTextLayerMinHeight, float searchTermOpacity, float searchTermCaptionSpacing, float searchTextLayerMinHeight, float searchTermOpacity, float searchTermCaptionSpacing,
float searchCaptionAnimationPercentage, boolean searchCaptionVisible, float searchCaptionAnimationPercentage, boolean searchCaptionVisible,
boolean searchBarBorderVisible, float searchBarBorderHeight, boolean searchBarBorderVisible, float searchBarBorderHeight,
boolean searchBarShadowVisible, float searchBarShadowOpacity, boolean searchBarShadowVisible, boolean quickActionIconVisible,
boolean quickActionIconVisible, boolean thumbnailVisible, String thumbnailUrl, boolean thumbnailVisible, String thumbnailUrl, float customImageVisibilityPercentage,
float customImageVisibilityPercentage, int barImageSize, int iconColor, int barImageSize, int iconColor, int dragHandlebarColor, float arrowIconOpacity,
int dragHandlebarColor, float arrowIconOpacity, float arrowIconRotation, float arrowIconRotation, float closeIconOpacity, boolean isProgressBarVisible,
float closeIconOpacity, boolean isProgressBarVisible, float progressBarHeight, float progressBarHeight, float progressBarOpacity, int progressBarCompletion,
float progressBarOpacity, int progressBarCompletion,
float dividerLineVisibilityPercentage, float dividerLineWidth, float dividerLineHeight, float dividerLineVisibilityPercentage, float dividerLineWidth, float dividerLineHeight,
int dividerLineColor, float dividerLineXOffset, boolean touchHighlightVisible, int dividerLineColor, float dividerLineXOffset, boolean touchHighlightVisible,
float touchHighlightXOffset, float toucHighlightWidth, Profile profile); float touchHighlightXOffset, float toucHighlightWidth, Profile profile,
int barBackgroundResourceId, int separatorLineColor);
} }
...@@ -75,10 +75,15 @@ public class EphemeralTabSceneLayer extends SceneOverlayLayer { ...@@ -75,10 +75,15 @@ public class EphemeralTabSceneLayer extends SceneOverlayLayer {
int dragHandlebarId = ChromeFeatureList.isEnabled(ChromeFeatureList.OVERLAY_NEW_LAYOUT) int dragHandlebarId = ChromeFeatureList.isEnabled(ChromeFeatureList.OVERLAY_NEW_LAYOUT)
? R.drawable.drag_handlebar ? R.drawable.drag_handlebar
: INVALID_RESOURCE_ID; : INVALID_RESOURCE_ID;
nativeSetResourceIds(mNativePtr, title.getViewId(), int roundedBarTopId = ChromeFeatureList.isEnabled(ChromeFeatureList.OVERLAY_NEW_LAYOUT)
R.drawable.contextual_search_bar_background, R.drawable.modern_toolbar_shadow, ? R.drawable.top_round
R.drawable.infobar_chrome, dragHandlebarId, openInTabIconId, : INVALID_RESOURCE_ID;
R.drawable.btn_close); int panelShadowResourceId = panel.getPanelShadowVisible()
? R.drawable.contextual_search_bar_background
: INVALID_RESOURCE_ID;
nativeSetResourceIds(mNativePtr, title.getViewId(), panelShadowResourceId,
roundedBarTopId, R.drawable.modern_toolbar_shadow, R.drawable.infobar_chrome,
dragHandlebarId, openInTabIconId, R.drawable.btn_close);
mIsInitialized = true; mIsInitialized = true;
} }
...@@ -95,6 +100,7 @@ public class EphemeralTabSceneLayer extends SceneOverlayLayer { ...@@ -95,6 +100,7 @@ public class EphemeralTabSceneLayer extends SceneOverlayLayer {
float progressBarHeight = panel.getProgressBarHeight(); float progressBarHeight = panel.getProgressBarHeight();
float progressBarOpacity = panel.getProgressBarOpacity(); float progressBarOpacity = panel.getProgressBarOpacity();
int progressBarCompletion = panel.getProgressBarCompletion(); int progressBarCompletion = panel.getProgressBarCompletion();
int separatorLineColor = panel.getSeparatorLineColor();
WebContents panelWebContents = panel.getWebContents(); WebContents panelWebContents = panel.getWebContents();
nativeUpdate(mNativePtr, titleViewId, captionViewId, captionAnimationPercentage, nativeUpdate(mNativePtr, titleViewId, captionViewId, captionAnimationPercentage,
...@@ -106,9 +112,9 @@ public class EphemeralTabSceneLayer extends SceneOverlayLayer { ...@@ -106,9 +112,9 @@ public class EphemeralTabSceneLayer extends SceneOverlayLayer {
panel.getBarBackgroundColor(), panel.getBarMarginSide() * mDpToPx, panel.getBarBackgroundColor(), panel.getBarMarginSide() * mDpToPx,
panel.getBarMarginTop() * mDpToPx, panel.getBarHeight() * mDpToPx, panel.getBarMarginTop() * mDpToPx, panel.getBarHeight() * mDpToPx,
panel.isBarBorderVisible(), panel.getBarBorderHeight() * mDpToPx, panel.isBarBorderVisible(), panel.getBarBorderHeight() * mDpToPx,
panel.getBarShadowVisible(), panel.getBarShadowOpacity(), panel.getIconColor(), panel.getBarShadowVisible(), panel.getIconColor(), panel.getDragHandlebarColor(),
panel.getDragHandlebarColor(), panel.getFaviconOpacity(), isProgressBarVisible, panel.getFaviconOpacity(), isProgressBarVisible, progressBarHeight * mDpToPx,
progressBarHeight * mDpToPx, progressBarOpacity, progressBarCompletion); progressBarOpacity, progressBarCompletion, separatorLineColor);
} }
@Override @Override
...@@ -147,9 +153,9 @@ public class EphemeralTabSceneLayer extends SceneOverlayLayer { ...@@ -147,9 +153,9 @@ public class EphemeralTabSceneLayer extends SceneOverlayLayer {
long nativeEphemeralTabSceneLayer, SceneLayer contentTree); long nativeEphemeralTabSceneLayer, SceneLayer contentTree);
private native void nativeHideTree(long nativeEphemeralTabSceneLayer); private native void nativeHideTree(long nativeEphemeralTabSceneLayer);
private native void nativeSetResourceIds(long nativeEphemeralTabSceneLayer, private native void nativeSetResourceIds(long nativeEphemeralTabSceneLayer,
int barTextResourceId, int barBackgroundResourceId, int barShadowResourceId, int barTextResourceId, int barBackgroundResourceId, int roundedBarTopResourceId,
int panelIconResourceId, int dragHandlebarResourceId, int openTabIconResourceId, int barShadowResourceId, int panelIconResourceId, int dragHandlebarResourceId,
int closeIconResourceId); int openTabIconResourceId, int closeIconResourceId);
private native void nativeUpdate(long nativeEphemeralTabSceneLayer, int titleViewId, private native void nativeUpdate(long nativeEphemeralTabSceneLayer, int titleViewId,
int captionViewId, float captionAnimationPercentage, float textLayerMinHeight, int captionViewId, float captionAnimationPercentage, float textLayerMinHeight,
float titleCaptionSpacing, boolean captionVisible, int progressBarBackgroundResourceId, float titleCaptionSpacing, boolean captionVisible, int progressBarBackgroundResourceId,
...@@ -157,7 +163,7 @@ public class EphemeralTabSceneLayer extends SceneOverlayLayer { ...@@ -157,7 +163,7 @@ public class EphemeralTabSceneLayer extends SceneOverlayLayer {
float basePageYOffset, WebContents webContents, float panelX, float panelY, float basePageYOffset, WebContents webContents, float panelX, float panelY,
float panelWidth, float panelHeight, int barBackgroundColor, float barMarginSide, float panelWidth, float panelHeight, int barBackgroundColor, float barMarginSide,
float barMarginTop, float barHeight, boolean barBorderVisible, float barBorderHeight, float barMarginTop, float barHeight, boolean barBorderVisible, float barBorderHeight,
boolean barShadowVisible, float barShadowOpacity, int iconColor, int dragHandlebarColor, boolean barShadowVisible, int iconColor, int dragHandlebarColor, float faviconOpacity,
float faviconOpacity, boolean isProgressBarVisible, float progressBarHeight, boolean isProgressBarVisible, float progressBarHeight, float progressBarOpacity,
float progressBarOpacity, int progressBarCompletion); int progressBarCompletion, int separatorLineColor);
} }
...@@ -78,7 +78,6 @@ void ContextualSearchLayer::SetProperties( ...@@ -78,7 +78,6 @@ void ContextualSearchLayer::SetProperties(
bool search_bar_border_visible, bool search_bar_border_visible,
float search_bar_border_height, float search_bar_border_height,
bool search_bar_shadow_visible, bool search_bar_shadow_visible,
float search_bar_shadow_opacity,
bool quick_action_icon_visible, bool quick_action_icon_visible,
bool thumbnail_visible, bool thumbnail_visible,
float custom_image_visibility_percentage, float custom_image_visibility_percentage,
...@@ -99,7 +98,9 @@ void ContextualSearchLayer::SetProperties( ...@@ -99,7 +98,9 @@ void ContextualSearchLayer::SetProperties(
float divider_line_x_offset, float divider_line_x_offset,
bool touch_highlight_visible, bool touch_highlight_visible,
float touch_highlight_x_offset, float touch_highlight_x_offset,
float touch_highlight_width) { float touch_highlight_width,
int rounded_bar_top_resource_id,
int separator_line_color) {
// Round values to avoid pixel gap between layers. // Round values to avoid pixel gap between layers.
search_bar_height = floor(search_bar_height); search_bar_height = floor(search_bar_height);
...@@ -110,9 +111,9 @@ void ContextualSearchLayer::SetProperties( ...@@ -110,9 +111,9 @@ void ContextualSearchLayer::SetProperties(
OverlayPanelLayer::SetResourceIds( OverlayPanelLayer::SetResourceIds(
search_term_resource_id, panel_shadow_resource_id, search_term_resource_id, panel_shadow_resource_id,
search_bar_shadow_resource_id, search_provider_icon_resource_id, rounded_bar_top_resource_id, search_bar_shadow_resource_id,
drag_handlebar_resource_id, open_tab_icon_resource_id, search_provider_icon_resource_id, drag_handlebar_resource_id,
close_icon_resource_id); open_tab_icon_resource_id, close_icon_resource_id);
float content_view_top = search_bar_bottom + search_promo_height; float content_view_top = search_bar_bottom + search_promo_height;
float should_render_bar_border = search_bar_border_visible float should_render_bar_border = search_bar_border_visible
...@@ -126,9 +127,8 @@ void ContextualSearchLayer::SetProperties( ...@@ -126,9 +127,8 @@ void ContextualSearchLayer::SetProperties(
search_panel_width, search_panel_height, search_bar_background_color, search_panel_width, search_panel_height, search_bar_background_color,
search_bar_margin_side, search_bar_margin_top, search_bar_height, search_bar_margin_side, search_bar_margin_top, search_bar_height,
search_bar_top, search_term_opacity, should_render_bar_border, search_bar_top, search_term_opacity, should_render_bar_border,
search_bar_border_height, search_bar_shadow_visible, search_bar_border_height, search_bar_shadow_visible, icon_color,
search_bar_shadow_opacity, icon_color, drag_handlebar_color, drag_handlebar_color, close_icon_opacity, separator_line_color);
close_icon_opacity);
bool is_rtl = l10n_util::IsLayoutRtl(); bool is_rtl = l10n_util::IsLayoutRtl();
......
...@@ -76,7 +76,6 @@ class ContextualSearchLayer : public OverlayPanelLayer { ...@@ -76,7 +76,6 @@ class ContextualSearchLayer : public OverlayPanelLayer {
bool search_bar_border_visible, bool search_bar_border_visible,
float search_bar_border_height, float search_bar_border_height,
bool search_bar_shadow_visible, bool search_bar_shadow_visible,
float search_bar_shadow_opacity,
bool quick_action_icon_visible, bool quick_action_icon_visible,
bool thumbnail_visible, bool thumbnail_visible,
float custom_image_visibility_percentage, float custom_image_visibility_percentage,
...@@ -97,7 +96,9 @@ class ContextualSearchLayer : public OverlayPanelLayer { ...@@ -97,7 +96,9 @@ class ContextualSearchLayer : public OverlayPanelLayer {
float divider_line_x_offset, float divider_line_x_offset,
bool touch_highlight_visible, bool touch_highlight_visible,
float touch_highlight_x_offset, float touch_highlight_x_offset,
float touch_highlight_width); float touch_highlight_width,
int rounded_bar_top_resource_id,
int separator_line_color);
void SetThumbnail(const SkBitmap* thumbnail); void SetThumbnail(const SkBitmap* thumbnail);
......
...@@ -77,14 +77,14 @@ void EphemeralTabLayer::SetProperties( ...@@ -77,14 +77,14 @@ void EphemeralTabLayer::SetProperties(
bool bar_border_visible, bool bar_border_visible,
float bar_border_height, float bar_border_height,
bool bar_shadow_visible, bool bar_shadow_visible,
float bar_shadow_opacity,
int icon_color, int icon_color,
int drag_handlebar_color, int drag_handlebar_color,
jfloat favicon_opacity, jfloat favicon_opacity,
bool progress_bar_visible, bool progress_bar_visible,
float progress_bar_height, float progress_bar_height,
float progress_bar_opacity, float progress_bar_opacity,
int progress_bar_completion) { int progress_bar_completion,
int separator_line_color) {
if (web_contents_ != web_contents) { if (web_contents_ != web_contents) {
web_contents_ = web_contents; web_contents_ = web_contents;
if (web_contents_) { if (web_contents_) {
...@@ -107,8 +107,8 @@ void EphemeralTabLayer::SetProperties( ...@@ -107,8 +107,8 @@ void EphemeralTabLayer::SetProperties(
dp_to_px, content_layer, bar_height, panel_x, panel_y, panel_width, dp_to_px, content_layer, bar_height, panel_x, panel_y, panel_width,
panel_height, bar_background_color, bar_margin_side, bar_margin_top, panel_height, bar_background_color, bar_margin_side, bar_margin_top,
bar_height, 0.0f, title_opacity, bar_border_visible, bar_border_height, bar_height, 0.0f, title_opacity, bar_border_visible, bar_border_height,
bar_shadow_visible, bar_shadow_opacity, icon_color, drag_handlebar_color, bar_shadow_visible, icon_color, drag_handlebar_color,
1.0f /* icon opacity */); 1.0f /* icon opacity */, separator_line_color);
SetupTextLayer(bar_top, bar_height, text_layer_min_height, SetupTextLayer(bar_top, bar_height, text_layer_min_height,
caption_view_resource_id, caption_animation_percentage, caption_view_resource_id, caption_animation_percentage,
......
...@@ -59,14 +59,14 @@ class EphemeralTabLayer : public OverlayPanelLayer, ...@@ -59,14 +59,14 @@ class EphemeralTabLayer : public OverlayPanelLayer,
bool bar_border_visible, bool bar_border_visible,
float bar_border_height, float bar_border_height,
bool bar_shadow_visible, bool bar_shadow_visible,
float bar_shadow_opacity,
int icon_color, int icon_color,
int drag_handlebar_color, int drag_handlebar_color,
jfloat favicon_opacity, jfloat favicon_opacity,
bool progress_bar_visible, bool progress_bar_visible,
float progress_bar_height, float progress_bar_height,
float progress_bar_opacity, float progress_bar_opacity,
int progress_bar_completion); int progress_bar_completion,
int separator_line_color);
void SetupTextLayer(float bar_top, void SetupTextLayer(float bar_top,
float bar_height, float bar_height,
float text_layer_min_height, float text_layer_min_height,
......
...@@ -32,6 +32,7 @@ class OverlayPanelLayer : public Layer { ...@@ -32,6 +32,7 @@ class OverlayPanelLayer : public Layer {
void SetResourceIds(int bar_text_resource_id, void SetResourceIds(int bar_text_resource_id,
int panel_shadow_resource_id, int panel_shadow_resource_id,
int rounded_bar_top_resource_id,
int bar_shadow_resource_id, int bar_shadow_resource_id,
int panel_icon_resource_id, int panel_icon_resource_id,
int drag_handlebar_resource_id, int drag_handlebar_resource_id,
...@@ -54,10 +55,10 @@ class OverlayPanelLayer : public Layer { ...@@ -54,10 +55,10 @@ class OverlayPanelLayer : public Layer {
bool bar_border_visible, bool bar_border_visible,
float bar_border_height, float bar_border_height,
bool bar_shadow_visible, bool bar_shadow_visible,
float bar_shadow_opacity,
int icon_tint, int icon_tint,
int drag_handlebar_tint, int drag_handlebar_tint,
float icon_opacity); float icon_opacity,
int separator_line_color);
void SetProgressBar(int progress_bar_background_resource_id, void SetProgressBar(int progress_bar_background_resource_id,
int progress_bar_resource_id, int progress_bar_resource_id,
...@@ -81,6 +82,7 @@ class OverlayPanelLayer : public Layer { ...@@ -81,6 +82,7 @@ class OverlayPanelLayer : public Layer {
scoped_refptr<cc::Layer> layer_; scoped_refptr<cc::Layer> layer_;
scoped_refptr<cc::NinePatchLayer> panel_shadow_; scoped_refptr<cc::NinePatchLayer> panel_shadow_;
scoped_refptr<cc::NinePatchLayer> rounded_bar_top_;
scoped_refptr<cc::SolidColorLayer> bar_background_; scoped_refptr<cc::SolidColorLayer> bar_background_;
scoped_refptr<cc::UIResourceLayer> bar_text_; scoped_refptr<cc::UIResourceLayer> bar_text_;
scoped_refptr<cc::UIResourceLayer> bar_shadow_; scoped_refptr<cc::UIResourceLayer> bar_shadow_;
...@@ -97,6 +99,7 @@ class OverlayPanelLayer : public Layer { ...@@ -97,6 +99,7 @@ class OverlayPanelLayer : public Layer {
int panel_icon_resource_id_; int panel_icon_resource_id_;
int bar_text_resource_id_; int bar_text_resource_id_;
int panel_shadow_resource_id_; int panel_shadow_resource_id_;
int rounded_bar_top_resource_id_;
int bar_shadow_resource_id_; int bar_shadow_resource_id_;
int drag_handlebar_resource_id_; int drag_handlebar_resource_id_;
int open_tab_icon_resource_id_; int open_tab_icon_resource_id_;
......
...@@ -155,9 +155,12 @@ class TabLayer : public Layer { ...@@ -155,9 +155,12 @@ class TabLayer : public Layer {
scoped_refptr<cc::SolidColorLayer> side_padding_; scoped_refptr<cc::SolidColorLayer> side_padding_;
scoped_refptr<cc::SolidColorLayer> bottom_padding_; scoped_refptr<cc::SolidColorLayer> bottom_padding_;
scoped_refptr<cc::UIResourceLayer> close_button_; scoped_refptr<cc::UIResourceLayer> close_button_;
scoped_refptr<cc::NinePatchLayer> front_border_; scoped_refptr<cc::NinePatchLayer> front_border_;
scoped_refptr<cc::NinePatchLayer> front_border_inner_shadow_; scoped_refptr<cc::NinePatchLayer> front_border_inner_shadow_;
scoped_refptr<cc::NinePatchLayer> contour_shadow_; scoped_refptr<cc::NinePatchLayer> contour_shadow_;
scoped_refptr<cc::NinePatchLayer> shadow_; scoped_refptr<cc::NinePatchLayer> shadow_;
scoped_refptr<cc::UIResourceLayer> back_logo_; scoped_refptr<cc::UIResourceLayer> back_logo_;
float brightness_; float brightness_;
......
...@@ -116,7 +116,6 @@ void ContextualSearchSceneLayer::UpdateContextualSearchLayer( ...@@ -116,7 +116,6 @@ void ContextualSearchSceneLayer::UpdateContextualSearchLayer(
jboolean search_bar_border_visible, jboolean search_bar_border_visible,
jfloat search_bar_border_height, jfloat search_bar_border_height,
jboolean search_bar_shadow_visible, jboolean search_bar_shadow_visible,
jfloat search_bar_shadow_opacity,
jboolean quick_action_icon_visible, jboolean quick_action_icon_visible,
jboolean thumbnail_visible, jboolean thumbnail_visible,
jstring j_thumbnail_url, jstring j_thumbnail_url,
...@@ -139,7 +138,9 @@ void ContextualSearchSceneLayer::UpdateContextualSearchLayer( ...@@ -139,7 +138,9 @@ void ContextualSearchSceneLayer::UpdateContextualSearchLayer(
jboolean touch_highlight_visible, jboolean touch_highlight_visible,
jfloat touch_highlight_x_offset, jfloat touch_highlight_x_offset,
jfloat touch_highlight_width, jfloat touch_highlight_width,
const JavaRef<jobject>& j_profile) { const JavaRef<jobject>& j_profile,
jint rounded_bar_top_resource_id,
jint separator_line_color) {
// Load the thumbnail if necessary. // Load the thumbnail if necessary.
std::string thumbnail_url = std::string thumbnail_url =
base::android::ConvertJavaStringToUTF8(env, j_thumbnail_url); base::android::ConvertJavaStringToUTF8(env, j_thumbnail_url);
...@@ -186,14 +187,15 @@ void ContextualSearchSceneLayer::UpdateContextualSearchLayer( ...@@ -186,14 +187,15 @@ void ContextualSearchSceneLayer::UpdateContextualSearchLayer(
search_term_caption_spacing, search_caption_animation_percentage, search_term_caption_spacing, search_caption_animation_percentage,
search_caption_visible, search_bar_border_visible, search_caption_visible, search_bar_border_visible,
search_bar_border_height, search_bar_shadow_visible, search_bar_border_height, search_bar_shadow_visible,
search_bar_shadow_opacity, quick_action_icon_visible, thumbnail_visible, quick_action_icon_visible, thumbnail_visible,
custom_image_visibility_percentage, bar_image_size, icon_color, custom_image_visibility_percentage, bar_image_size, icon_color,
drag_handlebar_color, arrow_icon_opacity, arrow_icon_rotation, drag_handlebar_color, arrow_icon_opacity, arrow_icon_rotation,
close_icon_opacity, progress_bar_visible, progress_bar_height, close_icon_opacity, progress_bar_visible, progress_bar_height,
progress_bar_opacity, progress_bar_completion, progress_bar_opacity, progress_bar_completion,
divider_line_visibility_percentage, divider_line_width, divider_line_visibility_percentage, divider_line_width,
divider_line_height, divider_line_color, divider_line_x_offset, divider_line_height, divider_line_color, divider_line_x_offset,
touch_highlight_visible, touch_highlight_x_offset, touch_highlight_width); touch_highlight_visible, touch_highlight_x_offset, touch_highlight_width,
rounded_bar_top_resource_id, separator_line_color);
// Make the layer visible if it is not already. // Make the layer visible if it is not already.
contextual_search_layer_->layer()->SetHideLayerAndSubtree(false); contextual_search_layer_->layer()->SetHideLayerAndSubtree(false);
......
...@@ -88,7 +88,6 @@ class ContextualSearchSceneLayer : public SceneLayer, ...@@ -88,7 +88,6 @@ class ContextualSearchSceneLayer : public SceneLayer,
jboolean search_bar_border_visible, jboolean search_bar_border_visible,
jfloat search_bar_border_height, jfloat search_bar_border_height,
jboolean search_bar_shadow_visible, jboolean search_bar_shadow_visible,
jfloat search_bar_shadow_opacity,
jboolean quick_action_icon_visible, jboolean quick_action_icon_visible,
jboolean thumbnail_visible, jboolean thumbnail_visible,
jstring j_thumbnail_url, jstring j_thumbnail_url,
...@@ -111,7 +110,9 @@ class ContextualSearchSceneLayer : public SceneLayer, ...@@ -111,7 +110,9 @@ class ContextualSearchSceneLayer : public SceneLayer,
jboolean touch_highlight_visible, jboolean touch_highlight_visible,
jfloat touch_highlight_x_offset, jfloat touch_highlight_x_offset,
jfloat touch_highlight_width, jfloat touch_highlight_width,
const base::android::JavaRef<jobject>& j_profile); const base::android::JavaRef<jobject>& j_profile,
jint bar_background_resource_id,
jint separator_line_color);
// Inherited from BitmapFetcherDelegate // Inherited from BitmapFetcherDelegate
void OnFetchComplete( void OnFetchComplete(
......
...@@ -59,16 +59,18 @@ void EphemeralTabSceneLayer::CreateEphemeralTabLayer( ...@@ -59,16 +59,18 @@ void EphemeralTabSceneLayer::CreateEphemeralTabLayer(
void EphemeralTabSceneLayer::SetResourceIds(JNIEnv* env, void EphemeralTabSceneLayer::SetResourceIds(JNIEnv* env,
const JavaParamRef<jobject>& object, const JavaParamRef<jobject>& object,
jint text_resource_id, jint text_resource_id,
jint bar_background_resource_id, jint panel_shadow_resource_id,
jint rounded_bar_top_resource_id,
jint bar_shadow_resource_id, jint bar_shadow_resource_id,
jint panel_icon_resource_id, jint panel_icon_resource_id,
jint drag_handlebar_resource_id, jint drag_handlebar_resource_id,
jint open_tab_icon_resource_id, jint open_tab_icon_resource_id,
jint close_icon_resource_id) { jint close_icon_resource_id) {
ephemeral_tab_layer_->SetResourceIds( ephemeral_tab_layer_->SetResourceIds(
text_resource_id, bar_background_resource_id, bar_shadow_resource_id, text_resource_id, panel_shadow_resource_id, rounded_bar_top_resource_id,
panel_icon_resource_id, drag_handlebar_resource_id, bar_shadow_resource_id, panel_icon_resource_id,
open_tab_icon_resource_id, close_icon_resource_id); drag_handlebar_resource_id, open_tab_icon_resource_id,
close_icon_resource_id);
} }
void EphemeralTabSceneLayer::Update(JNIEnv* env, void EphemeralTabSceneLayer::Update(JNIEnv* env,
...@@ -96,14 +98,14 @@ void EphemeralTabSceneLayer::Update(JNIEnv* env, ...@@ -96,14 +98,14 @@ void EphemeralTabSceneLayer::Update(JNIEnv* env,
jboolean bar_border_visible, jboolean bar_border_visible,
jfloat bar_border_height, jfloat bar_border_height,
jboolean bar_shadow_visible, jboolean bar_shadow_visible,
jfloat bar_shadow_opacity,
jint icon_color, jint icon_color,
jint drag_handlebar_color, jint drag_handlebar_color,
jfloat favicon_opacity, jfloat favicon_opacity,
jboolean progress_bar_visible, jboolean progress_bar_visible,
jfloat progress_bar_height, jfloat progress_bar_height,
jfloat progress_bar_opacity, jfloat progress_bar_opacity,
jint progress_bar_completion) { jint progress_bar_completion,
jint separator_line_color) {
// NOTE(mdjones): It is possible to render the panel before content has been // NOTE(mdjones): It is possible to render the panel before content has been
// created. If this is the case, do not attempt to access the WebContents // created. If this is the case, do not attempt to access the WebContents
// and instead pass null. // and instead pass null.
...@@ -130,10 +132,10 @@ void EphemeralTabSceneLayer::Update(JNIEnv* env, ...@@ -130,10 +132,10 @@ void EphemeralTabSceneLayer::Update(JNIEnv* env,
progress_bar_background_resource_id, progress_bar_resource_id, dp_to_px, progress_bar_background_resource_id, progress_bar_resource_id, dp_to_px,
content_layer, panel_x, panel_y, panel_width, panel_height, content_layer, panel_x, panel_y, panel_width, panel_height,
bar_background_color, bar_margin_side, bar_margin_top, bar_height, bar_background_color, bar_margin_side, bar_margin_top, bar_height,
bar_border_visible, bar_border_height, bar_shadow_visible, bar_border_visible, bar_border_height, bar_shadow_visible, icon_color,
bar_shadow_opacity, icon_color, drag_handlebar_color, favicon_opacity, drag_handlebar_color, favicon_opacity, progress_bar_visible,
progress_bar_visible, progress_bar_height, progress_bar_opacity, progress_bar_height, progress_bar_opacity, progress_bar_completion,
progress_bar_completion); separator_line_color);
// Make the layer visible if it is not already. // Make the layer visible if it is not already.
ephemeral_tab_layer_->layer()->SetHideLayerAndSubtree(false); ephemeral_tab_layer_->layer()->SetHideLayerAndSubtree(false);
} }
......
...@@ -33,7 +33,8 @@ class EphemeralTabSceneLayer : public SceneLayer { ...@@ -33,7 +33,8 @@ class EphemeralTabSceneLayer : public SceneLayer {
void SetResourceIds(JNIEnv* env, void SetResourceIds(JNIEnv* env,
const base::android::JavaParamRef<jobject>& object, const base::android::JavaParamRef<jobject>& object,
jint text_resource_id, jint text_resource_id,
jint bar_background_resource_id, jint panel_shadow_resource_id,
jint rounded_bar_top_resource_id,
jint bar_shadow_resource_id, jint bar_shadow_resource_id,
jint panel_icon_resource_id, jint panel_icon_resource_id,
jint drag_handlebar_resource_id, jint drag_handlebar_resource_id,
...@@ -65,14 +66,14 @@ class EphemeralTabSceneLayer : public SceneLayer { ...@@ -65,14 +66,14 @@ class EphemeralTabSceneLayer : public SceneLayer {
jboolean bar_border_visible, jboolean bar_border_visible,
jfloat bar_border_height, jfloat bar_border_height,
jboolean bar_shadow_visible, jboolean bar_shadow_visible,
jfloat bar_shadow_opacity,
jint icon_color, jint icon_color,
jint drag_handlebar_color, jint drag_handlebar_color,
jfloat favicon_opacity, jfloat favicon_opacity,
jboolean progress_bar_visible, jboolean progress_bar_visible,
jfloat progress_bar_height, jfloat progress_bar_height,
jfloat progress_bar_opacity, jfloat progress_bar_opacity,
jint progress_bar_completion); jint progress_bar_completion,
jint separator_line_color);
void SetContentTree( void SetContentTree(
JNIEnv* env, JNIEnv* env,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment