| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_strip_gtk.h" | 5 #include "chrome/browser/gtk/tabs/tab_strip_gtk.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "app/gtk_dnd_util.h" | 9 #include "app/gtk_dnd_util.h" |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 } | 765 } |
| 766 | 766 |
| 767 void TabStripGtk::Show() { | 767 void TabStripGtk::Show() { |
| 768 gtk_widget_show(tabstrip_.get()); | 768 gtk_widget_show(tabstrip_.get()); |
| 769 } | 769 } |
| 770 | 770 |
| 771 void TabStripGtk::Hide() { | 771 void TabStripGtk::Hide() { |
| 772 gtk_widget_hide(tabstrip_.get()); | 772 gtk_widget_hide(tabstrip_.get()); |
| 773 } | 773 } |
| 774 | 774 |
| 775 void TabStripGtk::CancelActiveDragSession() { | |
| 776 if (!IsDragSessionActive()) | |
| 777 return; | |
| 778 | |
| 779 drag_controller_->EndDrag(true); | |
| 780 } | |
| 781 | |
| 782 void TabStripGtk::Layout() { | 775 void TabStripGtk::Layout() { |
| 783 // Called from: | 776 // Called from: |
| 784 // - window resize | 777 // - window resize |
| 785 // - animation completion | 778 // - animation completion |
| 786 StopAnimation(); | 779 StopAnimation(); |
| 787 | 780 |
| 788 GenerateIdealBounds(); | 781 GenerateIdealBounds(); |
| 789 int tab_count = GetTabCount(); | 782 int tab_count = GetTabCount(); |
| 790 int tab_right = 0; | 783 int tab_right = 0; |
| 791 for (int i = 0; i < tab_count; ++i) { | 784 for (int i = 0; i < tab_count; ++i) { |
| (...skipping 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2040 | 2033 |
| 2041 // Let the middle mouse button initiate clicks as well. | 2034 // Let the middle mouse button initiate clicks as well. |
| 2042 gtk_util::SetButtonTriggersNavigation(button->widget()); | 2035 gtk_util::SetButtonTriggersNavigation(button->widget()); |
| 2043 g_signal_connect(button->widget(), "clicked", | 2036 g_signal_connect(button->widget(), "clicked", |
| 2044 G_CALLBACK(OnNewTabClickedThunk), this); | 2037 G_CALLBACK(OnNewTabClickedThunk), this); |
| 2045 GTK_WIDGET_UNSET_FLAGS(button->widget(), GTK_CAN_FOCUS); | 2038 GTK_WIDGET_UNSET_FLAGS(button->widget(), GTK_CAN_FOCUS); |
| 2046 gtk_fixed_put(GTK_FIXED(tabstrip_.get()), button->widget(), 0, 0); | 2039 gtk_fixed_put(GTK_FIXED(tabstrip_.get()), button->widget(), 0, 0); |
| 2047 | 2040 |
| 2048 return button; | 2041 return button; |
| 2049 } | 2042 } |
| OLD | NEW |