From 6f6f1ef623101f1a48866e9f9aaa645421f8e375 Mon Sep 17 00:00:00 2001 From: "benwells@chromium.org" Date: Fri, 9 May 2014 11:50:55 +0000 Subject: Respect WidgetDelegate::ShouldShowWindowTitle in CustomFrameView. This lets chrome apps hide their window title when running with the standard frame when DWM is not enabled. BUG=367598 Review URL: https://codereview.chromium.org/264383004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269231 0039d316-1c4b-4281-b951-d872f2087c98 --- ui/views/window/custom_frame_view.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ui/views/window') diff --git a/ui/views/window/custom_frame_view.cc b/ui/views/window/custom_frame_view.cc index 4075f6b..cfb34e6 100644 --- a/ui/views/window/custom_frame_view.cc +++ b/ui/views/window/custom_frame_view.cc @@ -192,7 +192,8 @@ void CustomFrameView::UpdateWindowIcon() { } void CustomFrameView::UpdateWindowTitle() { - SchedulePaintInRect(title_bounds_); + if (frame_->widget_delegate()->ShouldShowWindowTitle()) + SchedulePaintInRect(title_bounds_); } /////////////////////////////////////////////////////////////////////////////// @@ -379,7 +380,7 @@ void CustomFrameView::PaintTitleBar(gfx::Canvas* canvas) { // It seems like in some conditions we can be asked to paint after the window // that contains us is WM_DESTROYed. At this point, our delegate is NULL. The // correct long term fix may be to shut down the RootView in WM_DESTROY. - if (!delegate) + if (!delegate || !delegate->ShouldShowWindowTitle()) return; gfx::Rect rect = title_bounds_; @@ -538,6 +539,9 @@ void CustomFrameView::LayoutTitleBar() { if (show_window_icon) window_icon_->SetBoundsRect(icon_bounds); + if (!frame_->widget_delegate()->ShouldShowWindowTitle()) + return; + // The offset between the window left edge and the title text. int title_x = show_window_icon ? icon_bounds.right() + kTitleIconOffsetX : icon_bounds.x(); -- cgit v1.1