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 "chrome/browser/ui/views/frame/app_panel_browser_frame_view.h" | 5 #include "chrome/browser/ui/views/frame/app_panel_browser_frame_view.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/ui/views/frame/browser_frame.h" | 9 #include "chrome/browser/ui/views/frame/browser_frame.h" |
10 #include "chrome/browser/ui/views/frame/browser_view.h" | 10 #include "chrome/browser/ui/views/frame/browser_view.h" |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 canvas->TileImageInt(*bottom, client_area_bounds.x(), client_area_bottom, | 456 canvas->TileImageInt(*bottom, client_area_bounds.x(), client_area_bottom, |
457 client_area_bounds.width(), bottom_right->height()); | 457 client_area_bounds.width(), bottom_right->height()); |
458 canvas->DrawBitmapInt(*bottom_left, | 458 canvas->DrawBitmapInt(*bottom_left, |
459 client_area_bounds.x() - bottom_left->width(), client_area_bottom); | 459 client_area_bounds.x() - bottom_left->width(), client_area_bottom); |
460 | 460 |
461 // Left. | 461 // Left. |
462 canvas->TileImageInt(*left, client_area_bounds.x() - left->width(), | 462 canvas->TileImageInt(*left, client_area_bounds.x() - left->width(), |
463 client_area_top, left->width(), client_area_height); | 463 client_area_top, left->width(), client_area_height); |
464 | 464 |
465 // Draw the toolbar color to fill in the edges. | 465 // Draw the toolbar color to fill in the edges. |
466 canvas->DrawRectInt(ResourceBundle::toolbar_color, | 466 canvas->DrawRect(ResourceBundle::toolbar_color, |
467 client_area_bounds.x() - kClientEdgeThickness, | 467 gfx::Rect(client_area_bounds.x() - kClientEdgeThickness, |
468 client_area_top - kClientEdgeThickness, | 468 client_area_top - kClientEdgeThickness, |
469 client_area_bounds.width() + kClientEdgeThickness, | 469 client_area_bounds.width() + kClientEdgeThickness, |
470 client_area_bottom - client_area_top + kClientEdgeThickness); | 470 client_area_bottom - client_area_top + kClientEdgeThickness)); |
471 } | 471 } |
472 | 472 |
473 void AppPanelBrowserFrameView::LayoutWindowControls() { | 473 void AppPanelBrowserFrameView::LayoutWindowControls() { |
474 close_button_->SetImageAlignment(views::ImageButton::ALIGN_LEFT, | 474 close_button_->SetImageAlignment(views::ImageButton::ALIGN_LEFT, |
475 views::ImageButton::ALIGN_BOTTOM); | 475 views::ImageButton::ALIGN_BOTTOM); |
476 bool is_maximized = frame_->IsMaximized(); | 476 bool is_maximized = frame_->IsMaximized(); |
477 // There should always be the same number of non-border pixels visible to the | 477 // There should always be the same number of non-border pixels visible to the |
478 // side of the close button. In maximized mode we extend the button to the | 478 // side of the close button. In maximized mode we extend the button to the |
479 // screen corner to obey Fitts' Law. | 479 // screen corner to obey Fitts' Law. |
480 int right_extra_width = is_maximized ? kCloseButtonFrameBorderSpacing : 0; | 480 int right_extra_width = is_maximized ? kCloseButtonFrameBorderSpacing : 0; |
(...skipping 28 matching lines...) Expand all Loading... |
509 } | 509 } |
510 | 510 |
511 gfx::Rect AppPanelBrowserFrameView::CalculateClientAreaBounds(int width, | 511 gfx::Rect AppPanelBrowserFrameView::CalculateClientAreaBounds(int width, |
512 int height) const { | 512 int height) const { |
513 int top_height = NonClientTopBorderHeight(); | 513 int top_height = NonClientTopBorderHeight(); |
514 int border_thickness = NonClientBorderThickness(); | 514 int border_thickness = NonClientBorderThickness(); |
515 return gfx::Rect(border_thickness, top_height, | 515 return gfx::Rect(border_thickness, top_height, |
516 std::max(0, width - (2 * border_thickness)), | 516 std::max(0, width - (2 * border_thickness)), |
517 std::max(0, height - top_height - border_thickness)); | 517 std::max(0, height - top_height - border_thickness)); |
518 } | 518 } |
OLD | NEW |