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

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

Issue 9332006: ui/gfx: Make the first version of Canvas::TileImageInt take a gfx::Rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: put back the Peter's nits Created 8 years, 10 months 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 height() - bottom_edge->height(), center_width, 353 height() - bottom_edge->height(), center_width,
354 bottom_edge->height()), frame_color); 354 bottom_edge->height()), frame_color);
355 } 355 }
356 } 356 }
357 357
358 // Draw the theme frame. 358 // Draw the theme frame.
359 canvas->TileImageInt(*theme_frame, 0, 0, width(), theme_frame->height()); 359 canvas->TileImageInt(*theme_frame, 0, 0, width(), theme_frame->height());
360 360
361 // Top. 361 // Top.
362 canvas->DrawBitmapInt(*top_left_corner, 0, 0); 362 canvas->DrawBitmapInt(*top_left_corner, 0, 0);
363 canvas->TileImageInt(*top_edge, top_left_corner->width(), 0, 363 canvas->TileImage(*top_edge, gfx::Rect(top_left_corner->width(), 0,
364 width() - top_right_corner->width(), top_edge->height()); 364 width() - top_left_corner->width() - top_right_corner->width(),
365 top_edge->height());
365 canvas->DrawBitmapInt(*top_right_corner, 366 canvas->DrawBitmapInt(*top_right_corner,
366 width() - top_right_corner->width(), 0); 367 width() - top_right_corner->width(), 0);
367 368
368 // Right. 369 // Right.
369 canvas->TileImageInt(*right_edge, width() - right_edge->width(), 370 canvas->TileImageInt(*right_edge, width() - right_edge->width(),
370 top_right_corner->height(), right_edge->width(), 371 top_right_corner->height(), right_edge->width(),
371 height() - top_right_corner->height() - bottom_right_corner->height()); 372 height() - top_right_corner->height() - bottom_right_corner->height());
372 373
373 // Bottom. 374 // Bottom.
374 canvas->DrawBitmapInt(*bottom_right_corner, 375 canvas->DrawBitmapInt(*bottom_right_corner,
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 } 503 }
503 504
504 gfx::Rect AppPanelBrowserFrameView::CalculateClientAreaBounds(int width, 505 gfx::Rect AppPanelBrowserFrameView::CalculateClientAreaBounds(int width,
505 int height) const { 506 int height) const {
506 int top_height = NonClientTopBorderHeight(); 507 int top_height = NonClientTopBorderHeight();
507 int border_thickness = NonClientBorderThickness(); 508 int border_thickness = NonClientBorderThickness();
508 return gfx::Rect(border_thickness, top_height, 509 return gfx::Rect(border_thickness, top_height,
509 std::max(0, width - (2 * border_thickness)), 510 std::max(0, width - (2 * border_thickness)),
510 std::max(0, height - top_height - border_thickness)); 511 std::max(0, height - top_height - border_thickness));
511 } 512 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/find_bar_view.cc ('k') | chrome/browser/ui/views/frame/opaque_browser_frame_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698