| 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 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTIOP_DROP_TARGET_WIN_H_ | 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTIOP_DROP_TARGET_WIN_H_ |
| 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTIOP_DROP_TARGET_WIN_H_ | 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTIOP_DROP_TARGET_WIN_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "ui/aura/window_observer.h" | 9 #include "ui/aura/window_observer.h" |
| 10 #include "ui/base/dragdrop/drop_target_win.h" | 10 #include "ui/base/dragdrop/drop_target_win.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 public aura::WindowObserver { | 29 public aura::WindowObserver { |
| 30 public: | 30 public: |
| 31 DesktopDropTargetWin(aura::Window* root_window, HWND window); | 31 DesktopDropTargetWin(aura::Window* root_window, HWND window); |
| 32 virtual ~DesktopDropTargetWin(); | 32 virtual ~DesktopDropTargetWin(); |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 // ui::DropTargetWin implementation: | 35 // ui::DropTargetWin implementation: |
| 36 virtual DWORD OnDragEnter(IDataObject* data_object, | 36 virtual DWORD OnDragEnter(IDataObject* data_object, |
| 37 DWORD key_state, | 37 DWORD key_state, |
| 38 POINT position, | 38 POINT position, |
| 39 DWORD effect) OVERRIDE; | 39 DWORD effect) override; |
| 40 virtual DWORD OnDragOver(IDataObject* data_object, | 40 virtual DWORD OnDragOver(IDataObject* data_object, |
| 41 DWORD key_state, | 41 DWORD key_state, |
| 42 POINT position, | 42 POINT position, |
| 43 DWORD effect) OVERRIDE; | 43 DWORD effect) override; |
| 44 virtual void OnDragLeave(IDataObject* data_object) OVERRIDE; | 44 virtual void OnDragLeave(IDataObject* data_object) override; |
| 45 virtual DWORD OnDrop(IDataObject* data_object, | 45 virtual DWORD OnDrop(IDataObject* data_object, |
| 46 DWORD key_state, | 46 DWORD key_state, |
| 47 POINT position, | 47 POINT position, |
| 48 DWORD effect) OVERRIDE; | 48 DWORD effect) override; |
| 49 | 49 |
| 50 // aura::WindowObserver implementation: | 50 // aura::WindowObserver implementation: |
| 51 virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE; | 51 virtual void OnWindowDestroyed(aura::Window* window) override; |
| 52 | 52 |
| 53 // Common functionality for the ui::DropTargetWin methods to translate from | 53 // Common functionality for the ui::DropTargetWin methods to translate from |
| 54 // COM data types to Aura ones. | 54 // COM data types to Aura ones. |
| 55 void Translate(IDataObject* data_object, | 55 void Translate(IDataObject* data_object, |
| 56 DWORD key_state, | 56 DWORD key_state, |
| 57 POINT cursor_position, | 57 POINT cursor_position, |
| 58 DWORD effect, | 58 DWORD effect, |
| 59 scoped_ptr<ui::OSExchangeData>* data, | 59 scoped_ptr<ui::OSExchangeData>* data, |
| 60 scoped_ptr<ui::DropTargetEvent>* event, | 60 scoped_ptr<ui::DropTargetEvent>* event, |
| 61 aura::client::DragDropDelegate** delegate); | 61 aura::client::DragDropDelegate** delegate); |
| 62 | 62 |
| 63 void NotifyDragLeave(); | 63 void NotifyDragLeave(); |
| 64 | 64 |
| 65 // The root window associated with this drop target. | 65 // The root window associated with this drop target. |
| 66 aura::Window* root_window_; | 66 aura::Window* root_window_; |
| 67 | 67 |
| 68 // The Aura window that is currently under the cursor. We need to manually | 68 // The Aura window that is currently under the cursor. We need to manually |
| 69 // keep track of this because Windows will only call our drag enter method | 69 // keep track of this because Windows will only call our drag enter method |
| 70 // once when the user enters the associated HWND. But inside that HWND there | 70 // once when the user enters the associated HWND. But inside that HWND there |
| 71 // could be multiple aura windows, so we need to generate drag enter events | 71 // could be multiple aura windows, so we need to generate drag enter events |
| 72 // for them. | 72 // for them. |
| 73 aura::Window* target_window_; | 73 aura::Window* target_window_; |
| 74 | 74 |
| 75 DISALLOW_COPY_AND_ASSIGN(DesktopDropTargetWin); | 75 DISALLOW_COPY_AND_ASSIGN(DesktopDropTargetWin); |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 } // namespace views | 78 } // namespace views |
| 79 | 79 |
| 80 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTIOP_DROP_TARGET_WIN_H_ | 80 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTIOP_DROP_TARGET_WIN_H_ |
| OLD | NEW |