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_strip_gtk.h" | 5 #include "chrome/browser/ui/gtk/tabs/tab_strip_gtk.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 | 1101 |
1102 void TabStripGtk::TabMiniStateChanged(TabContentsWrapper* contents, int index) { | 1102 void TabStripGtk::TabMiniStateChanged(TabContentsWrapper* contents, int index) { |
1103 // Don't do anything if we've already picked up the change from TabMoved. | 1103 // Don't do anything if we've already picked up the change from TabMoved. |
1104 if (GetTabAt(index)->mini() == model_->IsMiniTab(index)) | 1104 if (GetTabAt(index)->mini() == model_->IsMiniTab(index)) |
1105 return; | 1105 return; |
1106 | 1106 |
1107 GetTabAt(index)->set_mini(model_->IsMiniTab(index)); | 1107 GetTabAt(index)->set_mini(model_->IsMiniTab(index)); |
1108 // Don't animate if the window isn't visible yet. The window won't be visible | 1108 // Don't animate if the window isn't visible yet. The window won't be visible |
1109 // when dragging a mini-tab to a new window. | 1109 // when dragging a mini-tab to a new window. |
1110 if (window_ && window_->window() && | 1110 if (window_ && window_->window() && |
1111 GTK_WIDGET_VISIBLE(GTK_WIDGET(window_->window()))) { | 1111 gtk_widget_get_visible(GTK_WIDGET(window_->window()))) { |
1112 StartMiniTabAnimation(index); | 1112 StartMiniTabAnimation(index); |
1113 } else { | 1113 } else { |
1114 Layout(); | 1114 Layout(); |
1115 } | 1115 } |
1116 } | 1116 } |
1117 | 1117 |
1118 void TabStripGtk::TabBlockedStateChanged(TabContentsWrapper* contents, | 1118 void TabStripGtk::TabBlockedStateChanged(TabContentsWrapper* contents, |
1119 int index) { | 1119 int index) { |
1120 GetTabAt(index)->SetBlocked(model_->IsTabBlocked(index)); | 1120 GetTabAt(index)->SetBlocked(model_->IsTabBlocked(index)); |
1121 } | 1121 } |
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2120 } | 2120 } |
2121 | 2121 |
2122 CustomDrawButton* TabStripGtk::MakeNewTabButton() { | 2122 CustomDrawButton* TabStripGtk::MakeNewTabButton() { |
2123 CustomDrawButton* button = new CustomDrawButton(IDR_NEWTAB_BUTTON, | 2123 CustomDrawButton* button = new CustomDrawButton(IDR_NEWTAB_BUTTON, |
2124 IDR_NEWTAB_BUTTON_P, IDR_NEWTAB_BUTTON_H, 0); | 2124 IDR_NEWTAB_BUTTON_P, IDR_NEWTAB_BUTTON_H, 0); |
2125 | 2125 |
2126 // Let the middle mouse button initiate clicks as well. | 2126 // Let the middle mouse button initiate clicks as well. |
2127 gtk_util::SetButtonTriggersNavigation(button->widget()); | 2127 gtk_util::SetButtonTriggersNavigation(button->widget()); |
2128 g_signal_connect(button->widget(), "clicked", | 2128 g_signal_connect(button->widget(), "clicked", |
2129 G_CALLBACK(OnNewTabClickedThunk), this); | 2129 G_CALLBACK(OnNewTabClickedThunk), this); |
2130 GTK_WIDGET_UNSET_FLAGS(button->widget(), GTK_CAN_FOCUS); | 2130 gtk_widget_set_can_focus(button->widget(), FALSE); |
2131 gtk_fixed_put(GTK_FIXED(tabstrip_.get()), button->widget(), 0, 0); | 2131 gtk_fixed_put(GTK_FIXED(tabstrip_.get()), button->widget(), 0, 0); |
2132 | 2132 |
2133 return button; | 2133 return button; |
2134 } | 2134 } |
OLD | NEW |