OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/views/constrained_window_win.h" | 5 #include "chrome/browser/views/constrained_window_win.h" |
6 | 6 |
7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
8 #include "app/win_util.h" | 8 #include "app/win_util.h" |
9 #include "chrome/app/chrome_dll_resource.h" | 9 #include "chrome/app/chrome_dll_resource.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 width() - kFrameBorderThickness - close_button_size.width(), | 520 width() - kFrameBorderThickness - close_button_size.width(), |
521 kFrameShadowThickness, close_button_size.width(), | 521 kFrameShadowThickness, close_button_size.width(), |
522 close_button_size.height()); | 522 close_button_size.height()); |
523 } | 523 } |
524 | 524 |
525 void ConstrainedWindowFrameView::LayoutTitleBar() { | 525 void ConstrainedWindowFrameView::LayoutTitleBar() { |
526 // The window title is based on the calculated icon position, even though' | 526 // The window title is based on the calculated icon position, even though' |
527 // there is no icon in constrained windows. | 527 // there is no icon in constrained windows. |
528 gfx::Rect icon_bounds(IconBounds()); | 528 gfx::Rect icon_bounds(IconBounds()); |
529 int title_x = icon_bounds.x(); | 529 int title_x = icon_bounds.x(); |
530 int title_height = title_font_->height(); | 530 int title_height = title_font_->GetHeight(); |
531 // We bias the title position so that when the difference between the icon and | 531 // We bias the title position so that when the difference between the icon and |
532 // title heights is odd, the extra pixel of the title is above the vertical | 532 // title heights is odd, the extra pixel of the title is above the vertical |
533 // midline rather than below. This compensates for how the icon is already | 533 // midline rather than below. This compensates for how the icon is already |
534 // biased downwards (see IconBounds()) and helps prevent descenders on the | 534 // biased downwards (see IconBounds()) and helps prevent descenders on the |
535 // title from overlapping the 3D edge at the bottom of the titlebar. | 535 // title from overlapping the 3D edge at the bottom of the titlebar. |
536 title_bounds_.SetRect(title_x, | 536 title_bounds_.SetRect(title_x, |
537 icon_bounds.y() + ((icon_bounds.height() - title_height - 1) / 2), | 537 icon_bounds.y() + ((icon_bounds.height() - title_height - 1) / 2), |
538 std::max(0, close_button_->x() - kTitleCaptionSpacing - title_x), | 538 std::max(0, close_button_->x() - kTitleCaptionSpacing - title_x), |
539 title_height); | 539 title_height); |
540 } | 540 } |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 | 677 |
678 | 678 |
679 // static | 679 // static |
680 ConstrainedWindow* ConstrainedWindow::CreateConstrainedDialog( | 680 ConstrainedWindow* ConstrainedWindow::CreateConstrainedDialog( |
681 TabContents* parent, | 681 TabContents* parent, |
682 views::WindowDelegate* window_delegate) { | 682 views::WindowDelegate* window_delegate) { |
683 ConstrainedWindowWin* window = new ConstrainedWindowWin(parent, | 683 ConstrainedWindowWin* window = new ConstrainedWindowWin(parent, |
684 window_delegate); | 684 window_delegate); |
685 return window; | 685 return window; |
686 } | 686 } |
OLD | NEW |