OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/wm/header_painter.h" | 5 #include "ash/wm/header_painter.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
10 #include "ash/wm/caption_buttons/frame_caption_button_container_view.h" | 10 #include "ash/wm/caption_buttons/frame_caption_button_container_view.h" |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 int HeaderPainter::HeaderContentSeparatorSize() const { | 426 int HeaderPainter::HeaderContentSeparatorSize() const { |
427 return kHeaderContentSeparatorSize; | 427 return kHeaderContentSeparatorSize; |
428 } | 428 } |
429 | 429 |
430 void HeaderPainter::PaintTitleBar(gfx::Canvas* canvas, | 430 void HeaderPainter::PaintTitleBar(gfx::Canvas* canvas, |
431 const gfx::Font& title_font) { | 431 const gfx::Font& title_font) { |
432 // The window icon is painted by its own views::View. | 432 // The window icon is painted by its own views::View. |
433 views::WidgetDelegate* delegate = frame_->widget_delegate(); | 433 views::WidgetDelegate* delegate = frame_->widget_delegate(); |
434 if (delegate && delegate->ShouldShowWindowTitle()) { | 434 if (delegate && delegate->ShouldShowWindowTitle()) { |
435 gfx::Rect title_bounds = GetTitleBounds(title_font); | 435 gfx::Rect title_bounds = GetTitleBounds(title_font); |
436 SkColor title_color = frame_->IsMaximized() ? | 436 SkColor title_color = (frame_->IsMaximized() || frame_->IsFullscreen()) ? |
437 kMaximizedWindowTitleTextColor : kNonMaximizedWindowTitleTextColor; | 437 kMaximizedWindowTitleTextColor : kNonMaximizedWindowTitleTextColor; |
438 canvas->DrawStringInt(delegate->GetWindowTitle(), | 438 canvas->DrawStringInt(delegate->GetWindowTitle(), |
439 title_font, | 439 title_font, |
440 title_color, | 440 title_color, |
441 header_view_->GetMirroredXForRect(title_bounds), | 441 header_view_->GetMirroredXForRect(title_bounds), |
442 title_bounds.y(), | 442 title_bounds.y(), |
443 title_bounds.width(), | 443 title_bounds.width(), |
444 title_bounds.height(), | 444 title_bounds.height(), |
445 gfx::Canvas::NO_SUBPIXEL_RENDERING); | 445 gfx::Canvas::NO_SUBPIXEL_RENDERING); |
446 } | 446 } |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 // icon. Don't use |window_icon_| for this computation as it may be NULL. | 604 // icon. Don't use |window_icon_| for this computation as it may be NULL. |
605 int title_y = GetCaptionButtonContainerCenterY() - title_font.GetHeight() / 2; | 605 int title_y = GetCaptionButtonContainerCenterY() - title_font.GetHeight() / 2; |
606 return gfx::Rect( | 606 return gfx::Rect( |
607 title_x, | 607 title_x, |
608 std::max(0, title_y), | 608 std::max(0, title_y), |
609 std::max(0, caption_button_container_->x() - kTitleLogoSpacing - title_x), | 609 std::max(0, caption_button_container_->x() - kTitleLogoSpacing - title_x), |
610 title_font.GetHeight()); | 610 title_font.GetHeight()); |
611 } | 611 } |
612 | 612 |
613 } // namespace ash | 613 } // namespace ash |
OLD | NEW |