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 "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
11 #include "chrome/browser/tabs/tab_strip_selection_model.h" | 11 #include "chrome/browser/tabs/tab_strip_selection_model.h" |
12 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
13 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 13 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
14 #include "chrome/browser/ui/view_ids.h" | 14 #include "chrome/browser/ui/view_ids.h" |
15 #include "chrome/browser/ui/views/tabs/tab_controller.h" | 15 #include "chrome/browser/ui/views/tabs/tab_controller.h" |
16 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
17 #include "content/browser/tab_contents/tab_contents.h" | 17 #include "content/browser/tab_contents/tab_contents.h" |
18 #include "grit/generated_resources.h" | 18 #include "grit/generated_resources.h" |
19 #include "grit/theme_resources.h" | 19 #include "grit/theme_resources.h" |
20 #include "grit/theme_resources_standard.h" | 20 #include "grit/theme_resources_standard.h" |
21 #include "grit/ui_resources.h" | 21 #include "grit/ui_resources.h" |
22 #include "ui/base/accessibility/accessible_view_state.h" | 22 #include "ui/base/accessibility/accessible_view_state.h" |
23 #include "ui/base/animation/animation_container.h" | 23 #include "ui/base/animation/animation_container.h" |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 } | 470 } |
471 | 471 |
472 void BaseTab::PaintTitle(gfx::Canvas* canvas, SkColor title_color) { | 472 void BaseTab::PaintTitle(gfx::Canvas* canvas, SkColor title_color) { |
473 // Paint the Title. | 473 // Paint the Title. |
474 const gfx::Rect& title_bounds = GetTitleBounds(); | 474 const gfx::Rect& title_bounds = GetTitleBounds(); |
475 string16 title = data().title; | 475 string16 title = data().title; |
476 | 476 |
477 if (title.empty()) { | 477 if (title.empty()) { |
478 title = data().loading ? | 478 title = data().loading ? |
479 l10n_util::GetStringUTF16(IDS_TAB_LOADING_TITLE) : | 479 l10n_util::GetStringUTF16(IDS_TAB_LOADING_TITLE) : |
480 TabContentsWrapper::GetDefaultTitle(); | 480 CoreTabHelper::GetDefaultTitle(); |
481 } else { | 481 } else { |
482 Browser::FormatTitleForDisplay(&title); | 482 Browser::FormatTitleForDisplay(&title); |
483 } | 483 } |
484 | 484 |
485 #if defined(OS_WIN) | 485 #if defined(OS_WIN) |
486 canvas->AsCanvasSkia()->DrawFadeTruncatingString(title, | 486 canvas->AsCanvasSkia()->DrawFadeTruncatingString(title, |
487 gfx::CanvasSkia::TruncateFadeTail, 0, *font_, title_color, title_bounds); | 487 gfx::CanvasSkia::TruncateFadeTail, 0, *font_, title_color, title_bounds); |
488 #else | 488 #else |
489 canvas->DrawStringInt(title, *font_, title_color, | 489 canvas->DrawStringInt(title, *font_, title_color, |
490 title_bounds.x(), title_bounds.y(), | 490 title_bounds.x(), title_bounds.y(), |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 // static | 574 // static |
575 void BaseTab::InitResources() { | 575 void BaseTab::InitResources() { |
576 static bool initialized = false; | 576 static bool initialized = false; |
577 if (!initialized) { | 577 if (!initialized) { |
578 initialized = true; | 578 initialized = true; |
579 font_ = new gfx::Font( | 579 font_ = new gfx::Font( |
580 ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont)); | 580 ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont)); |
581 font_height_ = font_->GetHeight(); | 581 font_height_ = font_->GetHeight(); |
582 } | 582 } |
583 } | 583 } |
OLD | NEW |