| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/views/widget/desktop_aura/desktop_drag_drop_client_win.h" | 5 #include "ui/views/widget/desktop_aura/desktop_drag_drop_client_win.h" |
| 6 | 6 |
| 7 #include "ui/base/dragdrop/drag_drop_types.h" | 7 #include "ui/base/dragdrop/drag_drop_types.h" |
| 8 #include "ui/base/dragdrop/drag_source_win.h" | 8 #include "ui/base/dragdrop/drag_source_win.h" |
| 9 #include "ui/base/dragdrop/drop_target_event.h" | 9 #include "ui/base/dragdrop/drop_target_event.h" |
| 10 #include "ui/base/dragdrop/os_exchange_data_provider_win.h" | 10 #include "ui/base/dragdrop/os_exchange_data_provider_win.h" |
| 11 #include "ui/views/widget/desktop_aura/desktop_drop_target_win.h" | 11 #include "ui/views/widget/desktop_aura/desktop_drop_target_win.h" |
| 12 #include "ui/views/widget/desktop_aura/desktop_root_window_host_win.h" | 12 #include "ui/views/widget/desktop_aura/desktop_root_window_host_win.h" |
| 13 #include "ui/views/widget/drop_target_win.h" | 13 #include "ui/views/widget/drop_target_win.h" |
| 14 | 14 |
| 15 namespace views { | 15 namespace views { |
| 16 | 16 |
| 17 DesktopDragDropClientWin::DesktopDragDropClientWin( | 17 DesktopDragDropClientWin::DesktopDragDropClientWin( |
| 18 aura::RootWindow* root_window, | 18 aura::Window* root_window, |
| 19 HWND window) | 19 HWND window) |
| 20 : drag_drop_in_progress_(false), | 20 : drag_drop_in_progress_(false), |
| 21 drag_operation_(0) { | 21 drag_operation_(0) { |
| 22 drop_target_ = new DesktopDropTargetWin(root_window, window); | 22 drop_target_ = new DesktopDropTargetWin(root_window, window); |
| 23 } | 23 } |
| 24 | 24 |
| 25 DesktopDragDropClientWin::~DesktopDragDropClientWin() { | 25 DesktopDragDropClientWin::~DesktopDragDropClientWin() { |
| 26 } | 26 } |
| 27 | 27 |
| 28 int DesktopDragDropClientWin::StartDragAndDrop( | 28 int DesktopDragDropClientWin::StartDragAndDrop( |
| 29 const ui::OSExchangeData& data, | 29 const ui::OSExchangeData& data, |
| 30 aura::RootWindow* root_window, | 30 aura::Window* root_window, |
| 31 aura::Window* source_window, | 31 aura::Window* source_window, |
| 32 const gfx::Point& root_location, | 32 const gfx::Point& root_location, |
| 33 int operation, | 33 int operation, |
| 34 ui::DragDropTypes::DragEventSource source) { | 34 ui::DragDropTypes::DragEventSource source) { |
| 35 drag_drop_in_progress_ = true; | 35 drag_drop_in_progress_ = true; |
| 36 drag_operation_ = operation; | 36 drag_operation_ = operation; |
| 37 | 37 |
| 38 drag_source_ = new ui::DragSourceWin; | 38 drag_source_ = new ui::DragSourceWin; |
| 39 DWORD effect; | 39 DWORD effect; |
| 40 HRESULT result = DoDragDrop( | 40 HRESULT result = DoDragDrop( |
| (...skipping 28 matching lines...) Expand all Loading... |
| 69 } | 69 } |
| 70 | 70 |
| 71 void DesktopDragDropClientWin::OnNativeWidgetDestroying(HWND window) { | 71 void DesktopDragDropClientWin::OnNativeWidgetDestroying(HWND window) { |
| 72 if (drop_target_.get()) { | 72 if (drop_target_.get()) { |
| 73 RevokeDragDrop(window); | 73 RevokeDragDrop(window); |
| 74 drop_target_ = NULL; | 74 drop_target_ = NULL; |
| 75 } | 75 } |
| 76 } | 76 } |
| 77 | 77 |
| 78 } // namespace views | 78 } // namespace views |
| OLD | NEW |