OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ui/views/window/custom_frame_view.h" | 5 #include "ui/views/window/custom_frame_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "grit/ui_resources.h" | 10 #include "grit/ui_resources.h" |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 canvas->TileImageInt(*bottom, client_area_bounds.x(), client_area_bottom, | 477 canvas->TileImageInt(*bottom, client_area_bounds.x(), client_area_bottom, |
478 client_area_bounds.width(), bottom_right->height()); | 478 client_area_bounds.width(), bottom_right->height()); |
479 canvas->DrawBitmapInt(*bottom_left, | 479 canvas->DrawBitmapInt(*bottom_left, |
480 client_area_bounds.x() - bottom_left->width(), client_area_bottom); | 480 client_area_bounds.x() - bottom_left->width(), client_area_bottom); |
481 | 481 |
482 // Left. | 482 // Left. |
483 canvas->TileImageInt(*left, client_area_bounds.x() - left->width(), | 483 canvas->TileImageInt(*left, client_area_bounds.x() - left->width(), |
484 client_area_top, left->width(), client_area_height); | 484 client_area_top, left->width(), client_area_height); |
485 | 485 |
486 // Draw the toolbar color to fill in the edges. | 486 // Draw the toolbar color to fill in the edges. |
487 canvas->DrawRect(gfx::Rect(client_area_bounds.x() - 1, client_area_top - 1, | 487 canvas->DrawRectInt(ResourceBundle::toolbar_color, |
488 client_area_bounds.width() + 1, | 488 client_area_bounds.x() - 1, client_area_top - 1, |
489 client_area_bottom - client_area_top + 1), | 489 client_area_bounds.width() + 1, client_area_bottom - client_area_top + 1); |
490 ui::ResourceBundle::toolbar_color); | |
491 } | 490 } |
492 | 491 |
493 void CustomFrameView::LayoutWindowControls() { | 492 void CustomFrameView::LayoutWindowControls() { |
494 close_button_->SetImageAlignment(ImageButton::ALIGN_LEFT, | 493 close_button_->SetImageAlignment(ImageButton::ALIGN_LEFT, |
495 ImageButton::ALIGN_BOTTOM); | 494 ImageButton::ALIGN_BOTTOM); |
496 int caption_y = CaptionButtonY(); | 495 int caption_y = CaptionButtonY(); |
497 bool is_maximized = frame_->IsMaximized(); | 496 bool is_maximized = frame_->IsMaximized(); |
498 // There should always be the same number of non-shadow pixels visible to the | 497 // There should always be the same number of non-shadow pixels visible to the |
499 // side of the caption buttons. In maximized mode we extend the rightmost | 498 // side of the caption buttons. In maximized mode we extend the rightmost |
500 // button to the screen corner to obey Fitts' Law. | 499 // button to the screen corner to obey Fitts' Law. |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 title_font_ = new gfx::Font(NativeWidgetWin::GetWindowTitleFont()); | 596 title_font_ = new gfx::Font(NativeWidgetWin::GetWindowTitleFont()); |
598 #elif defined(OS_LINUX) | 597 #elif defined(OS_LINUX) |
599 // TODO(ben): need to resolve what font this is. | 598 // TODO(ben): need to resolve what font this is. |
600 title_font_ = new gfx::Font(); | 599 title_font_ = new gfx::Font(); |
601 #endif | 600 #endif |
602 initialized = true; | 601 initialized = true; |
603 } | 602 } |
604 } | 603 } |
605 | 604 |
606 } // namespace views | 605 } // namespace views |
OLD | NEW |