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 "views/window/custom_frame_view.h" | 5 #include "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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 canvas->TileImageInt(*bottom, client_area_bounds.x(), client_area_bottom, | 469 canvas->TileImageInt(*bottom, client_area_bounds.x(), client_area_bottom, |
470 client_area_bounds.width(), bottom_right->height()); | 470 client_area_bounds.width(), bottom_right->height()); |
471 canvas->DrawBitmapInt(*bottom_left, | 471 canvas->DrawBitmapInt(*bottom_left, |
472 client_area_bounds.x() - bottom_left->width(), client_area_bottom); | 472 client_area_bounds.x() - bottom_left->width(), client_area_bottom); |
473 | 473 |
474 // Left. | 474 // Left. |
475 canvas->TileImageInt(*left, client_area_bounds.x() - left->width(), | 475 canvas->TileImageInt(*left, client_area_bounds.x() - left->width(), |
476 client_area_top, left->width(), client_area_height); | 476 client_area_top, left->width(), client_area_height); |
477 | 477 |
478 // Draw the toolbar color to fill in the edges. | 478 // Draw the toolbar color to fill in the edges. |
479 canvas->DrawRectInt(ResourceBundle::toolbar_color, | 479 canvas->DrawRect(ResourceBundle::toolbar_color, |
480 client_area_bounds.x() - 1, client_area_top - 1, | 480 gfx::Rect(client_area_bounds.x() - 1, |
481 client_area_bounds.width() + 1, client_area_bottom - client_area_top + 1); | 481 client_area_top - 1, |
| 482 client_area_bounds.width() + 1, |
| 483 client_area_bottom - client_area_top + 1)); |
482 } | 484 } |
483 | 485 |
484 void CustomFrameView::LayoutWindowControls() { | 486 void CustomFrameView::LayoutWindowControls() { |
485 close_button_->SetImageAlignment(ImageButton::ALIGN_LEFT, | 487 close_button_->SetImageAlignment(ImageButton::ALIGN_LEFT, |
486 ImageButton::ALIGN_BOTTOM); | 488 ImageButton::ALIGN_BOTTOM); |
487 int caption_y = CaptionButtonY(); | 489 int caption_y = CaptionButtonY(); |
488 bool is_maximized = frame_->IsMaximized(); | 490 bool is_maximized = frame_->IsMaximized(); |
489 // There should always be the same number of non-shadow pixels visible to the | 491 // There should always be the same number of non-shadow pixels visible to the |
490 // side of the caption buttons. In maximized mode we extend the rightmost | 492 // side of the caption buttons. In maximized mode we extend the rightmost |
491 // button to the screen corner to obey Fitts' Law. | 493 // button to the screen corner to obey Fitts' Law. |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 title_font_ = new gfx::Font(NativeWidgetWin::GetWindowTitleFont()); | 590 title_font_ = new gfx::Font(NativeWidgetWin::GetWindowTitleFont()); |
589 #elif defined(OS_LINUX) | 591 #elif defined(OS_LINUX) |
590 // TODO(ben): need to resolve what font this is. | 592 // TODO(ben): need to resolve what font this is. |
591 title_font_ = new gfx::Font(); | 593 title_font_ = new gfx::Font(); |
592 #endif | 594 #endif |
593 initialized = true; | 595 initialized = true; |
594 } | 596 } |
595 } | 597 } |
596 | 598 |
597 } // namespace views | 599 } // namespace views |
OLD | NEW |