Commit 8f7ddcd6 authored by Evan Stade's avatar Evan Stade Committed by Commit Bot

Hover cards: change how we prevent events from making it to the window

Uses BubbleDialogDelegateView::set_accept_events and removes
BubbleFrameView::set_hit_test_transparent

See related https://crbug.com/978985

Change-Id: I659e208f886aea331f18317ada532e0bef7797e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1678949Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: default avatarCaroline Rising <corising@chromium.org>
Reviewed-by: default avatarDana Fried <dfried@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695343}
parent 8a3890ce
...@@ -289,6 +289,8 @@ TabHoverCardBubbleView::TabHoverCardBubbleView(Tab* tab) ...@@ -289,6 +289,8 @@ TabHoverCardBubbleView::TabHoverCardBubbleView(Tab* tab)
// view inside the client view. // view inside the client view.
set_margins(gfx::Insets()); set_margins(gfx::Insets());
set_accept_events(false);
// Inset the tab hover cards anchor rect to bring the card closer to the tab. // Inset the tab hover cards anchor rect to bring the card closer to the tab.
constexpr gfx::Insets kTabHoverCardAnchorInsets(2, 0); constexpr gfx::Insets kTabHoverCardAnchorInsets(2, 0);
set_anchor_view_insets(kTabHoverCardAnchorInsets); set_anchor_view_insets(kTabHoverCardAnchorInsets);
...@@ -366,7 +368,6 @@ TabHoverCardBubbleView::TabHoverCardBubbleView(Tab* tab) ...@@ -366,7 +368,6 @@ TabHoverCardBubbleView::TabHoverCardBubbleView(Tab* tab)
GetBubbleFrameView()->set_preferred_arrow_adjustment( GetBubbleFrameView()->set_preferred_arrow_adjustment(
views::BubbleFrameView::PreferredArrowAdjustment::kOffset); views::BubbleFrameView::PreferredArrowAdjustment::kOffset);
GetBubbleFrameView()->set_hit_test_transparent(true);
if (CustomShadowsSupported()) { if (CustomShadowsSupported()) {
GetBubbleFrameView()->SetCornerRadius( GetBubbleFrameView()->SetCornerRadius(
......
...@@ -173,8 +173,6 @@ bool BubbleFrameView::GetClientMask(const gfx::Size& size, SkPath* path) const { ...@@ -173,8 +173,6 @@ bool BubbleFrameView::GetClientMask(const gfx::Size& size, SkPath* path) const {
int BubbleFrameView::NonClientHitTest(const gfx::Point& point) { int BubbleFrameView::NonClientHitTest(const gfx::Point& point) {
if (!bounds().Contains(point)) if (!bounds().Contains(point))
return HTNOWHERE; return HTNOWHERE;
if (hit_test_transparent_)
return HTTRANSPARENT;
if (close_->GetVisible() && close_->GetMirroredBounds().Contains(point)) if (close_->GetVisible() && close_->GetMirroredBounds().Contains(point))
return HTCLOSE; return HTCLOSE;
......
...@@ -111,11 +111,6 @@ class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView, ...@@ -111,11 +111,6 @@ class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView,
preferred_arrow_adjustment_ = adjustment; preferred_arrow_adjustment_ = adjustment;
} }
bool hit_test_transparent() const { return hit_test_transparent_; }
void set_hit_test_transparent(bool hit_test_transparent) {
hit_test_transparent_ = hit_test_transparent;
}
// Get/set the corner radius of the bubble border. // Get/set the corner radius of the bubble border.
int corner_radius() const { int corner_radius() const {
return bubble_border_ ? bubble_border_->corner_radius() : 0; return bubble_border_ ? bubble_border_->corner_radius() : 0;
...@@ -242,10 +237,6 @@ class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView, ...@@ -242,10 +237,6 @@ class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView,
PreferredArrowAdjustment preferred_arrow_adjustment_ = PreferredArrowAdjustment preferred_arrow_adjustment_ =
PreferredArrowAdjustment::kMirror; PreferredArrowAdjustment::kMirror;
// If true the view is transparent to all hit tested events (i.e. click and
// hover).
bool hit_test_transparent_ = false;
InputEventActivationProtector input_protector_; InputEventActivationProtector input_protector_;
DISALLOW_COPY_AND_ASSIGN(BubbleFrameView); DISALLOW_COPY_AND_ASSIGN(BubbleFrameView);
......
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