Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / ui / views / window / custom_frame_view.cc
index bd3c281..cadc5aa 100644 (file)
@@ -19,7 +19,7 @@
 #include "ui/views/color_constants.h"
 #include "ui/views/controls/button/image_button.h"
 #include "ui/views/views_delegate.h"
-#include "ui/views/widget/native_widget_aura.h"
+#include "ui/views/widget/native_widget_private.h"
 #include "ui/views/widget/widget.h"
 #include "ui/views/widget/widget_delegate.h"
 #include "ui/views/window/client_view.h"
@@ -63,7 +63,7 @@ const SkColor kDefaultColorFrameInactive = SkColorSetRGB(161, 182, 228);
 
 const gfx::FontList& GetTitleFontList() {
   static const gfx::FontList title_font_list =
-      NativeWidgetAura::GetWindowTitleFontList();
+      internal::NativeWidgetPrivate::GetWindowTitleFontList();
   return title_font_list;
 }
 
@@ -192,7 +192,8 @@ void CustomFrameView::UpdateWindowIcon() {
 }
 
 void CustomFrameView::UpdateWindowTitle() {
-  SchedulePaintInRect(title_bounds_);
+  if (frame_->widget_delegate()->ShouldShowWindowTitle())
+    SchedulePaintInRect(title_bounds_);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -380,7 +381,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_;
@@ -539,6 +540,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();