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 "chrome/browser/ui/views/tabs/base_tab.h" | 5 #include "chrome/browser/ui/views/tabs/base_tab.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 // Paint the Title. | 399 // Paint the Title. |
400 string16 title = data().title; | 400 string16 title = data().title; |
401 if (title.empty()) { | 401 if (title.empty()) { |
402 title = data().loading ? | 402 title = data().loading ? |
403 l10n_util::GetStringUTF16(IDS_TAB_LOADING_TITLE) : | 403 l10n_util::GetStringUTF16(IDS_TAB_LOADING_TITLE) : |
404 TabContents::GetDefaultTitle(); | 404 TabContents::GetDefaultTitle(); |
405 } else { | 405 } else { |
406 Browser::FormatTitleForDisplay(&title); | 406 Browser::FormatTitleForDisplay(&title); |
407 } | 407 } |
408 | 408 |
409 canvas->DrawStringInt(title, *font_, title_color, | 409 canvas->DrawStringInt(UTF16ToWideHack(title), *font_, title_color, |
410 title_bounds().x(), title_bounds().y(), | 410 title_bounds().x(), title_bounds().y(), |
411 title_bounds().width(), title_bounds().height()); | 411 title_bounds().width(), title_bounds().height()); |
412 } | 412 } |
413 | 413 |
414 void BaseTab::AnimationProgressed(const ui::Animation* animation) { | 414 void BaseTab::AnimationProgressed(const ui::Animation* animation) { |
415 SchedulePaint(); | 415 SchedulePaint(); |
416 } | 416 } |
417 | 417 |
418 void BaseTab::AnimationCanceled(const ui::Animation* animation) { | 418 void BaseTab::AnimationCanceled(const ui::Animation* animation) { |
419 SchedulePaint(); | 419 SchedulePaint(); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 // static | 468 // static |
469 void BaseTab::InitResources() { | 469 void BaseTab::InitResources() { |
470 static bool initialized = false; | 470 static bool initialized = false; |
471 if (!initialized) { | 471 if (!initialized) { |
472 initialized = true; | 472 initialized = true; |
473 font_ = new gfx::Font( | 473 font_ = new gfx::Font( |
474 ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont)); | 474 ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont)); |
475 font_height_ = font_->GetHeight(); | 475 font_height_ = font_->GetHeight(); |
476 } | 476 } |
477 } | 477 } |
OLD | NEW |