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

Unified Diff: chrome/browser/views/frame/opaque_browser_frame_view.cc

Issue 118058: Fix opaque app mode display.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « app/resources/app_top_right.png ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/frame/opaque_browser_frame_view.cc
===================================================================
--- chrome/browser/views/frame/opaque_browser_frame_view.cc (revision 17327)
+++ chrome/browser/views/frame/opaque_browser_frame_view.cc (working copy)
@@ -758,6 +758,8 @@
int client_area_top = frame_->GetWindow()->GetClientView()->y();
gfx::Rect client_area_bounds = CalculateClientAreaBounds(width(), height());
+ SkColor toolbar_color = tp->GetColor(BrowserThemeProvider::COLOR_TOOLBAR);
+
if (browser_view_->IsToolbarVisible()) {
// The client edges start below the toolbar or its corner images, whichever
// is shorter.
@@ -768,18 +770,12 @@
} else {
// The toolbar isn't going to draw a client edge for us, so draw one
// ourselves.
- // This next calculation is necessary because the top center bitmap is
- // shorter than the top left and right bitmaps. We need their top edges to
- // line up, and we need the left and right edges to start below the corners'
- // bottoms.
SkBitmap* top_left = tp->GetBitmapNamed(IDR_APP_TOP_LEFT);
SkBitmap* top_center = tp->GetBitmapNamed(IDR_APP_TOP_CENTER);
SkBitmap* top_right = tp->GetBitmapNamed(IDR_APP_TOP_RIGHT);
int top_edge_y = client_area_top - top_center->height();
+ int height = client_area_top - top_edge_y;
- client_area_top = std::min(top_edge_y + top_left->height(),
- height() - NonClientBorderThickness());
- int height = client_area_top - top_edge_y;
canvas->DrawBitmapInt(*top_left, 0, 0, top_left->width(), height,
client_area_bounds.x() - top_left->width(), top_edge_y,
top_left->width(), height, false);
@@ -788,6 +784,13 @@
canvas->DrawBitmapInt(*top_right, 0, 0, top_right->width(), height,
client_area_bounds.right(), top_edge_y,
top_right->width(), height, false);
+
+ // Draw the toolbar color across the top edge.
+ canvas->DrawLineInt(toolbar_color,
+ client_area_bounds.x() - kClientEdgeThickness,
+ client_area_top - kClientEdgeThickness,
+ client_area_bounds.right() + kClientEdgeThickness,
+ client_area_top - kClientEdgeThickness);
}
int client_area_bottom =
@@ -796,7 +799,6 @@
// Draw the toolbar color so that the one pixel areas down the sides
// show the right color even if not covered by the toolbar image.
- SkColor toolbar_color = tp->GetColor(BrowserThemeProvider::COLOR_TOOLBAR);
canvas->DrawLineInt(toolbar_color,
client_area_bounds.x() - kClientEdgeThickness,
client_area_top,
« no previous file with comments | « app/resources/app_top_right.png ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698