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

Unified Diff: chrome/browser/ui/gtk/location_bar_view_gtk.cc

Issue 10693088: Get URL and title at the beginning of favicon drag-and-drop, not at the end. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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/ui/gtk/location_bar_view_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/ui/gtk/location_bar_view_gtk.cc
diff --git a/chrome/browser/ui/gtk/location_bar_view_gtk.cc b/chrome/browser/ui/gtk/location_bar_view_gtk.cc
index 94a4bbf2ad9532c7ef956399f4e288021bc15758..58f93a4cb332be2dae1e9917b6dbdc3404c2e62e 100644
--- a/chrome/browser/ui/gtk/location_bar_view_gtk.cc
+++ b/chrome/browser/ui/gtk/location_bar_view_gtk.cc
@@ -1184,10 +1184,7 @@ void LocationBarViewGtk::OnIconDragData(GtkWidget* sender,
GdkDragContext* context,
GtkSelectionData* data,
guint info, guint time) {
- WebContents* tab = GetWebContents();
- if (!tab)
- return;
- ui::WriteURLWithName(data, tab->GetURL(), tab->GetTitle(), info);
+ ui::WriteURLWithName(data, drag_url_, drag_title_, info);
}
void LocationBarViewGtk::OnIconDragBegin(GtkWidget* sender,
@@ -1200,6 +1197,12 @@ void LocationBarViewGtk::OnIconDragBegin(GtkWidget* sender,
GetTitle(), theme_service_);
g_object_unref(pixbuf);
gtk_drag_set_icon_widget(context, drag_icon_, 0, 0);
+
+ WebContents* tab = GetWebContents();
+ if (!tab)
+ return;
+ drag_url_ = tab->GetURL();
+ drag_title_ = tab->GetTitle();
}
void LocationBarViewGtk::OnIconDragEnd(GtkWidget* sender,
@@ -1207,6 +1210,8 @@ void LocationBarViewGtk::OnIconDragEnd(GtkWidget* sender,
DCHECK(drag_icon_);
gtk_widget_destroy(drag_icon_);
drag_icon_ = NULL;
+ drag_url_ = GURL::EmptyGURL();
+ drag_title_.clear();
}
void LocationBarViewGtk::OnHboxSizeAllocate(GtkWidget* sender,
« no previous file with comments | « chrome/browser/ui/gtk/location_bar_view_gtk.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698