| 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 CONTENT_BROWSER_WEB_CONTENTS_WEB_DRAG_SOURCE_WIN_H_ | 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_DRAG_SOURCE_WIN_H_ |
| 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_DRAG_SOURCE_WIN_H_ | 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_DRAG_SOURCE_WIN_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "content/public/browser/notification_observer.h" | 9 #include "content/public/browser/notification_observer.h" |
| 10 #include "content/public/browser/notification_registrar.h" | 10 #include "content/public/browser/notification_registrar.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 // Used to set the active data object for the current drag operation. The | 41 // Used to set the active data object for the current drag operation. The |
| 42 // caller must ensure that |data| is not destroyed before the nested drag loop | 42 // caller must ensure that |data| is not destroyed before the nested drag loop |
| 43 // terminates. | 43 // terminates. |
| 44 void set_data(ui::OSExchangeData* data) { data_ = data; } | 44 void set_data(ui::OSExchangeData* data) { data_ = data; } |
| 45 | 45 |
| 46 protected: | 46 protected: |
| 47 // ui::DragSourceWin | 47 // ui::DragSourceWin |
| 48 virtual void OnDragSourceCancel(); | 48 virtual void OnDragSourceCancel(); |
| 49 virtual void OnDragSourceDrop(); | 49 virtual void OnDragSourceDrop(); |
| 50 virtual void OnDragSourceMove(); | 50 virtual void OnDragSourceMove(); |
| 51 virtual bool ShouldDropDragSource(BOOL escape_pressed, DWORD key_state); |
| 51 | 52 |
| 52 private: | 53 private: |
| 53 // Cannot construct thusly. | 54 // Cannot construct thusly. |
| 54 WebDragSource(); | 55 WebDragSource(); |
| 55 | 56 |
| 56 // OnDragSourceDrop schedules its main work to be done after IDropTarget::Drop | 57 // OnDragSourceDrop schedules its main work to be done after IDropTarget::Drop |
| 57 // by posting a task to this function. | 58 // by posting a task to this function. |
| 58 void DelayedOnDragSourceDrop(); | 59 void DelayedOnDragSourceDrop(); |
| 59 | 60 |
| 61 void OnDragSourceEnded(); |
| 62 |
| 60 // Keep a reference to the window so we can translate the cursor position. | 63 // Keep a reference to the window so we can translate the cursor position. |
| 61 gfx::NativeWindow source_wnd_; | 64 gfx::NativeWindow source_wnd_; |
| 62 | 65 |
| 63 // We use this as a channel to the renderer to tell it about various drag | 66 // We use this as a channel to the renderer to tell it about various drag |
| 64 // drop events that it needs to know about (such as when a drag operation it | 67 // drop events that it needs to know about (such as when a drag operation it |
| 65 // initiated terminates). | 68 // initiated terminates). |
| 66 WebContentsImpl* web_contents_; | 69 WebContentsImpl* web_contents_; |
| 67 | 70 |
| 68 NotificationRegistrar registrar_; | 71 NotificationRegistrar registrar_; |
| 69 | 72 |
| 70 DWORD effect_; | 73 DWORD effect_; |
| 71 | 74 |
| 72 ui::OSExchangeData* data_; | 75 ui::OSExchangeData* data_; |
| 73 | 76 |
| 74 DISALLOW_COPY_AND_ASSIGN(WebDragSource); | 77 DISALLOW_COPY_AND_ASSIGN(WebDragSource); |
| 75 }; | 78 }; |
| 76 | 79 |
| 77 } // namespace content | 80 } // namespace content |
| 78 | 81 |
| 79 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_DRAG_SOURCE_WIN_H_ | 82 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_DRAG_SOURCE_WIN_H_ |
| OLD | NEW |