diff options
Diffstat (limited to 'chrome/browser/gtk/download_item_gtk.cc')
-rw-r--r-- | chrome/browser/gtk/download_item_gtk.cc | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/chrome/browser/gtk/download_item_gtk.cc b/chrome/browser/gtk/download_item_gtk.cc index 9ea494c..47c8f86 100644 --- a/chrome/browser/gtk/download_item_gtk.cc +++ b/chrome/browser/gtk/download_item_gtk.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -9,7 +9,6 @@ #include "app/gfx/color_utils.h" #include "app/gfx/font.h" #include "app/gfx/text_elider.h" -#include "app/gtk_dnd_util.h" #include "app/menus/simple_menu_model.h" #include "app/resource_bundle.h" #include "app/slide_animation.h" @@ -23,6 +22,7 @@ #include "chrome/browser/download/download_manager.h" #include "chrome/browser/download/download_shelf.h" #include "chrome/browser/download/download_util.h" +#include "chrome/browser/gtk/download_item_drag.h" #include "chrome/browser/gtk/download_shelf_gtk.h" #include "chrome/browser/gtk/gtk_theme_provider.h" #include "chrome/browser/gtk/menu_gtk.h" @@ -32,7 +32,6 @@ #include "chrome/common/notification_service.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" -#include "net/base/net_util.h" #include "skia/ext/skia_utils_gtk.h" #include "third_party/skia/include/core/SkBitmap.h" @@ -370,13 +369,7 @@ void DownloadItemGtk::OnDownloadUpdated(DownloadItem* download) { StopDownloadProgress(); // Set up the widget as a drag source. - gtk_drag_source_set(body_.get(), GDK_BUTTON1_MASK, NULL, 0, - GDK_ACTION_COPY); - GtkDndUtil::SetSourceTargetListFromCodeMask(body_.get(), - GtkDndUtil::TEXT_URI_LIST | - GtkDndUtil::CHROME_NAMED_URL); - g_signal_connect(body_.get(), "drag-data-get", - G_CALLBACK(OnDragDataGet), this); + DownloadItemDrag::SetSource(body_.get(), get_download()); complete_animation_.reset(new SlideAnimation(this)); complete_animation_->SetSlideDuration(kCompleteAnimationDurationMs); @@ -871,17 +864,6 @@ void DownloadItemGtk::OnShelfResized(GtkWidget *widget, } // static -void DownloadItemGtk::OnDragDataGet(GtkWidget* widget, GdkDragContext* context, - GtkSelectionData* selection_data, - guint target_type, guint time, - DownloadItemGtk* item) { - GURL url = net::FilePathToFileURL(item->get_download()->full_path()); - - GtkDndUtil::WriteURLWithName(selection_data, url, - UTF8ToUTF16(item->get_download()->GetFileName().value()), target_type); -} - -// static gboolean DownloadItemGtk::OnDangerousPromptExpose(GtkWidget* widget, GdkEventExpose* event, DownloadItemGtk* item) { if (!item->theme_provider_->UseGtkTheme()) { |