| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/views/frame/aero_glass_non_client_view.h" | 5 #include "chrome/browser/views/frame/aero_glass_non_client_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/views/frame/browser_view.h" | 7 #include "chrome/browser/views/frame/browser_view.h" |
| 8 #include "chrome/browser/views/tabs/tab_strip.h" | 8 #include "chrome/browser/views/tabs/tab_strip.h" |
| 9 #include "chrome/common/resource_bundle.h" | 9 #include "chrome/common/resource_bundle.h" |
| 10 #include "chrome/views/client_view.h" | 10 #include "chrome/views/client_view.h" |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 | 264 |
| 265 SkBitmap otr_avatar_icon = browser_view_->GetOTRAvatarIcon(); | 265 SkBitmap otr_avatar_icon = browser_view_->GetOTRAvatarIcon(); |
| 266 canvas->DrawBitmapInt(otr_avatar_icon, 0, | 266 canvas->DrawBitmapInt(otr_avatar_icon, 0, |
| 267 (otr_avatar_icon.height() - otr_avatar_bounds_.height()) / 2, | 267 (otr_avatar_icon.height() - otr_avatar_bounds_.height()) / 2, |
| 268 otr_avatar_bounds_.width(), otr_avatar_bounds_.height(), | 268 otr_avatar_bounds_.width(), otr_avatar_bounds_.height(), |
| 269 MirroredLeftPointForRect(otr_avatar_bounds_), otr_avatar_bounds_.y(), | 269 MirroredLeftPointForRect(otr_avatar_bounds_), otr_avatar_bounds_.y(), |
| 270 otr_avatar_bounds_.width(), otr_avatar_bounds_.height(), false); | 270 otr_avatar_bounds_.width(), otr_avatar_bounds_.height(), false); |
| 271 } | 271 } |
| 272 | 272 |
| 273 void AeroGlassNonClientView::PaintClientEdge(ChromeCanvas* canvas) { | 273 void AeroGlassNonClientView::PaintClientEdge(ChromeCanvas* canvas) { |
| 274 // The client edges start below the toolbar upper corner images regardless |
| 275 // of how tall the toolbar itself is. |
| 274 int client_area_top = | 276 int client_area_top = |
| 275 frame_->client_view()->y() + browser_view_->GetToolbarBounds().bottom(); | 277 frame_->client_view()->y() + browser_view_->GetToolbarBounds().y() + |
| 278 resources_->GetPartBitmap(FRAME_CLIENT_EDGE_TOP_LEFT)->height(); |
| 279 |
| 276 gfx::Rect client_area_bounds = CalculateClientAreaBounds(width(), height()); | 280 gfx::Rect client_area_bounds = CalculateClientAreaBounds(width(), height()); |
| 277 // The toolbar draws a client edge along its own bottom edge when it's visible | |
| 278 // and in normal mode. However, it only draws this for the width of the | |
| 279 // actual client area, leaving a gap at the left and right edges: | |
| 280 // | |
| 281 // | Toolbar | <-- part of toolbar | |
| 282 // ----- (toolbar client edge) ----- <-- gap | |
| 283 // | Client area | <-- right client edge | |
| 284 // | |
| 285 // To address this, we extend the left and right client edges up to fill the | |
| 286 // gap, by pretending the toolbar is shorter than it really is. | |
| 287 client_area_top -= kClientEdgeThickness; | |
| 288 | |
| 289 int client_area_bottom = | 281 int client_area_bottom = |
| 290 std::max(client_area_top, height() - NonClientBorderThickness()); | 282 std::max(client_area_top, height() - NonClientBorderThickness()); |
| 291 int client_area_height = client_area_bottom - client_area_top; | 283 int client_area_height = client_area_bottom - client_area_top; |
| 292 SkBitmap* right = resources_->GetPartBitmap(FRAME_CLIENT_EDGE_RIGHT); | 284 SkBitmap* right = resources_->GetPartBitmap(FRAME_CLIENT_EDGE_RIGHT); |
| 293 canvas->TileImageInt(*right, client_area_bounds.right(), client_area_top, | 285 canvas->TileImageInt(*right, client_area_bounds.right(), client_area_top, |
| 294 right->width(), client_area_height); | 286 right->width(), client_area_height); |
| 295 | 287 |
| 296 canvas->DrawBitmapInt( | 288 canvas->DrawBitmapInt( |
| 297 *resources_->GetPartBitmap(FRAME_CLIENT_EDGE_BOTTOM_RIGHT), | 289 *resources_->GetPartBitmap(FRAME_CLIENT_EDGE_BOTTOM_RIGHT), |
| 298 client_area_bounds.right(), client_area_bottom); | 290 client_area_bounds.right(), client_area_bottom); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 | 340 |
| 349 #if defined(GOOGLE_CHROME_BUILD) | 341 #if defined(GOOGLE_CHROME_BUILD) |
| 350 distributor_logo_ = ResourceBundle::GetSharedInstance(). | 342 distributor_logo_ = ResourceBundle::GetSharedInstance(). |
| 351 GetBitmapNamed(IDR_DISTRIBUTOR_LOGO); | 343 GetBitmapNamed(IDR_DISTRIBUTOR_LOGO); |
| 352 #endif | 344 #endif |
| 353 | 345 |
| 354 initialized = true; | 346 initialized = true; |
| 355 } | 347 } |
| 356 } | 348 } |
| 357 | 349 |
| OLD | NEW |