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(WideToUTF16Hack(d->GetWindowTitle()), *title_font_, | 416 canvas->DrawStringInt(d->GetWindowTitle(), *title_font_, SK_ColorWHITE, |
417 SK_ColorWHITE, MirroredLeftPointForRect(title_bounds_), | 417 MirroredLeftPointForRect(title_bounds_), title_bounds_.y(), |
418 title_bounds_.y(), title_bounds_.width(), | 418 title_bounds_.width(), title_bounds_.height()); |
419 title_bounds_.height()); | |
420 } | 419 } |
421 | 420 |
422 void CustomFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) { | 421 void CustomFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) { |
423 gfx::Rect client_area_bounds = frame_->GetClientView()->bounds(); | 422 gfx::Rect client_area_bounds = frame_->GetClientView()->bounds(); |
424 int client_area_top = client_area_bounds.y(); | 423 int client_area_top = client_area_bounds.y(); |
425 | 424 |
426 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 425 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
427 SkBitmap* top_left = rb.GetBitmapNamed(IDR_APP_TOP_LEFT); | 426 SkBitmap* top_left = rb.GetBitmapNamed(IDR_APP_TOP_LEFT); |
428 SkBitmap* top = rb.GetBitmapNamed(IDR_APP_TOP_CENTER); | 427 SkBitmap* top = rb.GetBitmapNamed(IDR_APP_TOP_CENTER); |
429 SkBitmap* top_right = rb.GetBitmapNamed(IDR_APP_TOP_RIGHT); | 428 SkBitmap* top_right = rb.GetBitmapNamed(IDR_APP_TOP_RIGHT); |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 title_font_ = new gfx::Font(app::win::GetWindowTitleFont()); | 573 title_font_ = new gfx::Font(app::win::GetWindowTitleFont()); |
575 #elif defined(OS_LINUX) | 574 #elif defined(OS_LINUX) |
576 // TODO(ben): need to resolve what font this is. | 575 // TODO(ben): need to resolve what font this is. |
577 title_font_ = new gfx::Font(); | 576 title_font_ = new gfx::Font(); |
578 #endif | 577 #endif |
579 initialized = true; | 578 initialized = true; |
580 } | 579 } |
581 } | 580 } |
582 | 581 |
583 } // namespace views | 582 } // namespace views |
OLD | NEW |