Commit a5cdf5ea authored by msw's avatar msw Committed by Commit bot

Fix TooltipAura initial sizing.

r296874 regressed initial tooltip sizing on Aura.
(Widget::SetContentsView sizes the view to the widget)

Reorder the View sizing to after the Widget init.

BUG=418456
TEST=The first Linux Aura tooltip is sized correctly.
R=sky@chromium.org

Review URL: https://codereview.chromium.org/613753003

Cr-Commit-Position: refs/heads/master@{#297281}
parent d11b62b9
......@@ -190,7 +190,6 @@ void TooltipAura::SetText(aura::Window* window,
TrimTooltipToFit(label_.font_list(), GetMaxWidth(location), &trimmed_text,
&max_width, &line_count);
label_.SetText(trimmed_text);
label_.SizeToFit(max_width + label_.GetInsets().width());
if (!widget_) {
widget_ = CreateTooltipWidget(tooltip_window_);
......@@ -198,6 +197,7 @@ void TooltipAura::SetText(aura::Window* window,
widget_->AddObserver(this);
}
label_.SizeToFit(max_width + label_.GetInsets().width());
SetTooltipBounds(location, label_.size());
ui::NativeTheme* native_theme = widget_->GetNativeTheme();
......
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