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 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1007 | 1007 |
1008 void TabStripGtk::TabDetachedAt(TabContentsWrapper* contents, int index) { | 1008 void TabStripGtk::TabDetachedAt(TabContentsWrapper* contents, int index) { |
1009 GenerateIdealBounds(); | 1009 GenerateIdealBounds(); |
1010 StartRemoveTabAnimation(index, contents->tab_contents()); | 1010 StartRemoveTabAnimation(index, contents->tab_contents()); |
1011 // Have to do this _after_ calling StartRemoveTabAnimation, so that any | 1011 // Have to do this _after_ calling StartRemoveTabAnimation, so that any |
1012 // previous remove is completed fully and index is valid in sync with the | 1012 // previous remove is completed fully and index is valid in sync with the |
1013 // model index. | 1013 // model index. |
1014 GetTabAt(index)->set_closing(true); | 1014 GetTabAt(index)->set_closing(true); |
1015 } | 1015 } |
1016 | 1016 |
1017 void TabStripGtk::TabSelectedAt(TabContentsWrapper* old_contents, | 1017 void TabStripGtk::ActiveTabChanged(TabContentsWrapper* old_contents, |
1018 TabContentsWrapper* new_contents, | 1018 TabContentsWrapper* new_contents, |
1019 int index, | 1019 int index, |
1020 bool user_gesture) { | 1020 bool user_gesture) { |
1021 DCHECK(index >= 0 && index < static_cast<int>(GetTabCount())); | 1021 DCHECK(index >= 0 && index < static_cast<int>(GetTabCount())); |
1022 | 1022 |
1023 // We have "tiny tabs" if the tabs are so tiny that the unselected ones are | 1023 // We have "tiny tabs" if the tabs are so tiny that the unselected ones are |
1024 // a different size to the selected ones. | 1024 // a different size to the selected ones. |
1025 bool tiny_tabs = current_unselected_width_ != current_selected_width_; | 1025 bool tiny_tabs = current_unselected_width_ != current_selected_width_; |
1026 if (!IsAnimating() && (!needs_resize_layout_ || tiny_tabs)) | 1026 if (!IsAnimating() && (!needs_resize_layout_ || tiny_tabs)) |
1027 Layout(); | 1027 Layout(); |
1028 | 1028 |
1029 GetTabAt(index)->SchedulePaint(); | 1029 GetTabAt(index)->SchedulePaint(); |
1030 | 1030 |
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2076 | 2076 |
2077 // Let the middle mouse button initiate clicks as well. | 2077 // Let the middle mouse button initiate clicks as well. |
2078 gtk_util::SetButtonTriggersNavigation(button->widget()); | 2078 gtk_util::SetButtonTriggersNavigation(button->widget()); |
2079 g_signal_connect(button->widget(), "clicked", | 2079 g_signal_connect(button->widget(), "clicked", |
2080 G_CALLBACK(OnNewTabClickedThunk), this); | 2080 G_CALLBACK(OnNewTabClickedThunk), this); |
2081 GTK_WIDGET_UNSET_FLAGS(button->widget(), GTK_CAN_FOCUS); | 2081 GTK_WIDGET_UNSET_FLAGS(button->widget(), GTK_CAN_FOCUS); |
2082 gtk_fixed_put(GTK_FIXED(tabstrip_.get()), button->widget(), 0, 0); | 2082 gtk_fixed_put(GTK_FIXED(tabstrip_.get()), button->widget(), 0, 0); |
2083 | 2083 |
2084 return button; | 2084 return button; |
2085 } | 2085 } |
OLD | NEW |