OLD | NEW |
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 "views/window/custom_frame_view.h" | 5 #include "views/window/custom_frame_view.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "grit/app_resources.h" | 8 #include "grit/app_resources.h" |
9 #include "grit/app_strings.h" | 9 #include "grit/app_strings.h" |
10 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 | 390 |
391 SkBitmap* frame_image = rb.GetBitmapNamed(frame_->IsActive() ? | 391 SkBitmap* frame_image = rb.GetBitmapNamed(frame_->IsActive() ? |
392 IDR_FRAME : IDR_FRAME_INACTIVE); | 392 IDR_FRAME : IDR_FRAME_INACTIVE); |
393 canvas->TileImageInt(*frame_image, 0, FrameBorderThickness(), width(), | 393 canvas->TileImageInt(*frame_image, 0, FrameBorderThickness(), width(), |
394 frame_image->height()); | 394 frame_image->height()); |
395 | 395 |
396 // The bottom of the titlebar actually comes from the top of the Client Edge | 396 // The bottom of the titlebar actually comes from the top of the Client Edge |
397 // graphic, with the actual client edge clipped off the bottom. | 397 // graphic, with the actual client edge clipped off the bottom. |
398 SkBitmap* titlebar_bottom = rb.GetBitmapNamed(IDR_APP_TOP_CENTER); | 398 SkBitmap* titlebar_bottom = rb.GetBitmapNamed(IDR_APP_TOP_CENTER); |
399 int edge_height = titlebar_bottom->height() - | 399 int edge_height = titlebar_bottom->height() - |
400 ShouldShowClientEdge() ? kClientEdgeThickness : 0; | 400 (ShouldShowClientEdge() ? kClientEdgeThickness : 0); |
401 canvas->TileImageInt(*titlebar_bottom, 0, | 401 canvas->TileImageInt(*titlebar_bottom, 0, |
402 frame_->client_view()->y() - edge_height, width(), edge_height); | 402 frame_->client_view()->y() - edge_height, width(), edge_height); |
403 } | 403 } |
404 | 404 |
405 void CustomFrameView::PaintTitleBar(gfx::Canvas* canvas) { | 405 void CustomFrameView::PaintTitleBar(gfx::Canvas* canvas) { |
406 WindowDelegate* d = frame_->window_delegate(); | 406 WindowDelegate* d = frame_->window_delegate(); |
407 | 407 |
408 // It seems like in some conditions we can be asked to paint after the window | 408 // It seems like in some conditions we can be asked to paint after the window |
409 // that contains us is WM_DESTROYed. At this point, our delegate is NULL. The | 409 // that contains us is WM_DESTROYed. At this point, our delegate is NULL. The |
410 // correct long term fix may be to shut down the RootView in WM_DESTROY. | 410 // correct long term fix may be to shut down the RootView in WM_DESTROY. |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 title_font_ = new gfx::Font(NativeWindowWin::GetWindowTitleFont()); | 571 title_font_ = new gfx::Font(NativeWindowWin::GetWindowTitleFont()); |
572 #elif defined(OS_LINUX) | 572 #elif defined(OS_LINUX) |
573 // TODO(ben): need to resolve what font this is. | 573 // TODO(ben): need to resolve what font this is. |
574 title_font_ = new gfx::Font(); | 574 title_font_ = new gfx::Font(); |
575 #endif | 575 #endif |
576 initialized = true; | 576 initialized = true; |
577 } | 577 } |
578 } | 578 } |
579 | 579 |
580 } // namespace views | 580 } // namespace views |
OLD | NEW |