OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/gtk/tabs/tab_renderer_gtk.h" | 5 #include "chrome/browser/gtk/tabs/tab_renderer_gtk.h" |
6 | 6 |
7 #include "app/gfx/canvas_paint.h" | 7 #include "app/gfx/canvas_paint.h" |
8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
10 #include "chrome/browser/browser.h" | 10 #include "chrome/browser/browser.h" |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 return IconCapacity() >= 1; | 674 return IconCapacity() >= 1; |
675 } | 675 } |
676 | 676 |
677 bool TabRendererGtk::ShouldShowCloseBox() const { | 677 bool TabRendererGtk::ShouldShowCloseBox() const { |
678 // The selected tab never clips close button. | 678 // The selected tab never clips close button. |
679 return IsSelected() || IconCapacity() >= 3; | 679 return IsSelected() || IconCapacity() >= 3; |
680 } | 680 } |
681 | 681 |
682 CustomDrawButton* TabRendererGtk::MakeCloseButton() { | 682 CustomDrawButton* TabRendererGtk::MakeCloseButton() { |
683 CustomDrawButton* button = new CustomDrawButton(IDR_TAB_CLOSE, | 683 CustomDrawButton* button = new CustomDrawButton(IDR_TAB_CLOSE, |
684 IDR_TAB_CLOSE_P, IDR_TAB_CLOSE_H, IDR_TAB_CLOSE); | 684 IDR_TAB_CLOSE_P, IDR_TAB_CLOSE_H, IDR_TAB_CLOSE, NULL); |
685 | 685 |
686 g_signal_connect(G_OBJECT(button->widget()), "clicked", | 686 g_signal_connect(G_OBJECT(button->widget()), "clicked", |
687 G_CALLBACK(OnCloseButtonClicked), this); | 687 G_CALLBACK(OnCloseButtonClicked), this); |
688 g_signal_connect(G_OBJECT(button->widget()), "button-release-event", | 688 g_signal_connect(G_OBJECT(button->widget()), "button-release-event", |
689 G_CALLBACK(OnCloseButtonMouseRelease), this); | 689 G_CALLBACK(OnCloseButtonMouseRelease), this); |
690 GTK_WIDGET_UNSET_FLAGS(button->widget(), GTK_CAN_FOCUS); | 690 GTK_WIDGET_UNSET_FLAGS(button->widget(), GTK_CAN_FOCUS); |
691 gtk_fixed_put(GTK_FIXED(tab_.get()), button->widget(), 0, 0); | 691 gtk_fixed_put(GTK_FIXED(tab_.get()), button->widget(), 0, 0); |
692 | 692 |
693 return button; | 693 return button; |
694 } | 694 } |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 gfx::Font base_font = rb.GetFont(ResourceBundle::BaseFont); | 746 gfx::Font base_font = rb.GetFont(ResourceBundle::BaseFont); |
747 title_font_ = new gfx::Font(gfx::Font::CreateFont(base_font.FontName(), 10)); | 747 title_font_ = new gfx::Font(gfx::Font::CreateFont(base_font.FontName(), 10)); |
748 title_font_height_ = title_font_->height(); | 748 title_font_height_ = title_font_->height(); |
749 | 749 |
750 InitializeLoadingAnimationData(&rb, &loading_animation_data); | 750 InitializeLoadingAnimationData(&rb, &loading_animation_data); |
751 | 751 |
752 crashed_fav_icon = rb.GetBitmapNamed(IDR_SAD_FAVICON); | 752 crashed_fav_icon = rb.GetBitmapNamed(IDR_SAD_FAVICON); |
753 | 753 |
754 initialized_ = true; | 754 initialized_ = true; |
755 } | 755 } |
OLD | NEW |