Commit 06a2e07d authored by Melissa Zhang's avatar Melissa Zhang Committed by Chromium LUCI CQ

[Sharesheet] Don't override OnWidgetBoundsChanged

OnWidgetBoundsChanged is invoked when the bounds of the widget
changes, but was being used to indicate the bounds of its parent
had changed. This was creating a bug when SharesheetBubbleView was
updating to the NearbyShare view as the change in widget size was
invoking OnWidgetBoundsChanged and causing the anchor position to
update. Moving the anchor position stopped the NearbyShare view
from animating, causing the view to only fill a portion of the
sharesheet. Instead of overriding OnWidgetBoundsChanged, we call
UpdateAnchorPosition directly when we observe a change in the
bounds of the parent widget.

Bug: 1152651
Change-Id: Ieeda8ceeb577fd0ce43a98550ac437a1ac4fad11
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2616643
Commit-Queue: Melissa Zhang <melzhang@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Auto-Submit: Melissa Zhang <melzhang@chromium.org>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#841355}
parent f936dc21
......@@ -120,7 +120,7 @@ class SharesheetBubbleView::SharesheetParentWidgetObserver
void OnWidgetBoundsChanged(views::Widget* widget,
const gfx::Rect& bounds) override {
owner_->OnWidgetBoundsChanged(widget, bounds);
owner_->UpdateAnchorPosition();
}
private:
......@@ -488,11 +488,6 @@ void SharesheetBubbleView::OnWidgetActivationChanged(views::Widget* widget,
}
}
void SharesheetBubbleView::OnWidgetBoundsChanged(views::Widget* widget,
const gfx::Rect& new_bounds) {
UpdateAnchorPosition();
}
void SharesheetBubbleView::CreateBubble() {
set_close_on_deactivate(false);
SetButtons(ui::DIALOG_BUTTON_NONE);
......
......@@ -44,10 +44,6 @@ class SharesheetBubbleView : public views::BubbleDialogDelegateView {
void ResizeBubble(const int& width, const int& height);
void CloseBubble();
// views::BubbleDialogDelegateView:
void OnWidgetBoundsChanged(views::Widget* widget,
const gfx::Rect& new_bounds) override;
private:
class SharesheetParentWidgetObserver;
......
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