Commit e7229461 authored by Timothy Loh's avatar Timothy Loh Committed by Commit Bot

Revert "Match security chip visibility with focus ring"

This reverts commit 26399bca.

Reason for revert: OmniboxViewViewsTest.SelectAllOnTabToFocus is Flaky

Original change's description:
> Match security chip visibility with focus ring
> 
> Instantly hides or shows the IconLabelBubbleView separator when focus
> rings are available to prevent showing the separator when a focus ring
> overlaps it.
> 
> Bug: chromium:865029
> Change-Id: I21a4c296c1da06b81dc91d66101d46e8ad52ad99
> Reviewed-on: https://chromium-review.googlesource.com/1142442
> Commit-Queue: Peter Boström <pbos@chromium.org>
> Reviewed-by: Bret Sepulveda <bsep@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#576358}

TBR=pbos@chromium.org,bsep@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 865029, 866230
Change-Id: I30372e90c1613b33690b43dd28fbe151abddddef
Reviewed-on: https://chromium-review.googlesource.com/1146421Reviewed-by: default avatarTimothy Loh <timloh@chromium.org>
Commit-Queue: Timothy Loh <timloh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577110}
parent 3ff6b565
...@@ -72,18 +72,6 @@ void IconLabelBubbleView::SeparatorView::UpdateOpacity() { ...@@ -72,18 +72,6 @@ void IconLabelBubbleView::SeparatorView::UpdateOpacity() {
if (!visible()) if (!visible())
return; return;
if (!layer())
SetPaintToLayer();
layer()->SetFillsBoundsOpaquely(false);
// When using focus rings are visible we should hide the separator instantly
// when the IconLabelBubbleView is focused. Otherwise we should follow the
// inkdrop.
if (views::PlatformStyle::kPreferFocusRings && owner_->is_focused()) {
layer()->SetOpacity(0.0f);
return;
}
views::InkDrop* ink_drop = owner_->GetInkDrop(); views::InkDrop* ink_drop = owner_->GetInkDrop();
DCHECK(ink_drop); DCHECK(ink_drop);
...@@ -100,6 +88,10 @@ void IconLabelBubbleView::SeparatorView::UpdateOpacity() { ...@@ -100,6 +88,10 @@ void IconLabelBubbleView::SeparatorView::UpdateOpacity() {
duration = kFadeInDurationMs; duration = kFadeInDurationMs;
} }
if (!layer())
SetPaintToLayer();
layer()->SetFillsBoundsOpaquely(false);
if (disable_animation_for_test_) { if (disable_animation_for_test_) {
layer()->SetOpacity(opacity); layer()->SetOpacity(opacity);
} else { } else {
...@@ -385,18 +377,6 @@ void IconLabelBubbleView::NotifyClick(const ui::Event& event) { ...@@ -385,18 +377,6 @@ void IconLabelBubbleView::NotifyClick(const ui::Event& event) {
OnActivate(event); OnActivate(event);
} }
void IconLabelBubbleView::OnFocus() {
is_focused_ = true;
separator_view_->UpdateOpacity();
Button::OnFocus();
}
void IconLabelBubbleView::OnBlur() {
is_focused_ = false;
separator_view_->UpdateOpacity();
Button::OnBlur();
}
void IconLabelBubbleView::OnWidgetDestroying(views::Widget* widget) { void IconLabelBubbleView::OnWidgetDestroying(views::Widget* widget) {
widget->RemoveObserver(this); widget->RemoveObserver(this);
} }
......
...@@ -87,8 +87,6 @@ class IconLabelBubbleView : public views::InkDropObserver, ...@@ -87,8 +87,6 @@ class IconLabelBubbleView : public views::InkDropObserver,
void OnBubbleCreated(views::Widget* bubble_widget); void OnBubbleCreated(views::Widget* bubble_widget);
bool is_focused() const { return is_focused_; }
protected: protected:
static constexpr int kOpenTimeMS = 150; static constexpr int kOpenTimeMS = 150;
...@@ -156,8 +154,6 @@ class IconLabelBubbleView : public views::InkDropObserver, ...@@ -156,8 +154,6 @@ class IconLabelBubbleView : public views::InkDropObserver,
bool IsTriggerableEvent(const ui::Event& event) override; bool IsTriggerableEvent(const ui::Event& event) override;
bool ShouldUpdateInkDropOnClickCanceled() const override; bool ShouldUpdateInkDropOnClickCanceled() const override;
void NotifyClick(const ui::Event& event) override; void NotifyClick(const ui::Event& event) override;
void OnFocus() override;
void OnBlur() override;
// views::WidgetObserver: // views::WidgetObserver:
void OnWidgetDestroying(views::Widget* widget) override; void OnWidgetDestroying(views::Widget* widget) override;
...@@ -192,7 +188,6 @@ class IconLabelBubbleView : public views::InkDropObserver, ...@@ -192,7 +188,6 @@ class IconLabelBubbleView : public views::InkDropObserver,
views::Label* label_; views::Label* label_;
views::InkDropContainerView* ink_drop_container_; views::InkDropContainerView* ink_drop_container_;
SeparatorView* separator_view_; SeparatorView* separator_view_;
bool is_focused_ = false;
// The padding of the element that will be displayed after |this|. This value // The padding of the element that will be displayed after |this|. This value
// is relevant for calculating the amount of space to reserve after the // is relevant for calculating the amount of space to reserve after the
......
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