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

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

Issue 8476019: ui/gfx: Convert Canvas::DrawRectInt() to use gfx::Rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reland - WHAT HERE could have broken media_unittests???? Created 9 years 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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 canvas->TileImageInt(*bottom, client_area_bounds.x(), client_area_bottom, 443 canvas->TileImageInt(*bottom, client_area_bounds.x(), client_area_bottom,
444 client_area_bounds.width(), bottom_right->height()); 444 client_area_bounds.width(), bottom_right->height());
445 canvas->DrawBitmapInt(*bottom_left, 445 canvas->DrawBitmapInt(*bottom_left,
446 client_area_bounds.x() - bottom_left->width(), client_area_bottom); 446 client_area_bounds.x() - bottom_left->width(), client_area_bottom);
447 447
448 // Left. 448 // Left.
449 canvas->TileImageInt(*left, client_area_bounds.x() - left->width(), 449 canvas->TileImageInt(*left, client_area_bounds.x() - left->width(),
450 client_area_top, left->width(), client_area_height); 450 client_area_top, left->width(), client_area_height);
451 451
452 // Draw the toolbar color to fill in the edges. 452 // Draw the toolbar color to fill in the edges.
453 canvas->DrawRectInt(ResourceBundle::toolbar_color, 453 canvas->DrawRect(gfx::Rect(client_area_bounds.x() - kClientEdgeThickness,
454 client_area_bounds.x() - kClientEdgeThickness, 454 client_area_top - kClientEdgeThickness,
455 client_area_top - kClientEdgeThickness, 455 client_area_bounds.width() + kClientEdgeThickness,
456 client_area_bounds.width() + kClientEdgeThickness, 456 client_area_bottom - client_area_top + kClientEdgeThickness),
457 client_area_bottom - client_area_top + kClientEdgeThickness); 457 ui::ResourceBundle::toolbar_color);
458 } 458 }
459 459
460 void AppPanelBrowserFrameView::LayoutWindowControls() { 460 void AppPanelBrowserFrameView::LayoutWindowControls() {
461 close_button_->SetImageAlignment(views::ImageButton::ALIGN_LEFT, 461 close_button_->SetImageAlignment(views::ImageButton::ALIGN_LEFT,
462 views::ImageButton::ALIGN_BOTTOM); 462 views::ImageButton::ALIGN_BOTTOM);
463 bool is_maximized = frame()->IsMaximized(); 463 bool is_maximized = frame()->IsMaximized();
464 // There should always be the same number of non-border pixels visible to the 464 // There should always be the same number of non-border pixels visible to the
465 // side of the close button. In maximized mode we extend the button to the 465 // side of the close button. In maximized mode we extend the button to the
466 // screen corner to obey Fitts' Law. 466 // screen corner to obey Fitts' Law.
467 int right_extra_width = is_maximized ? kCloseButtonFrameBorderSpacing : 0; 467 int right_extra_width = is_maximized ? kCloseButtonFrameBorderSpacing : 0;
(...skipping 28 matching lines...) Expand all
496 } 496 }
497 497
498 gfx::Rect AppPanelBrowserFrameView::CalculateClientAreaBounds(int width, 498 gfx::Rect AppPanelBrowserFrameView::CalculateClientAreaBounds(int width,
499 int height) const { 499 int height) const {
500 int top_height = NonClientTopBorderHeight(); 500 int top_height = NonClientTopBorderHeight();
501 int border_thickness = NonClientBorderThickness(); 501 int border_thickness = NonClientBorderThickness();
502 return gfx::Rect(border_thickness, top_height, 502 return gfx::Rect(border_thickness, top_height,
503 std::max(0, width - (2 * border_thickness)), 503 std::max(0, width - (2 * border_thickness)),
504 std::max(0, height - top_height - border_thickness)); 504 std::max(0, height - top_height - border_thickness));
505 } 505 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc ('k') | chrome/browser/ui/views/tabs/tab.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698