Index: chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc |
diff --git a/chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc b/chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc |
index d46e92d0e8f956b8c6c0e0632f3891de53743237..668a1576ab7d97892d62d97ee47358db001c25b5 100644 |
--- a/chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc |
+++ b/chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc |
@@ -340,18 +340,28 @@ void AppPanelBrowserFrameView::PaintRestoredFrameBorder(gfx::Canvas* canvas) { |
// Fill with the frame color first so we have a constant background for |
// areas not covered by the theme image. |
- canvas->FillRectInt(frame_color, 0, 0, width(), theme_frame->height()); |
- // Now fill down the sides. |
- canvas->FillRectInt(frame_color, 0, theme_frame->height(), left_edge->width(), |
- height() - theme_frame->height()); |
- canvas->FillRectInt(frame_color, width() - right_edge->width(), |
- theme_frame->height(), right_edge->width(), |
- height() - theme_frame->height()); |
- // Now fill the bottom area. |
- canvas->FillRectInt(frame_color, left_edge->width(), |
- height() - bottom_edge->height(), |
- width() - left_edge->width() - right_edge->width(), |
- bottom_edge->height()); |
+ canvas->FillRect(frame_color, |
+ gfx::Rect(0, 0, width(), theme_frame->height())); |
+ |
+ int remaining_height = height() - theme_frame->height(); |
+ if (remaining_height > 0) { |
+ // Now fill down the sides. |
+ canvas->FillRect(frame_color, |
+ gfx::Rect(0, theme_frame->height(), left_edge->width(), |
+ remaining_height)); |
+ canvas->FillRect(frame_color, |
+ gfx::Rect(width() - right_edge->width(), |
+ theme_frame->height(), right_edge->width(), |
+ remaining_height)); |
+ int center_width = width() - left_edge->width() - right_edge->width(); |
+ if (center_width > 0) { |
+ // Now fill the bottom area. |
+ canvas->FillRect(frame_color, |
+ gfx::Rect(left_edge->width(), |
+ height() - bottom_edge->height(), |
+ center_width, bottom_edge->height())); |
+ } |
+ } |
// Draw the theme frame. |
canvas->TileImageInt(*theme_frame, 0, 0, width(), theme_frame->height()); |