Commit 1c1df774 authored by Parastoo Geranmayeh's avatar Parastoo Geranmayeh Committed by Commit Bot

[Sheriff] Revert "[WebLayer] Reuse Chrome's InfoBarWrapper.java"

This reverts commit b7a33c21.

Reason for revert: possibly causing crbug/1100914

Original change's description:
> [WebLayer] Reuse Chrome's InfoBarWrapper.java
> 
> This CL eliminates //weblayer's copy of chrome's InfoBarWrapper.java in
> favor of directly using the latter now that it has been componentized.
> There were no substantive changes introduced in //weblayer and no
> behavioral changes.
> 
> Bug: 1099169
> Change-Id: Ie9cc819f17ce30bb66085cb05040ce11696725ec
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2270554
> Commit-Queue: Colin Blundell <blundell@chromium.org>
> Reviewed-by: Clark DuVall <cduvall@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#783894}

TBR=blundell@chromium.org,cduvall@chromium.org

Change-Id: I5f0fbec56bae167ccfb54ca9d9fd4b5f3fdf25ad
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1099169
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2276312Reviewed-by: default avatarParastoo Geranmayeh <parastoog@google.com>
Commit-Queue: Parastoo Geranmayeh <parastoog@google.com>
Cr-Commit-Position: refs/heads/master@{#783980}
parent b48f93cd
...@@ -9,6 +9,7 @@ import("//weblayer/variables.gni") ...@@ -9,6 +9,7 @@ import("//weblayer/variables.gni")
android_resources("weblayer_resources") { android_resources("weblayer_resources") {
sources = [ sources = [
"res/drawable/weblayer_infobar_wrapper_bg.xml",
"res/drawable/weblayer_tab_indicator.xml", "res/drawable/weblayer_tab_indicator.xml",
"res/layout/site_settings_layout.xml", "res/layout/site_settings_layout.xml",
"res/layout/weblayer_infobar_translate_compact_content.xml", "res/layout/weblayer_infobar_translate_compact_content.xml",
...@@ -95,6 +96,7 @@ android_library("java") { ...@@ -95,6 +96,7 @@ android_library("java") {
"org/chromium/weblayer_private/InfoBarContainer.java", "org/chromium/weblayer_private/InfoBarContainer.java",
"org/chromium/weblayer_private/InfoBarContainerLayout.java", "org/chromium/weblayer_private/InfoBarContainerLayout.java",
"org/chromium/weblayer_private/InfoBarContainerView.java", "org/chromium/weblayer_private/InfoBarContainerView.java",
"org/chromium/weblayer_private/InfoBarWrapper.java",
"org/chromium/weblayer_private/IntentUtils.java", "org/chromium/weblayer_private/IntentUtils.java",
"org/chromium/weblayer_private/InterceptNavigationDelegateClientImpl.java", "org/chromium/weblayer_private/InterceptNavigationDelegateClientImpl.java",
"org/chromium/weblayer_private/LocaleChangedBroadcastReceiver.java", "org/chromium/weblayer_private/LocaleChangedBroadcastReceiver.java",
......
...@@ -19,7 +19,6 @@ import android.view.View; ...@@ -19,7 +19,6 @@ import android.view.View;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import org.chromium.components.infobars.InfoBarUiItem; import org.chromium.components.infobars.InfoBarUiItem;
import org.chromium.components.infobars.InfoBarWrapper;
import org.chromium.ui.widget.OptimizedFrameLayout; import org.chromium.ui.widget.OptimizedFrameLayout;
import org.chromium.weblayer_private.InfoBarContainer.InfoBarAnimationListener; import org.chromium.weblayer_private.InfoBarContainer.InfoBarAnimationListener;
......
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.weblayer_private;
import android.content.Context;
import android.content.res.Resources;
import android.view.Gravity;
import android.view.View;
import android.widget.FrameLayout;
import org.chromium.components.infobars.InfoBarUiItem;
/**
* Layout that holds an infobar's contents and provides a background color and a top shadow.
*/
class InfoBarWrapper extends FrameLayout {
private final InfoBarUiItem mItem;
/**
* Constructor for inflating from Java.
*/
InfoBarWrapper(Context context, InfoBarUiItem item) {
super(context);
mItem = item;
Resources res = context.getResources();
int peekingHeight = res.getDimensionPixelSize(R.dimen.infobar_peeking_height);
int shadowHeight = res.getDimensionPixelSize(R.dimen.infobar_shadow_height);
setMinimumHeight(peekingHeight + shadowHeight);
// setBackgroundResource() changes the padding, so call setPadding() second.
setBackgroundResource(R.drawable.weblayer_infobar_wrapper_bg);
setPadding(0, shadowHeight, 0, 0);
}
InfoBarUiItem getItem() {
return mItem;
}
@Override
public void onViewAdded(View child) {
child.setLayoutParams(new LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT, Gravity.TOP));
}
}
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2015 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<bitmap
android:src="@drawable/infobar_shadow_top"
android:gravity="top|fill_horizontal"
android:tileMode="disabled" />
</item>
<item
android:top="@dimen/infobar_shadow_height"
android:drawable="@color/infobar_background_color" />
</layer-list>
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