| 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_PUBLIC_BROWSER_WEB_DRAG_DEST_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_DRAG_DEST_DELEGATE_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_WEB_DRAG_DEST_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_DRAG_DEST_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 | 9 |
| 10 class GURL; | |
| 11 | |
| 12 namespace ui { | 10 namespace ui { |
| 13 class OSExchangeData; | 11 class OSExchangeData; |
| 14 } | 12 } |
| 15 | 13 |
| 16 namespace content { | 14 namespace content { |
| 17 class WebContents; | 15 class WebContents; |
| 18 struct DropData; | |
| 19 | 16 |
| 20 // An optional delegate that listens for drags of bookmark data. | 17 // An optional delegate that listens for drags of bookmark data. |
| 21 class WebDragDestDelegate { | 18 class WebDragDestDelegate { |
| 22 public: | 19 public: |
| 23 // Announces that a drag has started. It's valid that a drag starts, along | 20 // Announces that a drag has started. It's valid that a drag starts, along |
| 24 // with over/enter/leave/drop notifications without receiving any bookmark | 21 // with over/enter/leave/drop notifications without receiving any bookmark |
| 25 // data. | 22 // data. |
| 26 virtual void DragInitialize(WebContents* contents) = 0; | 23 virtual void DragInitialize(WebContents* contents) = 0; |
| 27 | 24 |
| 28 // Notifications of drag progression. | 25 // Notifications of drag progression. |
| 29 virtual void OnDragOver() = 0; | 26 virtual void OnDragOver() = 0; |
| 30 virtual void OnDragEnter() = 0; | 27 virtual void OnDragEnter() = 0; |
| 31 virtual void OnDrop() = 0; | 28 virtual void OnDrop() = 0; |
| 32 // This should also clear any state kept about this drag. | 29 // This should also clear any state kept about this drag. |
| 33 virtual void OnDragLeave() = 0; | 30 virtual void OnDragLeave() = 0; |
| 34 | 31 |
| 35 #if defined(USE_AURA) | 32 #if defined(USE_AURA) |
| 36 // Called at the start of every drag to supply the data associated with the | 33 // Called at the start of every drag to supply the data associated with the |
| 37 // drag. | 34 // drag. |
| 38 virtual void OnReceiveDragData(const ui::OSExchangeData& data) = 0; | 35 virtual void OnReceiveDragData(const ui::OSExchangeData& data) = 0; |
| 39 #endif // USE_AURA | 36 #endif // USE_AURA |
| 40 | 37 |
| 41 virtual ~WebDragDestDelegate() {} | 38 virtual ~WebDragDestDelegate() {} |
| 42 }; | 39 }; |
| 43 | 40 |
| 44 } // namespace content | 41 } // namespace content |
| 45 | 42 |
| 46 #endif // CONTENT_PUBLIC_BROWSER_WEB_DRAG_DEST_DELEGATE_H_ | 43 #endif // CONTENT_PUBLIC_BROWSER_WEB_DRAG_DEST_DELEGATE_H_ |
| OLD | NEW |