summaryrefslogtreecommitdiffstats
path: root/ash/drag_drop
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-08 00:39:05 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-08 00:39:05 +0000
commitdeafa3ec97696cdcfd3cf0154b373952ab5be9a2 (patch)
tree5d2d8a367f6c2412b2ee26abfc4d4ab008412b93 /ash/drag_drop
parentb9e2fe5f07bded6e20102f718715d9eaacdab9a3 (diff)
downloadchromium_src-deafa3ec97696cdcfd3cf0154b373952ab5be9a2.zip
chromium_src-deafa3ec97696cdcfd3cf0154b373952ab5be9a2.tar.gz
chromium_src-deafa3ec97696cdcfd3cf0154b373952ab5be9a2.tar.bz2
Get drag and drop working for win aura.
This makes a bunch of bookmark interactive tests pass. BUG=154081 Review URL: https://codereview.chromium.org/11444013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171898 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/drag_drop')
-rw-r--r--ash/drag_drop/drag_drop_controller.cc12
-rw-r--r--ash/drag_drop/drag_drop_controller_unittest.cc9
2 files changed, 17 insertions, 4 deletions
diff --git a/ash/drag_drop/drag_drop_controller.cc b/ash/drag_drop/drag_drop_controller.cc
index cf6135e..4248099 100644
--- a/ash/drag_drop/drag_drop_controller.cc
+++ b/ash/drag_drop/drag_drop_controller.cc
@@ -106,6 +106,17 @@ int DragDropController::StartDragAndDrop(
if (IsDragDropInProgress())
return 0;
+#if defined(OS_WIN)
+ // TODO(win_ash): need to figure out how this will work in Metro, since
+ // OSExchangeDataProviderAura isn't used in Windows builds. Two alternatives:
+ // 1) Use OSExchangeDataProviderAura in Ash and OSExchangeDataProviderWin
+ // elsewhere. This will complicate creating an ui::OSExchangeData to pass
+ // in more context.
+ // 2) Add methods to get the image and offset in the base interface of these
+ // implementations to get to this data here.
+ NOTIMPLEMENTED();
+ return 0;
+#else
const ui::OSExchangeDataProviderAura& provider =
static_cast<const ui::OSExchangeDataProviderAura&>(data.provider());
// We do not support touch drag/drop without a drag image.
@@ -180,6 +191,7 @@ int DragDropController::StartDragAndDrop(
drag_source_window_->RemoveObserver(this);
drag_source_window_ = NULL;
}
+#endif
return drag_operation_;
}
diff --git a/ash/drag_drop/drag_drop_controller_unittest.cc b/ash/drag_drop/drag_drop_controller_unittest.cc
index 14a25c6..06969eb 100644
--- a/ash/drag_drop/drag_drop_controller_unittest.cc
+++ b/ash/drag_drop/drag_drop_controller_unittest.cc
@@ -16,8 +16,8 @@
#include "ui/base/clipboard/clipboard.h"
#include "ui/base/clipboard/scoped_clipboard_writer.h"
#include "ui/base/dragdrop/drag_drop_types.h"
+#include "ui/base/dragdrop/drag_utils.h"
#include "ui/base/dragdrop/os_exchange_data.h"
-#include "ui/base/dragdrop/os_exchange_data_provider_aura.h"
#include "ui/base/events/event.h"
#include "ui/base/gestures/gesture_types.h"
#include "ui/base/ui_base_switches.h"
@@ -73,12 +73,13 @@ class DragTestView : public views::View {
void WriteDragData(const gfx::Point& p, OSExchangeData* data) OVERRIDE {
data->SetString(UTF8ToUTF16("I am being dragged"));
- ui::OSExchangeDataProviderAura& provider =
- static_cast<ui::OSExchangeDataProviderAura&>(data->provider());
gfx::ImageSkiaRep* image = new gfx::ImageSkiaRep(
gfx::Size(10, 20), ui::SCALE_FACTOR_100P);
gfx::ImageSkia* image_skia = new gfx::ImageSkia(*image);
- provider.set_drag_image(*image_skia);
+
+ drag_utils::SetDragImageOnDataObject(
+ *image_skia, gfx::Size(image_skia->width(), image_skia->height()),
+ gfx::Vector2d(), data);
}
bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE {