Commit 081f7dc4 authored by Leonard Grey's avatar Leonard Grey Committed by Commit Bot

Views: Don't layout frame on title change if window title isn't displayed

Bug: 858944, 835983
Change-Id: Ia7908a1a199a1e537bf7ba7668116e018cbd4e61
Reviewed-on: https://chromium-review.googlesource.com/1144138Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Leonard Grey <lgrey@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577884}
parent e341c8a9
...@@ -387,8 +387,10 @@ void GlassBrowserFrameView::UpdateWindowIcon() { ...@@ -387,8 +387,10 @@ void GlassBrowserFrameView::UpdateWindowIcon() {
} }
void GlassBrowserFrameView::UpdateWindowTitle() { void GlassBrowserFrameView::UpdateWindowTitle() {
if (ShowCustomTitle() && !frame()->IsFullscreen()) if (ShowCustomTitle() && !frame()->IsFullscreen()) {
LayoutTitleBar();
window_title_->SchedulePaint(); window_title_->SchedulePaint();
}
} }
void GlassBrowserFrameView::ResetWindowControls() { void GlassBrowserFrameView::ResetWindowControls() {
......
...@@ -284,8 +284,10 @@ void OpaqueBrowserFrameView::UpdateWindowIcon() { ...@@ -284,8 +284,10 @@ void OpaqueBrowserFrameView::UpdateWindowIcon() {
} }
void OpaqueBrowserFrameView::UpdateWindowTitle() { void OpaqueBrowserFrameView::UpdateWindowTitle() {
if (!frame()->IsFullscreen()) if (!frame()->IsFullscreen() && ShouldShowWindowTitle()) {
Layout();
window_title_->SchedulePaint(); window_title_->SchedulePaint();
}
} }
void OpaqueBrowserFrameView::SizeConstraintsChanged() {} void OpaqueBrowserFrameView::SizeConstraintsChanged() {}
......
...@@ -272,6 +272,7 @@ void BubbleFrameView::UpdateWindowTitle() { ...@@ -272,6 +272,7 @@ void BubbleFrameView::UpdateWindowTitle() {
!delegate->GetWindowTitle().empty()); !delegate->GetWindowTitle().empty());
default_title_->SetText(delegate->GetWindowTitle()); default_title_->SetText(delegate->GetWindowTitle());
} // custom_title_'s updates are handled by its creator. } // custom_title_'s updates are handled by its creator.
Layout();
} }
void BubbleFrameView::SizeConstraintsChanged() {} void BubbleFrameView::SizeConstraintsChanged() {}
......
...@@ -836,10 +836,6 @@ void Widget::UpdateWindowTitle() { ...@@ -836,10 +836,6 @@ void Widget::UpdateWindowTitle() {
return; return;
non_client_view_->UpdateWindowTitle(); non_client_view_->UpdateWindowTitle();
// If the non-client view is rendering its own title, it'll need to relayout
// now and to get a paint update later on.
non_client_view_->Layout();
} }
void Widget::UpdateWindowIcon() { void Widget::UpdateWindowIcon() {
......
...@@ -197,8 +197,12 @@ void CustomFrameView::UpdateWindowIcon() { ...@@ -197,8 +197,12 @@ void CustomFrameView::UpdateWindowIcon() {
} }
void CustomFrameView::UpdateWindowTitle() { void CustomFrameView::UpdateWindowTitle() {
if (frame_->widget_delegate()->ShouldShowWindowTitle()) if (frame_->widget_delegate()->ShouldShowWindowTitle() &&
// If this is still unset, we haven't laid out window controls yet.
maximum_title_bar_x_ > -1) {
LayoutTitleBar();
SchedulePaintInRect(title_bounds_); SchedulePaintInRect(title_bounds_);
}
} }
void CustomFrameView::SizeConstraintsChanged() { void CustomFrameView::SizeConstraintsChanged() {
......
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