| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #if defined(TOOLKIT_USES_GTK) | 9 #if defined(TOOLKIT_USES_GTK) |
| 10 #include <gtk/gtk.h> | 10 #include <gtk/gtk.h> |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 // An optional delegate that listens for drags of bookmark data. | 30 // An optional delegate that listens for drags of bookmark data. |
| 31 class WebDragDestDelegate { | 31 class WebDragDestDelegate { |
| 32 public: | 32 public: |
| 33 // Announces that a drag has started. It's valid that a drag starts, along | 33 // Announces that a drag has started. It's valid that a drag starts, along |
| 34 // with over/enter/leave/drop notifications without receiving any bookmark | 34 // with over/enter/leave/drop notifications without receiving any bookmark |
| 35 // data. | 35 // data. |
| 36 virtual void DragInitialize(WebContents* contents) = 0; | 36 virtual void DragInitialize(WebContents* contents) = 0; |
| 37 | 37 |
| 38 // Notifications of drag progression. | 38 // Notifications of drag progression. |
| 39 #if defined(OS_WIN) | 39 #if defined(OS_WIN) && !defined(USE_AURA) |
| 40 virtual void OnDragOver(IDataObject* data_object) = 0; | 40 virtual void OnDragOver(IDataObject* data_object) = 0; |
| 41 virtual void OnDragEnter(IDataObject* data_object) = 0; | 41 virtual void OnDragEnter(IDataObject* data_object) = 0; |
| 42 virtual void OnDrop(IDataObject* data_object) = 0; | 42 virtual void OnDrop(IDataObject* data_object) = 0; |
| 43 virtual void OnDragLeave(IDataObject* data_object) = 0; | 43 virtual void OnDragLeave(IDataObject* data_object) = 0; |
| 44 #else | 44 #else |
| 45 virtual void OnDragOver() = 0; | 45 virtual void OnDragOver() = 0; |
| 46 virtual void OnDragEnter() = 0; | 46 virtual void OnDragEnter() = 0; |
| 47 virtual void OnDrop() = 0; | 47 virtual void OnDrop() = 0; |
| 48 // This should also clear any state kept about this drag. | 48 // This should also clear any state kept about this drag. |
| 49 virtual void OnDragLeave() = 0; | 49 virtual void OnDragLeave() = 0; |
| 50 #endif | 50 #endif |
| 51 | 51 |
| 52 #if defined(TOOLKIT_USES_GTK) | 52 #if defined(TOOLKIT_USES_GTK) |
| 53 // Returns the bookmark atom type. GTK and Views return different values here. | 53 // Returns the bookmark atom type. GTK and Views return different values here. |
| 54 virtual GdkAtom GetBookmarkTargetAtom() const = 0; | 54 virtual GdkAtom GetBookmarkTargetAtom() const = 0; |
| 55 | 55 |
| 56 // Called when WebDragDestkGtk detects that there's bookmark data in a | 56 // Called when WebDragDestkGtk detects that there's bookmark data in a |
| 57 // drag. Not every drag will trigger these. | 57 // drag. Not every drag will trigger these. |
| 58 virtual void OnReceiveDataFromGtk(GtkSelectionData* data) = 0; | 58 virtual void OnReceiveDataFromGtk(GtkSelectionData* data) = 0; |
| 59 virtual void OnReceiveProcessedData(const GURL& url, | 59 virtual void OnReceiveProcessedData(const GURL& url, |
| 60 const string16& title) = 0; | 60 const string16& title) = 0; |
| 61 #elif defined(USE_AURA) |
| 62 // Called at the start of every drag to supply the data associated with the |
| 63 // drag. |
| 64 virtual void OnReceiveDragData(const ui::OSExchangeData& data) = 0; |
| 61 #elif defined(OS_WIN) | 65 #elif defined(OS_WIN) |
| 62 // Allows the delegate to set data on the drag. If it doesn't want to set | 66 // Allows the delegate to set data on the drag. If it doesn't want to set |
| 63 // data, it should return false. | 67 // data, it should return false. |
| 64 virtual bool AddDragData(const WebDropData& drop_data, | 68 virtual bool AddDragData(const WebDropData& drop_data, |
| 65 ui::OSExchangeData* data) = 0; | 69 ui::OSExchangeData* data) = 0; |
| 66 #endif // TOOLKIT_USES_GTK | 70 #endif // TOOLKIT_USES_GTK |
| 67 | 71 |
| 68 virtual ~WebDragDestDelegate() {} | 72 virtual ~WebDragDestDelegate() {} |
| 69 }; | 73 }; |
| 70 | 74 |
| 71 } // namespace content | 75 } // namespace content |
| 72 | 76 |
| 73 #endif // CONTENT_PUBLIC_BROWSER_WEB_DRAG_DEST_DELEGATE_H_ | 77 #endif // CONTENT_PUBLIC_BROWSER_WEB_DRAG_DEST_DELEGATE_H_ |
| OLD | NEW |