OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ui/views/widget/desktop_aura/desktop_drag_drop_client_win.h" |
| 6 |
| 7 #include "ui/base/dragdrop/drag_drop_types.h" |
| 8 #include "ui/base/dragdrop/drag_source.h" |
| 9 #include "ui/base/dragdrop/os_exchange_data_provider_win.h" |
| 10 |
| 11 namespace views { |
| 12 |
| 13 DesktopDragDropClientWin::DesktopDragDropClientWin() |
| 14 : drag_drop_in_progress_(false), |
| 15 drag_operation_(0) { |
| 16 } |
| 17 |
| 18 DesktopDragDropClientWin::~DesktopDragDropClientWin() { |
| 19 } |
| 20 |
| 21 int DesktopDragDropClientWin::StartDragAndDrop( |
| 22 const ui::OSExchangeData& data, |
| 23 aura::RootWindow* root_window, |
| 24 aura::Window* source_window, |
| 25 const gfx::Point& root_location, |
| 26 int operation, |
| 27 ui::DragDropTypes::DragEventSource source) { |
| 28 drag_drop_in_progress_ = true; |
| 29 drag_operation_ = operation; |
| 30 |
| 31 drag_source_ = new ui::DragSource; |
| 32 DWORD effects; |
| 33 DoDragDrop(ui::OSExchangeDataProviderWin::GetIDataObject(data), |
| 34 drag_source_, |
| 35 ui::DragDropTypes::DragOperationToDropEffect(operation), |
| 36 &effects); |
| 37 |
| 38 drag_drop_in_progress_ = false; |
| 39 |
| 40 return drag_operation_; |
| 41 } |
| 42 |
| 43 void DesktopDragDropClientWin::DragUpdate(aura::Window* target, |
| 44 const ui::LocatedEvent& event) { |
| 45 } |
| 46 |
| 47 void DesktopDragDropClientWin::Drop(aura::Window* target, |
| 48 const ui::LocatedEvent& event) { |
| 49 } |
| 50 |
| 51 void DesktopDragDropClientWin::DragCancel() { |
| 52 drag_source_->CancelDrag(); |
| 53 drag_operation_ = 0; |
| 54 } |
| 55 |
| 56 bool DesktopDragDropClientWin::IsDragDropInProgress() { |
| 57 return drag_drop_in_progress_; |
| 58 } |
| 59 |
| 60 } // namespace views |
OLD | NEW |