| 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/gfx/canvas_paint.h" | 9 #include "app/gfx/canvas_paint.h" |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 model_->AddObserver(this); | 694 model_->AddObserver(this); |
| 695 | 695 |
| 696 tabstrip_.Own(gtk_fixed_new()); | 696 tabstrip_.Own(gtk_fixed_new()); |
| 697 gtk_widget_set_size_request(tabstrip_.get(), -1, | 697 gtk_widget_set_size_request(tabstrip_.get(), -1, |
| 698 TabGtk::GetMinimumUnselectedSize().height()); | 698 TabGtk::GetMinimumUnselectedSize().height()); |
| 699 gtk_widget_set_app_paintable(tabstrip_.get(), TRUE); | 699 gtk_widget_set_app_paintable(tabstrip_.get(), TRUE); |
| 700 gtk_drag_dest_set(tabstrip_.get(), GTK_DEST_DEFAULT_ALL, | 700 gtk_drag_dest_set(tabstrip_.get(), GTK_DEST_DEFAULT_ALL, |
| 701 NULL, 0, | 701 NULL, 0, |
| 702 static_cast<GdkDragAction>( | 702 static_cast<GdkDragAction>( |
| 703 GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK)); | 703 GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK)); |
| 704 GtkDndUtil::SetDestTargetListFromCodeMask(tabstrip_.get(), | 704 static const int targets[] = { GtkDndUtil::TEXT_URI_LIST, 0 }; |
| 705 GtkDndUtil::TEXT_URI_LIST); | 705 GtkDndUtil::SetDestTargetList(tabstrip_.get(), targets); |
| 706 | 706 |
| 707 g_signal_connect(G_OBJECT(tabstrip_.get()), "expose-event", | 707 g_signal_connect(G_OBJECT(tabstrip_.get()), "expose-event", |
| 708 G_CALLBACK(OnExpose), this); | 708 G_CALLBACK(OnExpose), this); |
| 709 g_signal_connect(G_OBJECT(tabstrip_.get()), "size-allocate", | 709 g_signal_connect(G_OBJECT(tabstrip_.get()), "size-allocate", |
| 710 G_CALLBACK(OnSizeAllocate), this); | 710 G_CALLBACK(OnSizeAllocate), this); |
| 711 g_signal_connect(G_OBJECT(tabstrip_.get()), "drag-motion", | 711 g_signal_connect(G_OBJECT(tabstrip_.get()), "drag-motion", |
| 712 G_CALLBACK(OnDragMotion), this); | 712 G_CALLBACK(OnDragMotion), this); |
| 713 g_signal_connect(G_OBJECT(tabstrip_.get()), "drag-drop", | 713 g_signal_connect(G_OBJECT(tabstrip_.get()), "drag-drop", |
| 714 G_CALLBACK(OnDragDrop), this); | 714 G_CALLBACK(OnDragDrop), this); |
| 715 g_signal_connect(G_OBJECT(tabstrip_.get()), "drag-leave", | 715 g_signal_connect(G_OBJECT(tabstrip_.get()), "drag-leave", |
| (...skipping 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1933 message.set_type(TabOverviewTypes::Message::WM_SWITCH_TO_OVERVIEW_MODE); | 1933 message.set_type(TabOverviewTypes::Message::WM_SWITCH_TO_OVERVIEW_MODE); |
| 1934 GtkWidget* browser_widget = GTK_WIDGET( | 1934 GtkWidget* browser_widget = GTK_WIDGET( |
| 1935 static_cast<BrowserWindowGtk*>(browser->window())->GetNativeHandle()); | 1935 static_cast<BrowserWindowGtk*>(browser->window())->GetNativeHandle()); |
| 1936 message.set_param(0, x11_util::GetX11WindowFromGtkWidget(browser_widget)); | 1936 message.set_param(0, x11_util::GetX11WindowFromGtkWidget(browser_widget)); |
| 1937 TabOverviewTypes::instance()->SendMessage(message); | 1937 TabOverviewTypes::instance()->SendMessage(message); |
| 1938 | 1938 |
| 1939 UserMetrics::RecordAction(L"TabOverview_PressedTabOverviewButton", | 1939 UserMetrics::RecordAction(L"TabOverview_PressedTabOverviewButton", |
| 1940 tabstrip->model_->profile()); | 1940 tabstrip->model_->profile()); |
| 1941 } | 1941 } |
| 1942 #endif | 1942 #endif |
| OLD | NEW |