| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 string16 title = data().title; | 536 string16 title = data().title; |
| 537 | 537 |
| 538 if (title.empty()) { | 538 if (title.empty()) { |
| 539 title = data().loading ? | 539 title = data().loading ? |
| 540 l10n_util::GetStringUTF16(IDS_TAB_LOADING_TITLE) : | 540 l10n_util::GetStringUTF16(IDS_TAB_LOADING_TITLE) : |
| 541 CoreTabHelper::GetDefaultTitle(); | 541 CoreTabHelper::GetDefaultTitle(); |
| 542 } else { | 542 } else { |
| 543 Browser::FormatTitleForDisplay(&title); | 543 Browser::FormatTitleForDisplay(&title); |
| 544 } | 544 } |
| 545 | 545 |
| 546 #if defined(OS_WIN) | |
| 547 canvas->DrawFadeTruncatingString(title, gfx::Canvas::TruncateFadeTail, 0, | 546 canvas->DrawFadeTruncatingString(title, gfx::Canvas::TruncateFadeTail, 0, |
| 548 *font_, title_color, title_bounds); | 547 *font_, title_color, title_bounds); |
| 549 #else | |
| 550 canvas->DrawStringInt(title, *font_, title_color, | |
| 551 title_bounds.x(), title_bounds.y(), | |
| 552 title_bounds.width(), title_bounds.height()); | |
| 553 #endif | |
| 554 } | 548 } |
| 555 | 549 |
| 556 void BaseTab::AnimationProgressed(const ui::Animation* animation) { | 550 void BaseTab::AnimationProgressed(const ui::Animation* animation) { |
| 557 // Ignore if the pulse animation is being performed on active tab because | 551 // Ignore if the pulse animation is being performed on active tab because |
| 558 // it repaints the same image. See |Tab::PaintTabBackground()|. | 552 // it repaints the same image. See |Tab::PaintTabBackground()|. |
| 559 if (animation == pulse_animation_.get() && IsActive()) | 553 if (animation == pulse_animation_.get() && IsActive()) |
| 560 return; | 554 return; |
| 561 SchedulePaint(); | 555 SchedulePaint(); |
| 562 } | 556 } |
| 563 | 557 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 // static | 632 // static |
| 639 void BaseTab::InitResources() { | 633 void BaseTab::InitResources() { |
| 640 static bool initialized = false; | 634 static bool initialized = false; |
| 641 if (!initialized) { | 635 if (!initialized) { |
| 642 initialized = true; | 636 initialized = true; |
| 643 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 637 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 644 font_ = new gfx::Font(rb.GetFont(ui::ResourceBundle::BaseFont)); | 638 font_ = new gfx::Font(rb.GetFont(ui::ResourceBundle::BaseFont)); |
| 645 font_height_ = font_->GetHeight(); | 639 font_height_ = font_->GetHeight(); |
| 646 } | 640 } |
| 647 } | 641 } |
| OLD | NEW |