Commit 344e7141 authored by Wei Li's avatar Wei Li Committed by Chromium LUCI CQ

Remove NO_SHADOW_OPAQUE_BORDER shadow type

Ash's touch calibrator view should use NO_ASSETS type if it doesn't
need the shadow. Otherwise, it should use SMALL_SHADOW (or BIG_SHADOW)
which has no difference from the current NO_SHADOW_OPAQUE_BORDER shadow
implementation.

Since that is the last use of NO_SHADOW_OPAQUE_BORDER shadow type,
now we can completely remove this type and related code.

Bug: 940027
Change-Id: I8d9e69a76f3fa240947397c5735163db21fc4803
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2591246Reviewed-by: default avatarAllen Bauer <kylixrd@chromium.org>
Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Commit-Queue: Wei Li <weili@chromium.org>
Cr-Commit-Position: refs/heads/master@{#837194}
parent 17d6c70e
......@@ -312,7 +312,7 @@ HintBox::HintBox(const gfx::Rect& bounds, int border_radius)
SetBorder(std::make_unique<views::BubbleBorder>(
base::i18n::IsRTL() ? views::BubbleBorder::RIGHT_CENTER
: views::BubbleBorder::LEFT_CENTER,
views::BubbleBorder::NO_SHADOW_OPAQUE_BORDER, SK_ColorWHITE));
views::BubbleBorder::NO_ASSETS, SK_ColorWHITE));
arrow_width_ = (GetInsets().right() - GetInsets().left()) *
(base::i18n::IsRTL() ? 1 : -1);
......
......@@ -331,9 +331,6 @@ void BubbleBorder::PaintNoShadow(const View& view, gfx::Canvas* canvas) {
}
void BubbleBackground::Paint(gfx::Canvas* canvas, views::View* view) const {
if (border_->shadow() == BubbleBorder::NO_SHADOW_OPAQUE_BORDER)
canvas->DrawColor(border_->background_color());
// Fill the contents with a round-rect region to match the border images.
cc::PaintFlags flags;
flags.setAntiAlias(true);
......
......@@ -61,7 +61,6 @@ class VIEWS_EXPORT BubbleBorder : public Border {
enum Shadow {
NO_SHADOW = 0,
NO_SHADOW_OPAQUE_BORDER,
BIG_SHADOW,
SMALL_SHADOW,
// NO_ASSETS borders don't draw a stroke or a shadow. This is used for
......
......@@ -251,7 +251,6 @@ int BubbleFrameView::NonClientHitTest(const gfx::Point& point) {
void BubbleFrameView::GetWindowMask(const gfx::Size& size,
SkPath* window_mask) {
if (bubble_border_->shadow() != BubbleBorder::SMALL_SHADOW &&
bubble_border_->shadow() != BubbleBorder::NO_SHADOW_OPAQUE_BORDER &&
bubble_border_->shadow() != BubbleBorder::NO_ASSETS)
return;
......@@ -274,8 +273,7 @@ void BubbleFrameView::GetWindowMask(const gfx::Size& size,
SkIntToScalar(size.height() - border_insets.bottom() +
kBorderStrokeSize)};
if (bubble_border_->shadow() == BubbleBorder::NO_SHADOW_OPAQUE_BORDER ||
bubble_border_->shadow() == BubbleBorder::NO_ASSETS) {
if (bubble_border_->shadow() == BubbleBorder::NO_ASSETS) {
window_mask->addRoundRect(rect, kCornerRadius, kCornerRadius);
} else {
static const int kBottomBorderShadowSize = 2;
......
......@@ -99,11 +99,6 @@ void BubbleExample::CreateExampleView(View* container) {
base::BindRepeating(&BubbleExample::ShowBubble, base::Unretained(this),
&no_shadow_, BubbleBorder::NO_SHADOW, false),
ASCIIToUTF16("No Shadow")));
no_shadow_opaque_ = container->AddChildView(std::make_unique<LabelButton>(
base::BindRepeating(&BubbleExample::ShowBubble, base::Unretained(this),
&no_shadow_opaque_,
BubbleBorder::NO_SHADOW_OPAQUE_BORDER, false),
ASCIIToUTF16("Opaque Border")));
big_shadow_ = container->AddChildView(std::make_unique<LabelButton>(
base::BindRepeating(&BubbleExample::ShowBubble, base::Unretained(this),
&big_shadow_, BubbleBorder::BIG_SHADOW, false),
......
......@@ -33,7 +33,6 @@ class VIEWS_EXAMPLES_EXPORT BubbleExample : public ExampleBase {
const ui::Event& event);
Button* no_shadow_;
Button* no_shadow_opaque_;
Button* big_shadow_;
Button* small_shadow_;
Button* no_assets_;
......
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