| 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/glass_browser_frame_view.h" | 5 #include "chrome/browser/views/frame/glass_browser_frame_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/gfx/chrome_canvas.h" | 9 #include "chrome/common/gfx/chrome_canvas.h" |
| 10 #include "chrome/common/resource_bundle.h" | 10 #include "chrome/common/resource_bundle.h" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 // We'd like to use FrameBorderThickness() here, but the maximized Aero glass | 253 // We'd like to use FrameBorderThickness() here, but the maximized Aero glass |
| 254 // frame has a 0 frame border around most edges and a CXSIZEFRAME-thick border | 254 // frame has a 0 frame border around most edges and a CXSIZEFRAME-thick border |
| 255 // at the top (see AeroGlassFrame::OnGetMinMaxInfo()). | 255 // at the top (see AeroGlassFrame::OnGetMinMaxInfo()). |
| 256 return GetSystemMetrics(SM_CXSIZEFRAME) + | 256 return GetSystemMetrics(SM_CXSIZEFRAME) + |
| 257 (browser_view_->IsMaximized() ? 0 : kNonClientRestoredExtraThickness); | 257 (browser_view_->IsMaximized() ? 0 : kNonClientRestoredExtraThickness); |
| 258 } | 258 } |
| 259 | 259 |
| 260 void GlassBrowserFrameView::PaintDistributorLogo(ChromeCanvas* canvas) { | 260 void GlassBrowserFrameView::PaintDistributorLogo(ChromeCanvas* canvas) { |
| 261 // The distributor logo is only painted when the frame is not maximized and | 261 // The distributor logo is only painted when the frame is not maximized and |
| 262 // when we actually have a logo. | 262 // when we actually have a logo. |
| 263 if (!frame_->IsMaximized() && distributor_logo_) { | 263 if (!frame_->IsMaximized() && distributor_logo_ && |
| 264 browser_view_->ShouldShowDistributorLogo()) { |
| 264 // NOTE: We don't mirror the logo placement here because the outer frame | 265 // NOTE: We don't mirror the logo placement here because the outer frame |
| 265 // itself isn't mirrored in RTL. This is a bug; if it is fixed, this should | 266 // itself isn't mirrored in RTL. This is a bug; if it is fixed, this should |
| 266 // be mirrored as in opaque_non_client_view.cc. | 267 // be mirrored as in opaque_non_client_view.cc. |
| 267 canvas->DrawBitmapInt(*distributor_logo_, logo_bounds_.x(), | 268 canvas->DrawBitmapInt(*distributor_logo_, logo_bounds_.x(), |
| 268 logo_bounds_.y()); | 269 logo_bounds_.y()); |
| 269 } | 270 } |
| 270 } | 271 } |
| 271 | 272 |
| 272 void GlassBrowserFrameView::PaintToolbarBackground(ChromeCanvas* canvas) { | 273 void GlassBrowserFrameView::PaintToolbarBackground(ChromeCanvas* canvas) { |
| 273 gfx::Rect toolbar_bounds(browser_view_->GetToolbarBounds()); | 274 gfx::Rect toolbar_bounds(browser_view_->GetToolbarBounds()); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 resources_->GetPartBitmap(FRAME_CLIENT_EDGE_BOTTOM_LEFT); | 331 resources_->GetPartBitmap(FRAME_CLIENT_EDGE_BOTTOM_LEFT); |
| 331 canvas->DrawBitmapInt(*bottom_left, | 332 canvas->DrawBitmapInt(*bottom_left, |
| 332 client_area_bounds.x() - bottom_left->width(), client_area_bottom); | 333 client_area_bounds.x() - bottom_left->width(), client_area_bottom); |
| 333 | 334 |
| 334 SkBitmap* left = resources_->GetPartBitmap(FRAME_CLIENT_EDGE_LEFT); | 335 SkBitmap* left = resources_->GetPartBitmap(FRAME_CLIENT_EDGE_LEFT); |
| 335 canvas->TileImageInt(*left, client_area_bounds.x() - left->width(), | 336 canvas->TileImageInt(*left, client_area_bounds.x() - left->width(), |
| 336 client_area_top, left->width(), client_area_height); | 337 client_area_top, left->width(), client_area_height); |
| 337 } | 338 } |
| 338 | 339 |
| 339 void GlassBrowserFrameView::LayoutDistributorLogo() { | 340 void GlassBrowserFrameView::LayoutDistributorLogo() { |
| 340 if (distributor_logo_) { | 341 if (distributor_logo_ && browser_view_->ShouldShowDistributorLogo()) { |
| 341 logo_bounds_.SetRect(frame_->GetMinimizeButtonOffset() - | 342 logo_bounds_.SetRect(frame_->GetMinimizeButtonOffset() - |
| 342 distributor_logo_->width() - kLogoCaptionSpacing, kLogoTopSpacing, | 343 distributor_logo_->width() - kLogoCaptionSpacing, kLogoTopSpacing, |
| 343 distributor_logo_->width(), distributor_logo_->height()); | 344 distributor_logo_->width(), distributor_logo_->height()); |
| 344 } else { | 345 } else { |
| 345 logo_bounds_.SetRect(frame_->GetMinimizeButtonOffset(), kLogoTopSpacing, 0, | 346 logo_bounds_.SetRect(frame_->GetMinimizeButtonOffset(), kLogoTopSpacing, 0, |
| 346 0); | 347 0); |
| 347 } | 348 } |
| 348 } | 349 } |
| 349 | 350 |
| 350 void GlassBrowserFrameView::LayoutOTRAvatar() { | 351 void GlassBrowserFrameView::LayoutOTRAvatar() { |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 resources_ = new GlassBrowserWindowResources; | 424 resources_ = new GlassBrowserWindowResources; |
| 424 | 425 |
| 425 #if defined(GOOGLE_CHROME_BUILD) | 426 #if defined(GOOGLE_CHROME_BUILD) |
| 426 distributor_logo_ = ResourceBundle::GetSharedInstance(). | 427 distributor_logo_ = ResourceBundle::GetSharedInstance(). |
| 427 GetBitmapNamed(IDR_DISTRIBUTOR_LOGO); | 428 GetBitmapNamed(IDR_DISTRIBUTOR_LOGO); |
| 428 #endif | 429 #endif |
| 429 | 430 |
| 430 initialized = true; | 431 initialized = true; |
| 431 } | 432 } |
| 432 } | 433 } |
| OLD | NEW |