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/gtk/tabs/tab_renderer_gtk.h" | 5 #include "chrome/browser/ui/gtk/tabs/tab_renderer_gtk.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
11 #include "chrome/browser/defaults.h" | 11 #include "chrome/browser/defaults.h" |
12 #include "chrome/browser/extensions/extension_tab_helper.h" | 12 #include "chrome/browser/extensions/extension_tab_helper.h" |
13 #include "chrome/browser/favicon/favicon_tab_helper.h" | 13 #include "chrome/browser/favicon/favicon_tab_helper.h" |
14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
16 #include "chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.h" | 16 #include "chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.h" |
17 #include "chrome/browser/ui/gtk/custom_button.h" | 17 #include "chrome/browser/ui/gtk/custom_button.h" |
18 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 18 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
19 #include "chrome/browser/ui/gtk/gtk_util.h" | 19 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 20 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
20 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 21 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
21 #include "chrome/common/chrome_notification_types.h" | 22 #include "chrome/common/chrome_notification_types.h" |
22 #include "content/browser/tab_contents/tab_contents.h" | 23 #include "content/browser/tab_contents/tab_contents.h" |
23 #include "content/public/browser/notification_source.h" | 24 #include "content/public/browser/notification_source.h" |
24 #include "grit/generated_resources.h" | 25 #include "grit/generated_resources.h" |
25 #include "grit/theme_resources.h" | 26 #include "grit/theme_resources.h" |
26 #include "grit/theme_resources_standard.h" | 27 #include "grit/theme_resources_standard.h" |
27 #include "grit/ui_resources.h" | 28 #include "grit/ui_resources.h" |
28 #include "ui/base/animation/slide_animation.h" | 29 #include "ui/base/animation/slide_animation.h" |
29 #include "ui/base/animation/throb_animation.h" | 30 #include "ui/base/animation/throb_animation.h" |
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 | 829 |
829 void TabRendererGtk::PaintTitle(GtkWidget* widget, cairo_t* cr) { | 830 void TabRendererGtk::PaintTitle(GtkWidget* widget, cairo_t* cr) { |
830 if (title_bounds_.IsEmpty()) | 831 if (title_bounds_.IsEmpty()) |
831 return; | 832 return; |
832 | 833 |
833 // Paint the Title. | 834 // Paint the Title. |
834 string16 title = data_.title; | 835 string16 title = data_.title; |
835 if (title.empty()) { | 836 if (title.empty()) { |
836 title = data_.loading ? | 837 title = data_.loading ? |
837 l10n_util::GetStringUTF16(IDS_TAB_LOADING_TITLE) : | 838 l10n_util::GetStringUTF16(IDS_TAB_LOADING_TITLE) : |
838 TabContentsWrapper::GetDefaultTitle(); | 839 CoreTabHelper::GetDefaultTitle(); |
839 } else { | 840 } else { |
840 Browser::FormatTitleForDisplay(&title); | 841 Browser::FormatTitleForDisplay(&title); |
841 } | 842 } |
842 | 843 |
843 SkColor title_color = IsSelected() ? selected_title_color_ | 844 SkColor title_color = IsSelected() ? selected_title_color_ |
844 : unselected_title_color_; | 845 : unselected_title_color_; |
845 | 846 |
846 DrawTextOntoCairoSurface(cr, | 847 DrawTextOntoCairoSurface(cr, |
847 title, | 848 title, |
848 *title_font_, | 849 *title_font_, |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 | 1118 |
1118 close_button_width_ = rb.GetBitmapNamed(IDR_TAB_CLOSE)->width(); | 1119 close_button_width_ = rb.GetBitmapNamed(IDR_TAB_CLOSE)->width(); |
1119 close_button_height_ = rb.GetBitmapNamed(IDR_TAB_CLOSE)->height(); | 1120 close_button_height_ = rb.GetBitmapNamed(IDR_TAB_CLOSE)->height(); |
1120 | 1121 |
1121 const gfx::Font& base_font = rb.GetFont(ResourceBundle::BaseFont); | 1122 const gfx::Font& base_font = rb.GetFont(ResourceBundle::BaseFont); |
1122 title_font_ = new gfx::Font(base_font.GetFontName(), kFontPixelSize); | 1123 title_font_ = new gfx::Font(base_font.GetFontName(), kFontPixelSize); |
1123 title_font_height_ = title_font_->GetHeight(); | 1124 title_font_height_ = title_font_->GetHeight(); |
1124 | 1125 |
1125 initialized_ = true; | 1126 initialized_ = true; |
1126 } | 1127 } |
OLD | NEW |