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

Unified Diff: chrome/browser/gtk/tabs/tab_strip_gtk.cc

Issue 149426: Fix a few issues with the drop arrow in the Linux tab strip:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/gtk/tabs/tab_strip_gtk.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/tabs/tab_strip_gtk.cc
===================================================================
--- chrome/browser/gtk/tabs/tab_strip_gtk.cc (revision 20334)
+++ chrome/browser/gtk/tabs/tab_strip_gtk.cc (working copy)
@@ -494,8 +494,6 @@
G_CALLBACK(OnDragDrop), this);
g_signal_connect(G_OBJECT(tabstrip_.get()), "drag-leave",
G_CALLBACK(OnDragLeave), this);
- g_signal_connect(G_OBJECT(tabstrip_.get()), "drag-failed",
- G_CALLBACK(OnDragFailed), this);
g_signal_connect(G_OBJECT(tabstrip_.get()), "drag-data-received",
G_CALLBACK(OnDragDataReceived), this);
@@ -1224,19 +1222,19 @@
drop_bounds.width(), drop_bounds.height());
}
-void TabStripGtk::CompleteDrop(guchar* data) {
+bool TabStripGtk::CompleteDrop(guchar* data) {
if (!drop_info_.get())
- return;
+ return false;
const int drop_index = drop_info_->drop_index;
const bool drop_before = drop_info_->drop_before;
- // Hide the drop indicator.
- SetDropIndex(-1, false);
+ // Destroy the drop indicator.
+ drop_info_.reset();
GURL url(reinterpret_cast<char*>(data));
if (!url.is_valid())
- return;
+ return false;
if (drop_before) {
// Insert a new tab.
@@ -1251,6 +1249,8 @@
url, GURL(), PageTransition::GENERATED);
model_->SelectTabContentsAt(drop_index, true);
}
+
+ return true;
}
// static
@@ -1272,13 +1272,12 @@
g_signal_connect(G_OBJECT(container), "expose-event",
G_CALLBACK(OnExposeEvent), this);
gtk_widget_add_events(container, GDK_STRUCTURE_MASK);
- gtk_widget_show_all(container);
-
- drop_arrow = GetDropArrowImage(point_down);
-
gtk_window_move(GTK_WINDOW(container), 0, 0);
gtk_window_resize(GTK_WINDOW(container),
drop_indicator_width, drop_indicator_height);
+ gtk_widget_show_all(container);
+
+ drop_arrow = GetDropArrowImage(point_down);
}
TabStripGtk::DropInfo::~DropInfo() {
@@ -1550,33 +1549,26 @@
// static
gboolean TabStripGtk::OnDragLeave(GtkWidget* widget, GdkDragContext* context,
guint time, TabStripGtk* tabstrip) {
- // Hide the drop indicator.
- tabstrip->SetDropIndex(-1, false);
+ // Destroy the drop indicator.
+ tabstrip->drop_info_.reset();
return FALSE;
}
// static
-gboolean TabStripGtk::OnDragFailed(GtkWidget* widget, GdkDragContext* context,
- GtkDragResult result,
- TabStripGtk* tabstrip) {
- // Hide the drop indicator.
- tabstrip->SetDropIndex(-1, false);
- return FALSE;
-}
-
-// static
gboolean TabStripGtk::OnDragDataReceived(GtkWidget* widget,
GdkDragContext* context,
gint x, gint y,
GtkSelectionData* data,
guint info, guint time,
TabStripGtk* tabstrip) {
+ bool success = false;
+
// TODO(jhawkins): Parse URI lists.
if (info == GtkDndUtil::X_CHROME_TEXT_PLAIN) {
- tabstrip->CompleteDrop(data->data);
- gtk_drag_finish(context, TRUE, TRUE, time);
+ success = tabstrip->CompleteDrop(data->data);
}
+ gtk_drag_finish(context, success, success, time);
return TRUE;
}
« no previous file with comments | « chrome/browser/gtk/tabs/tab_strip_gtk.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698