diff options
author | skrul@google.com <skrul@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-21 20:01:08 +0000 |
---|---|---|
committer | skrul@google.com <skrul@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-21 20:01:08 +0000 |
commit | 6806d48ab1ce1f7dc3104033467581959368c28e (patch) | |
tree | 7875e66662af55969be0b3e668525c5a6b336b84 /app/os_exchange_data_provider_gtk.cc | |
parent | e08d7b463a5c82d253def91b20c8ed1756e8d337 (diff) | |
download | chromium_src-6806d48ab1ce1f7dc3104033467581959368c28e.zip chromium_src-6806d48ab1ce1f7dc3104033467581959368c28e.tar.gz chromium_src-6806d48ab1ce1f7dc3104033467581959368c28e.tar.bz2 |
Implement dragging icon for dragging bookmarks in views/gtk.
Review URL: http://codereview.chromium.org/270068
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29692 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/os_exchange_data_provider_gtk.cc')
-rw-r--r-- | app/os_exchange_data_provider_gtk.cc | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/app/os_exchange_data_provider_gtk.cc b/app/os_exchange_data_provider_gtk.cc index 597a5ae..dbae20e 100644 --- a/app/os_exchange_data_provider_gtk.cc +++ b/app/os_exchange_data_provider_gtk.cc @@ -16,15 +16,23 @@ OSExchangeDataProviderGtk::OSExchangeDataProviderGtk( const std::set<GdkAtom>& known_custom_formats) : known_formats_(known_formats), known_custom_formats_(known_custom_formats), - formats_(0) { + formats_(0), + drag_image_(NULL), + cursor_offset_x_(0), + cursor_offset_y_(0) { } OSExchangeDataProviderGtk::OSExchangeDataProviderGtk() : known_formats_(0), - formats_(0) { + formats_(0), + drag_image_(NULL), + cursor_offset_x_(0), + cursor_offset_y_(0) { } OSExchangeDataProviderGtk::~OSExchangeDataProviderGtk() { + if (drag_image_) + g_object_unref(drag_image_); } bool OSExchangeDataProviderGtk::HasDataForAllFormats( @@ -218,6 +226,17 @@ bool OSExchangeDataProviderGtk::GetPlainTextURL(GURL* url) const { return true; } +void OSExchangeDataProviderGtk::SetDragImage(GdkPixbuf* drag_image, + int cursor_offset_x, + int cursor_offset_y) { + if (drag_image_) + g_object_unref(drag_image_); + g_object_ref(drag_image); + drag_image_ = drag_image; + cursor_offset_x_ = cursor_offset_x; + cursor_offset_y_ = cursor_offset_y; +} + /////////////////////////////////////////////////////////////////////////////// // OSExchangeData, public: |