summaryrefslogtreecommitdiffstats
path: root/ui/base/dragdrop
diff options
context:
space:
mode:
authorvarunjain@chromium.org <varunjain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-10 22:34:22 +0000
committervarunjain@chromium.org <varunjain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-10 22:34:22 +0000
commit984ad4b32076274757a91e9ac68bd9e3eaf472d2 (patch)
treeed1cbc4e669d65ca82874716f2ed65f5a51c87db /ui/base/dragdrop
parent07d60721d409f246a4f60f6b422a141b5bbd426d (diff)
downloadchromium_src-984ad4b32076274757a91e9ac68bd9e3eaf472d2.zip
chromium_src-984ad4b32076274757a91e9ac68bd9e3eaf472d2.tar.gz
chromium_src-984ad4b32076274757a91e9ac68bd9e3eaf472d2.tar.bz2
Properly set drag image offset in aura's drag drop controller. Currently the
drag image is always positioned at the mouse cursor. BUG=118024 TEST=none Review URL: http://codereview.chromium.org/10044002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131648 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/base/dragdrop')
-rw-r--r--ui/base/dragdrop/drag_utils_aura.cc3
-rw-r--r--ui/base/dragdrop/os_exchange_data_provider_aura.h10
2 files changed, 10 insertions, 3 deletions
diff --git a/ui/base/dragdrop/drag_utils_aura.cc b/ui/base/dragdrop/drag_utils_aura.cc
index 41a9636..54a78c6 100644
--- a/ui/base/dragdrop/drag_utils_aura.cc
+++ b/ui/base/dragdrop/drag_utils_aura.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -21,6 +21,7 @@ void SetDragImageOnDataObject(const SkBitmap& bitmap,
ui::OSExchangeDataProviderAura& provider(
static_cast<ui::OSExchangeDataProviderAura&>(data_object->provider()));
provider.set_drag_image(bitmap);
+ provider.set_drag_image_offset(cursor_offset);
}
} // namespace drag_utils
diff --git a/ui/base/dragdrop/os_exchange_data_provider_aura.h b/ui/base/dragdrop/os_exchange_data_provider_aura.h
index 840e625..ad5c312 100644
--- a/ui/base/dragdrop/os_exchange_data_provider_aura.h
+++ b/ui/base/dragdrop/os_exchange_data_provider_aura.h
@@ -8,11 +8,12 @@
#include <map>
-#include "ui/base/dragdrop/os_exchange_data.h"
-#include "googleurl/src/gurl.h"
#include "base/pickle.h"
#include "base/file_path.h"
+#include "googleurl/src/gurl.h"
#include "third_party/skia/include/core/SkBitmap.h"
+#include "ui/base/dragdrop/os_exchange_data.h"
+#include "ui/gfx/point.h"
namespace ui {
@@ -58,6 +59,10 @@ class UI_EXPORT OSExchangeDataProviderAura : public OSExchangeData::Provider {
void set_drag_image(const SkBitmap& drag_image) { drag_image_ = drag_image; }
const SkBitmap& drag_image() const { return drag_image_; }
+ void set_drag_image_offset(const gfx::Point& drag_image_offset) {
+ drag_image_offset_ = drag_image_offset;
+ }
+ const gfx::Point& drag_image_offset() const { return drag_image_offset_; }
private:
typedef std::map<OSExchangeData::CustomFormat, Pickle> PickleData;
@@ -85,6 +90,7 @@ class UI_EXPORT OSExchangeDataProviderAura : public OSExchangeData::Provider {
// Drag image and offset data.
SkBitmap drag_image_;
+ gfx::Point drag_image_offset_;
// For HTML format
string16 html_;