Commit 40d10010 authored by Allen Bauer's avatar Allen Bauer Committed by Commit Bot

Removed Layout() override on HatsBubbleView in favor of setting the margins in OnBoundsChanged().

Bug: 1005568
Change-Id: If12927896ad1daa745517c03a6951ff65b3de2f5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1823257
Auto-Submit: Allen Bauer <kylixrd@chromium.org>
Commit-Queue: Wei Li <weili@chromium.org>
Reviewed-by: default avatarWei Li <weili@chromium.org>
Cr-Commit-Position: refs/heads/master@{#699891}
parent 8f486945
...@@ -172,15 +172,17 @@ void HatsBubbleView::OnWidgetDestroying(views::Widget* widget) { ...@@ -172,15 +172,17 @@ void HatsBubbleView::OnWidgetDestroying(views::Widget* widget) {
instance_ = nullptr; instance_ = nullptr;
} }
void HatsBubbleView::Layout() { void HatsBubbleView::OnBoundsChanged(const gfx::Rect& previous_bounds) {
auto* frame_view = GetBubbleFrameView(); auto* frame_view = GetBubbleFrameView();
if (frame_view && frame_view->title()) { if (frame_view && frame_view->title()) {
// Align bubble content to the beginning of the title text. // Align bubble content to the beginning of the title text.
gfx::Point point(frame_view->title()->x(), 0); gfx::Point point(frame_view->title()->x(), 0);
views::View::ConvertPointToTarget(frame_view, GetWidget()->client_view(), views::View::ConvertPointToTarget(frame_view, GetWidget()->client_view(),
&point); &point);
SetX(point.x()); auto dialog_margins = margins();
dialog_margins.set_left(point.x());
set_margins(dialog_margins);
} }
views::BubbleDialogDelegateView::Layout(); views::BubbleDialogDelegateView::OnBoundsChanged(previous_bounds);
} }
...@@ -62,7 +62,7 @@ class HatsBubbleView : public views::BubbleDialogDelegateView { ...@@ -62,7 +62,7 @@ class HatsBubbleView : public views::BubbleDialogDelegateView {
void OnWidgetDestroying(views::Widget* widget) override; void OnWidgetDestroying(views::Widget* widget) override;
// views::View: // views::View:
void Layout() override; void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
private: private:
HatsBubbleView(Browser* browser, HatsBubbleView(Browser* browser,
......
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