OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "gfx/canvas.h" | 10 #include "gfx/canvas.h" |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 | 406 |
407 void CustomFrameView::PaintTitleBar(gfx::Canvas* canvas) { | 407 void CustomFrameView::PaintTitleBar(gfx::Canvas* canvas) { |
408 WindowDelegate* d = frame_->GetDelegate(); | 408 WindowDelegate* d = frame_->GetDelegate(); |
409 | 409 |
410 // It seems like in some conditions we can be asked to paint after the window | 410 // It seems like in some conditions we can be asked to paint after the window |
411 // that contains us is WM_DESTROYed. At this point, our delegate is NULL. The | 411 // that contains us is WM_DESTROYed. At this point, our delegate is NULL. The |
412 // correct long term fix may be to shut down the RootView in WM_DESTROY. | 412 // correct long term fix may be to shut down the RootView in WM_DESTROY. |
413 if (!d) | 413 if (!d) |
414 return; | 414 return; |
415 | 415 |
416 canvas->DrawStringInt(d->GetWindowTitle(), *title_font_, SK_ColorWHITE, | 416 canvas->DrawStringInt(WideToUTF16Hack(d->GetWindowTitle()), *title_font_, |
417 MirroredLeftPointForRect(title_bounds_), title_bounds_.y(), | 417 SK_ColorWHITE, MirroredLeftPointForRect(title_bounds_), |
418 title_bounds_.width(), title_bounds_.height()); | 418 title_bounds_.y(), title_bounds_.width(), |
| 419 title_bounds_.height()); |
419 } | 420 } |
420 | 421 |
421 void CustomFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) { | 422 void CustomFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) { |
422 gfx::Rect client_area_bounds = frame_->GetClientView()->bounds(); | 423 gfx::Rect client_area_bounds = frame_->GetClientView()->bounds(); |
423 int client_area_top = client_area_bounds.y(); | 424 int client_area_top = client_area_bounds.y(); |
424 | 425 |
425 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 426 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
426 SkBitmap* top_left = rb.GetBitmapNamed(IDR_APP_TOP_LEFT); | 427 SkBitmap* top_left = rb.GetBitmapNamed(IDR_APP_TOP_LEFT); |
427 SkBitmap* top = rb.GetBitmapNamed(IDR_APP_TOP_CENTER); | 428 SkBitmap* top = rb.GetBitmapNamed(IDR_APP_TOP_CENTER); |
428 SkBitmap* top_right = rb.GetBitmapNamed(IDR_APP_TOP_RIGHT); | 429 SkBitmap* top_right = rb.GetBitmapNamed(IDR_APP_TOP_RIGHT); |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 title_font_ = new gfx::Font(app::win::GetWindowTitleFont()); | 574 title_font_ = new gfx::Font(app::win::GetWindowTitleFont()); |
574 #elif defined(OS_LINUX) | 575 #elif defined(OS_LINUX) |
575 // TODO(ben): need to resolve what font this is. | 576 // TODO(ben): need to resolve what font this is. |
576 title_font_ = new gfx::Font(); | 577 title_font_ = new gfx::Font(); |
577 #endif | 578 #endif |
578 initialized = true; | 579 initialized = true; |
579 } | 580 } |
580 } | 581 } |
581 | 582 |
582 } // namespace views | 583 } // namespace views |
OLD | NEW |