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

Unified Diff: ui/views/widget/desktop_aura/desktop_drag_drop_client_win.cc

Issue 11444013: Get drag and drop working for win aura. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/views/widget/desktop_aura/desktop_drag_drop_client_win.cc
===================================================================
--- ui/views/widget/desktop_aura/desktop_drag_drop_client_win.cc (revision 0)
+++ ui/views/widget/desktop_aura/desktop_drag_drop_client_win.cc (revision 0)
@@ -0,0 +1,60 @@
+// 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.
+
+#include "ui/views/widget/desktop_aura/desktop_drag_drop_client_win.h"
+
+#include "ui/base/dragdrop/drag_drop_types.h"
+#include "ui/base/dragdrop/drag_source.h"
+#include "ui/base/dragdrop/os_exchange_data_provider_win.h"
+
+namespace views {
+
+DesktopDragDropClientWin::DesktopDragDropClientWin()
+ : drag_drop_in_progress_(false),
+ drag_operation_(0) {
+}
+
+DesktopDragDropClientWin::~DesktopDragDropClientWin() {
+}
+
+int DesktopDragDropClientWin::StartDragAndDrop(
+ const ui::OSExchangeData& data,
+ aura::RootWindow* root_window,
+ aura::Window* source_window,
+ const gfx::Point& root_location,
+ int operation,
+ ui::DragDropTypes::DragEventSource source) {
+ drag_drop_in_progress_ = true;
+ drag_operation_ = operation;
+
+ drag_source_ = new ui::DragSource;
+ DWORD effects;
+ DoDragDrop(ui::OSExchangeDataProviderWin::GetIDataObject(data),
+ drag_source_,
+ ui::DragDropTypes::DragOperationToDropEffect(operation),
+ &effects);
+
+ drag_drop_in_progress_ = false;
+
+ return drag_operation_;
+}
+
+void DesktopDragDropClientWin::DragUpdate(aura::Window* target,
+ const ui::LocatedEvent& event) {
+}
+
+void DesktopDragDropClientWin::Drop(aura::Window* target,
+ const ui::LocatedEvent& event) {
+}
+
+void DesktopDragDropClientWin::DragCancel() {
+ drag_source_->CancelDrag();
+ drag_operation_ = 0;
+}
+
+bool DesktopDragDropClientWin::IsDragDropInProgress() {
+ return drag_drop_in_progress_;
+}
+
+} // namespace views
Property changes on: ui\views\widget\desktop_aura\desktop_drag_drop_client_win.cc
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698