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

Issue 2514001: GTK: fix site type icon dragging. (Closed)

Created:
10 years, 6 months ago by Evan Stade
Modified:
9 years, 6 months ago
Reviewers:
Elliot Glaysher
CC:
chromium-reviews, ben+cc_chromium.org
Base URL:
http://src.chromium.org/git/chromium.git
Visibility:
Public.

Description

GTK: fix site type icon dragging. Don't connect to the drag events more than once. BUG=45270 TEST=dragging that box in debug mode, no backtrace Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=48780

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -7 lines) Patch
M chrome/browser/gtk/location_bar_view_gtk.cc View 3 chunks +7 lines, -7 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
Evan Stade
10 years, 6 months ago (2010-06-02 22:24:08 UTC) #1
Elliot Glaysher
10 years, 6 months ago (2010-06-02 22:27:17 UTC) #2
Makes sense. LGTM.

On Wed, Jun 2, 2010 at 3:24 PM,  <estade@chromium.org> wrote:
> Reviewers: Elliot Glaysher,
>
> Description:
> GTK: fix site type icon dragging.
>
> Don't connect to the drag events more than once.
>
> BUG=45270
> TEST=dragging that box in debug mode, no backtrace
>
> Please review this at http://codereview.chromium.org/2514001/show
>
> SVN Base: http://src.chromium.org/git/chromium.git
>
> Affected files:
>  M chrome/browser/gtk/location_bar_view_gtk.cc
>
>
> Index: chrome/browser/gtk/location_bar_view_gtk.cc
> diff --git a/chrome/browser/gtk/location_bar_view_gtk.cc
> b/chrome/browser/gtk/location_bar_view_gtk.cc
> index
>
eb1ca61ee14542da339ce8acc6b3ee487b46857b..1b89b07dcf4569ddfa94f38c1be4c3de7c19083f
> 100644
> --- a/chrome/browser/gtk/location_bar_view_gtk.cc
> +++ b/chrome/browser/gtk/location_bar_view_gtk.cc
> @@ -319,6 +319,12 @@ void LocationBarViewGtk::BuildSiteTypeArea() {
>   site_type_event_box_ = gtk_event_box_new();
>   gtk_widget_modify_bg(site_type_event_box_, GTK_STATE_NORMAL,
>                        &kEvSecureBackgroundColor);
> +  g_signal_connect(site_type_event_box_, "drag-data-get",
> +                   G_CALLBACK(&OnIconDragDataThunk), this);
> +  g_signal_connect(site_type_event_box_, "drag-begin",
> +                   G_CALLBACK(&OnIconDragBeginThunk), this);
> +  g_signal_connect(site_type_event_box_, "drag-end",
> +                   G_CALLBACK(&OnIconDragEndThunk), this);
>
>   // Make the event box not visible so it does not paint a background.
>   gtk_event_box_set_visible_window(GTK_EVENT_BOX(site_type_event_box_),
> @@ -358,13 +364,6 @@ void LocationBarViewGtk::SetSiteTypeDragSource() {
>                                                 gtk_dnd_util::TEXT_PLAIN |
>                                                 gtk_dnd_util::TEXT_URI_LIST
> |
>
> gtk_dnd_util::CHROME_NAMED_URL);
> -
> -  g_signal_connect(site_type_event_box_, "drag-data-get",
> -                   G_CALLBACK(&OnIconDragDataThunk), this);
> -  g_signal_connect(site_type_event_box_, "drag-begin",
> -                   G_CALLBACK(&OnIconDragBeginThunk), this);
> -  g_signal_connect(site_type_event_box_, "drag-end",
> -                   G_CALLBACK(&OnIconDragEndThunk), this);
>  }
>
>  void LocationBarViewGtk::SetProfile(Profile* profile) {
> @@ -1006,6 +1005,7 @@ void LocationBarViewGtk::OnIconDragBegin(GtkWidget*
> sender,
>
>  void LocationBarViewGtk::OnIconDragEnd(GtkWidget* sender,
>                                        GdkDragContext* context) {
> +  DCHECK(drag_icon_);
>   gtk_widget_destroy(drag_icon_);
>   drag_icon_ = NULL;
>  }
>
>
>

Powered by Google App Engine
This is Rietveld 408576698