Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Side by Side Diff: chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc

Issue 8405002: ui/gfx: Convert Canvas::FillRectInt() to use gfx::Rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 if (ShouldPaintAsActive()) { 333 if (ShouldPaintAsActive()) {
334 theme_frame = rb.GetBitmapNamed(IDR_FRAME_APP_PANEL); 334 theme_frame = rb.GetBitmapNamed(IDR_FRAME_APP_PANEL);
335 frame_color = ResourceBundle::frame_color_app_panel; 335 frame_color = ResourceBundle::frame_color_app_panel;
336 } else { 336 } else {
337 theme_frame = rb.GetBitmapNamed(IDR_FRAME_APP_PANEL); // TODO 337 theme_frame = rb.GetBitmapNamed(IDR_FRAME_APP_PANEL); // TODO
338 frame_color = ResourceBundle::frame_color_app_panel_inactive; 338 frame_color = ResourceBundle::frame_color_app_panel_inactive;
339 } 339 }
340 340
341 // Fill with the frame color first so we have a constant background for 341 // Fill with the frame color first so we have a constant background for
342 // areas not covered by the theme image. 342 // areas not covered by the theme image.
343 canvas->FillRectInt(frame_color, 0, 0, width(), theme_frame->height()); 343 canvas->FillRect(frame_color,
344 gfx::Rect(0, 0, width(), theme_frame->height()));
344 // Now fill down the sides. 345 // Now fill down the sides.
345 canvas->FillRectInt(frame_color, 0, theme_frame->height(), left_edge->width(), 346 canvas->FillRect(frame_color,
346 height() - theme_frame->height()); 347 gfx::Rect(0, theme_frame->height(), left_edge->width(),
347 canvas->FillRectInt(frame_color, width() - right_edge->width(), 348 height() - theme_frame->height()));
348 theme_frame->height(), right_edge->width(), 349 canvas->FillRect(frame_color,
349 height() - theme_frame->height()); 350 gfx::Rect(width() - right_edge->width(),
351 theme_frame->height(), right_edge->width(),
352 height() - theme_frame->height()));
350 // Now fill the bottom area. 353 // Now fill the bottom area.
351 canvas->FillRectInt(frame_color, left_edge->width(), 354 canvas->FillRect(frame_color,
352 height() - bottom_edge->height(), 355 gfx::Rect(left_edge->width(),
353 width() - left_edge->width() - right_edge->width(), 356 height() - bottom_edge->height(),
354 bottom_edge->height()); 357 width() - left_edge->width() - right_edge->width(),
358 bottom_edge->height()));
355 359
356 // Draw the theme frame. 360 // Draw the theme frame.
357 canvas->TileImageInt(*theme_frame, 0, 0, width(), theme_frame->height()); 361 canvas->TileImageInt(*theme_frame, 0, 0, width(), theme_frame->height());
358 362
359 // Top. 363 // Top.
360 canvas->DrawBitmapInt(*top_left_corner, 0, 0); 364 canvas->DrawBitmapInt(*top_left_corner, 0, 0);
361 canvas->TileImageInt(*top_edge, top_left_corner->width(), 0, 365 canvas->TileImageInt(*top_edge, top_left_corner->width(), 0,
362 width() - top_right_corner->width(), top_edge->height()); 366 width() - top_right_corner->width(), top_edge->height());
363 canvas->DrawBitmapInt(*top_right_corner, 367 canvas->DrawBitmapInt(*top_right_corner,
364 width() - top_right_corner->width(), 0); 368 width() - top_right_corner->width(), 0);
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 } 503 }
500 504
501 gfx::Rect AppPanelBrowserFrameView::CalculateClientAreaBounds(int width, 505 gfx::Rect AppPanelBrowserFrameView::CalculateClientAreaBounds(int width,
502 int height) const { 506 int height) const {
503 int top_height = NonClientTopBorderHeight(); 507 int top_height = NonClientTopBorderHeight();
504 int border_thickness = NonClientBorderThickness(); 508 int border_thickness = NonClientBorderThickness();
505 return gfx::Rect(border_thickness, top_height, 509 return gfx::Rect(border_thickness, top_height,
506 std::max(0, width - (2 * border_thickness)), 510 std::max(0, width - (2 * border_thickness)),
507 std::max(0, height - top_height - border_thickness)); 511 std::max(0, height - top_height - border_thickness));
508 } 512 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698