| 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_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/gfx/canvas_paint.h" | 10 #include "app/gfx/canvas_paint.h" |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 // Make sure we unhook ourselves as a message loop observer so that we don't | 704 // Make sure we unhook ourselves as a message loop observer so that we don't |
| 705 // crash in the case where the user closes the last tab in a window. | 705 // crash in the case where the user closes the last tab in a window. |
| 706 RemoveMessageLoopObserver(); | 706 RemoveMessageLoopObserver(); |
| 707 } | 707 } |
| 708 | 708 |
| 709 void TabStripGtk::Init() { | 709 void TabStripGtk::Init() { |
| 710 model_->AddObserver(this); | 710 model_->AddObserver(this); |
| 711 | 711 |
| 712 tabstrip_.Own(gtk_fixed_new()); | 712 tabstrip_.Own(gtk_fixed_new()); |
| 713 ViewIDUtil::SetID(tabstrip_.get(), VIEW_ID_TAB_STRIP); | 713 ViewIDUtil::SetID(tabstrip_.get(), VIEW_ID_TAB_STRIP); |
| 714 gtk_widget_set_size_request(tabstrip_.get(), -1, | 714 // We want the tab strip to be horizontally shrinkable, so that the Chrome |
| 715 // window can be resized freely. |
| 716 gtk_widget_set_size_request(tabstrip_.get(), 0, |
| 715 TabGtk::GetMinimumUnselectedSize().height()); | 717 TabGtk::GetMinimumUnselectedSize().height()); |
| 716 gtk_widget_set_app_paintable(tabstrip_.get(), TRUE); | 718 gtk_widget_set_app_paintable(tabstrip_.get(), TRUE); |
| 717 gtk_drag_dest_set(tabstrip_.get(), GTK_DEST_DEFAULT_ALL, | 719 gtk_drag_dest_set(tabstrip_.get(), GTK_DEST_DEFAULT_ALL, |
| 718 NULL, 0, | 720 NULL, 0, |
| 719 static_cast<GdkDragAction>( | 721 static_cast<GdkDragAction>( |
| 720 GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK)); | 722 GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK)); |
| 721 static const int targets[] = { GtkDndUtil::TEXT_URI_LIST, -1 }; | 723 static const int targets[] = { GtkDndUtil::TEXT_URI_LIST, -1 }; |
| 722 GtkDndUtil::SetDestTargetList(tabstrip_.get(), targets); | 724 GtkDndUtil::SetDestTargetList(tabstrip_.get(), targets); |
| 723 | 725 |
| 724 g_signal_connect(G_OBJECT(tabstrip_.get()), "expose-event", | 726 g_signal_connect(G_OBJECT(tabstrip_.get()), "expose-event", |
| (...skipping 1315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2040 | 2042 |
| 2041 // Let the middle mouse button initiate clicks as well. | 2043 // Let the middle mouse button initiate clicks as well. |
| 2042 gtk_util::SetButtonTriggersNavigation(button->widget()); | 2044 gtk_util::SetButtonTriggersNavigation(button->widget()); |
| 2043 g_signal_connect(G_OBJECT(button->widget()), "clicked", | 2045 g_signal_connect(G_OBJECT(button->widget()), "clicked", |
| 2044 G_CALLBACK(OnNewTabClicked), this); | 2046 G_CALLBACK(OnNewTabClicked), this); |
| 2045 GTK_WIDGET_UNSET_FLAGS(button->widget(), GTK_CAN_FOCUS); | 2047 GTK_WIDGET_UNSET_FLAGS(button->widget(), GTK_CAN_FOCUS); |
| 2046 gtk_fixed_put(GTK_FIXED(tabstrip_.get()), button->widget(), 0, 0); | 2048 gtk_fixed_put(GTK_FIXED(tabstrip_.get()), button->widget(), 0, 0); |
| 2047 | 2049 |
| 2048 return button; | 2050 return button; |
| 2049 } | 2051 } |
| OLD | NEW |