Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Side by Side Diff: chrome/browser/gtk/tabs/tab_strip_gtk.cc

Issue 151033: More web contents dragging. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: more Dones Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/gtk/tabs/tab_gtk.cc ('k') | chrome/browser/tab_contents/tab_contents_view_gtk.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "app/resource_bundle.h" 11 #include "app/resource_bundle.h"
12 #include "app/slide_animation.h" 12 #include "app/slide_animation.h"
13 #include "base/gfx/gtk_util.h" 13 #include "base/gfx/gtk_util.h"
14 #include "base/gfx/point.h" 14 #include "base/gfx/point.h"
15 #include "chrome/browser/browser_theme_provider.h" 15 #include "chrome/browser/browser_theme_provider.h"
16 #include "chrome/browser/gtk/custom_button.h" 16 #include "chrome/browser/gtk/custom_button.h"
17 #include "chrome/browser/gtk/dnd_registry.h" 17 #include "chrome/browser/gtk/gtk_dnd_util.h"
18 #include "chrome/browser/gtk/tabs/dragged_tab_controller_gtk.h" 18 #include "chrome/browser/gtk/tabs/dragged_tab_controller_gtk.h"
19 #include "chrome/browser/profile.h" 19 #include "chrome/browser/profile.h"
20 #include "chrome/browser/tab_contents/tab_contents.h" 20 #include "chrome/browser/tab_contents/tab_contents.h"
21 #include "chrome/common/gtk_util.h" 21 #include "chrome/common/gtk_util.h"
22 #include "grit/app_resources.h" 22 #include "grit/app_resources.h"
23 #include "grit/theme_resources.h" 23 #include "grit/theme_resources.h"
24 24
25 #if defined(LINUX2) 25 #if defined(LINUX2)
26 #include "chrome/browser/browser.h" 26 #include "chrome/browser/browser.h"
27 #include "chrome/browser/browser_list.h" 27 #include "chrome/browser/browser_list.h"
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 model_->AddObserver(this); 470 model_->AddObserver(this);
471 471
472 tabstrip_.Own(gtk_fixed_new()); 472 tabstrip_.Own(gtk_fixed_new());
473 gtk_widget_set_size_request(tabstrip_.get(), -1, 473 gtk_widget_set_size_request(tabstrip_.get(), -1,
474 TabGtk::GetMinimumUnselectedSize().height()); 474 TabGtk::GetMinimumUnselectedSize().height());
475 gtk_widget_set_app_paintable(tabstrip_.get(), TRUE); 475 gtk_widget_set_app_paintable(tabstrip_.get(), TRUE);
476 gtk_drag_dest_set(tabstrip_.get(), GTK_DEST_DEFAULT_ALL, 476 gtk_drag_dest_set(tabstrip_.get(), GTK_DEST_DEFAULT_ALL,
477 NULL, 0, 477 NULL, 0,
478 static_cast<GdkDragAction>( 478 static_cast<GdkDragAction>(
479 GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK)); 479 GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK));
480 dnd::SetDestTargetListFromCodeMask(tabstrip_.get(), 480 GtkDndUtil::SetDestTargetListFromCodeMask(tabstrip_.get(),
481 dnd::X_CHROME_TEXT_URI_LIST | 481 GtkDndUtil::X_CHROME_TEXT_URI_LIST |
482 dnd::X_CHROME_TEXT_PLAIN); 482 GtkDndUtil::X_CHROME_TEXT_PLAIN);
483 483
484 g_signal_connect(G_OBJECT(tabstrip_.get()), "expose-event", 484 g_signal_connect(G_OBJECT(tabstrip_.get()), "expose-event",
485 G_CALLBACK(OnExpose), this); 485 G_CALLBACK(OnExpose), this);
486 g_signal_connect(G_OBJECT(tabstrip_.get()), "size-allocate", 486 g_signal_connect(G_OBJECT(tabstrip_.get()), "size-allocate",
487 G_CALLBACK(OnSizeAllocate), this); 487 G_CALLBACK(OnSizeAllocate), this);
488 g_signal_connect(G_OBJECT(tabstrip_.get()), "drag-motion", 488 g_signal_connect(G_OBJECT(tabstrip_.get()), "drag-motion",
489 G_CALLBACK(OnDragMotion), this); 489 G_CALLBACK(OnDragMotion), this);
490 g_signal_connect(G_OBJECT(tabstrip_.get()), "drag-drop", 490 g_signal_connect(G_OBJECT(tabstrip_.get()), "drag-drop",
491 G_CALLBACK(OnDragDrop), this); 491 G_CALLBACK(OnDragDrop), this);
492 g_signal_connect(G_OBJECT(tabstrip_.get()), "drag-leave", 492 g_signal_connect(G_OBJECT(tabstrip_.get()), "drag-leave",
(...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after
1546 } 1546 }
1547 1547
1548 // static 1548 // static
1549 gboolean TabStripGtk::OnDragDataReceived(GtkWidget* widget, 1549 gboolean TabStripGtk::OnDragDataReceived(GtkWidget* widget,
1550 GdkDragContext* context, 1550 GdkDragContext* context,
1551 gint x, gint y, 1551 gint x, gint y,
1552 GtkSelectionData* data, 1552 GtkSelectionData* data,
1553 guint info, guint time, 1553 guint info, guint time,
1554 TabStripGtk* tabstrip) { 1554 TabStripGtk* tabstrip) {
1555 // TODO(jhawkins): Parse URI lists. 1555 // TODO(jhawkins): Parse URI lists.
1556 if (info == dnd::X_CHROME_TEXT_PLAIN) { 1556 if (info == GtkDndUtil::X_CHROME_TEXT_PLAIN) {
1557 tabstrip->CompleteDrop(data->data); 1557 tabstrip->CompleteDrop(data->data);
1558 gtk_drag_finish(context, TRUE, TRUE, time); 1558 gtk_drag_finish(context, TRUE, TRUE, time);
1559 } 1559 }
1560 1560
1561 return TRUE; 1561 return TRUE;
1562 } 1562 }
1563 1563
1564 // static 1564 // static
1565 void TabStripGtk::OnNewTabClicked(GtkWidget* widget, TabStripGtk* tabstrip) { 1565 void TabStripGtk::OnNewTabClicked(GtkWidget* widget, TabStripGtk* tabstrip) {
1566 tabstrip->model_->delegate()->AddBlankTab(true); 1566 tabstrip->model_->delegate()->AddBlankTab(true);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1610 DCHECK(browser); // In order for the user to click on the tab there should 1610 DCHECK(browser); // In order for the user to click on the tab there should
1611 // be an active browser. 1611 // be an active browser.
1612 TabOverviewTypes::Message message; 1612 TabOverviewTypes::Message message;
1613 message.set_type(TabOverviewTypes::Message::WM_SWITCH_TO_OVERVIEW_MODE); 1613 message.set_type(TabOverviewTypes::Message::WM_SWITCH_TO_OVERVIEW_MODE);
1614 GtkWidget* browser_widget = GTK_WIDGET( 1614 GtkWidget* browser_widget = GTK_WIDGET(
1615 static_cast<BrowserWindowGtk*>(browser->window())->GetNativeHandle()); 1615 static_cast<BrowserWindowGtk*>(browser->window())->GetNativeHandle());
1616 message.set_param(0, x11_util::GetX11WindowFromGtkWidget(browser_widget)); 1616 message.set_param(0, x11_util::GetX11WindowFromGtkWidget(browser_widget));
1617 TabOverviewTypes::instance()->SendMessage(message); 1617 TabOverviewTypes::instance()->SendMessage(message);
1618 } 1618 }
1619 #endif 1619 #endif
OLDNEW
« no previous file with comments | « chrome/browser/gtk/tabs/tab_gtk.cc ('k') | chrome/browser/tab_contents/tab_contents_view_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698