Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2008, 2009, Google Inc. All rights reserved. | 2 * Copyright (c) 2008, 2009, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 30 | 30 |
| 31 #ifndef DataObject_h | 31 #ifndef DataObject_h |
| 32 #define DataObject_h | 32 #define DataObject_h |
| 33 | 33 |
| 34 #include "core/CoreExport.h" | 34 #include "core/CoreExport.h" |
| 35 #include "core/clipboard/DataObjectItem.h" | 35 #include "core/clipboard/DataObjectItem.h" |
| 36 #include "platform/PasteMode.h" | 36 #include "platform/PasteMode.h" |
| 37 #include "platform/Supplementable.h" | 37 #include "platform/Supplementable.h" |
| 38 #include "platform/heap/Handle.h" | 38 #include "platform/heap/Handle.h" |
| 39 #include "wtf/ListHashSet.h" | 39 #include "wtf/ListHashSet.h" |
| 40 #include "wtf/RefCounted.h" | 40 #include "wtf/PassRefPtr.h" |
| 41 #include "wtf/RefPtr.h" | |
| 42 #include "wtf/Vector.h" | 41 #include "wtf/Vector.h" |
| 43 #include "wtf/text/StringHash.h" | 42 #include "wtf/text/StringHash.h" |
| 44 #include "wtf/text/WTFString.h" | 43 #include "wtf/text/WTFString.h" |
| 45 | 44 |
| 46 namespace blink { | 45 namespace blink { |
| 47 | 46 |
| 48 class KURL; | 47 class KURL; |
| 49 class SharedBuffer; | 48 class SharedBuffer; |
| 50 class WebDragData; | 49 class WebDragData; |
| 51 | 50 |
| 52 // A data object for holding data that would be in a clipboard or moved | 51 // A data object for holding data that would be in a clipboard or moved |
| 53 // during a drag-n-drop operation. This is the data that WebCore is aware | 52 // during a drag-n-drop operation. This is the data that WebCore is aware |
| 54 // of and is not specific to a platform. | 53 // of and is not specific to a platform. |
| 55 class CORE_EXPORT DataObject : public RefCountedWillBeGarbageCollectedFinalized< DataObject>, public WillBeHeapSupplementable<DataObject> { | 54 class DataObject : public GarbageCollectedFinalized<DataObject>, public HeapSupp lementable<DataObject> { |
|
sof
2015/04/22 21:48:11
Will add back CORE_EXPORT.
sof
2015/04/23 08:01:53
Done.
| |
| 56 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DataObject); | 55 USING_GARBAGE_COLLECTED_MIXIN(DataObject); |
| 57 public: | 56 public: |
| 58 static PassRefPtrWillBeRawPtr<DataObject> createFromPasteboard(PasteMode); | 57 static DataObject* createFromPasteboard(PasteMode); |
| 59 static PassRefPtrWillBeRawPtr<DataObject> create(); | 58 static DataObject* create(); |
| 60 static PassRefPtrWillBeRawPtr<DataObject> create(WebDragData); | 59 static DataObject* create(WebDragData); |
| 60 | |
| 61 DataObject* copy() const; | |
|
haraken
2015/04/23 04:47:08
What is this for?
sof
2015/04/23 08:01:53
Oops, an unmoored declaration that was removed in
| |
| 61 | 62 |
| 62 virtual ~DataObject(); | 63 virtual ~DataObject(); |
| 63 | 64 |
| 64 // DataTransferItemList support. | 65 // DataTransferItemList support. |
| 65 size_t length() const; | 66 size_t length() const; |
| 66 PassRefPtrWillBeRawPtr<DataObjectItem> item(unsigned long index); | 67 DataObjectItem* item(unsigned long index); |
| 67 // FIXME: Implement V8DataTransferItemList::indexedPropertyDeleter to get th is called. | 68 // FIXME: Implement V8DataTransferItemList::indexedPropertyDeleter to get th is called. |
| 68 void deleteItem(unsigned long index); | 69 void deleteItem(unsigned long index); |
| 69 void clearAll(); | 70 void clearAll(); |
| 70 // Returns null if an item already exists with the provided type. | 71 // Returns null if an item already exists with the provided type. |
| 71 PassRefPtrWillBeRawPtr<DataObjectItem> add(const String& data, const String& type); | 72 DataObjectItem* add(const String& data, const String& type); |
| 72 PassRefPtrWillBeRawPtr<DataObjectItem> add(File*); | 73 DataObjectItem* add(File*); |
| 73 | 74 |
| 74 // WebCore helpers. | 75 // WebCore helpers. |
| 75 void clearData(const String& type); | 76 void clearData(const String& type); |
| 76 | 77 |
| 77 ListHashSet<String> types() const; | 78 ListHashSet<String> types() const; |
| 78 String getData(const String& type) const; | 79 String getData(const String& type) const; |
| 79 void setData(const String& type, const String& data); | 80 void setData(const String& type, const String& data); |
| 80 | 81 |
| 81 void urlAndTitle(String& url, String* title = 0) const; | 82 void urlAndTitle(String& url, String* title = 0) const; |
| 82 void setURLAndTitle(const String& url, const String& title); | 83 void setURLAndTitle(const String& url, const String& title); |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 98 int modifiers() const { return m_modifiers; } | 99 int modifiers() const { return m_modifiers; } |
| 99 void setModifiers(int modifiers) { m_modifiers = modifiers; } | 100 void setModifiers(int modifiers) { m_modifiers = modifiers; } |
| 100 | 101 |
| 101 DECLARE_TRACE(); | 102 DECLARE_TRACE(); |
| 102 | 103 |
| 103 WebDragData toWebDragData(); | 104 WebDragData toWebDragData(); |
| 104 | 105 |
| 105 private: | 106 private: |
| 106 DataObject(); | 107 DataObject(); |
| 107 | 108 |
| 108 PassRefPtrWillBeRawPtr<DataObjectItem> findStringItem(const String& type) co nst; | 109 DataObjectItem* findStringItem(const String& type) const; |
| 109 bool internalAddStringItem(PassRefPtrWillBeRawPtr<DataObjectItem>); | 110 bool internalAddStringItem(DataObjectItem*); |
| 110 void internalAddFileItem(PassRefPtrWillBeRawPtr<DataObjectItem>); | 111 void internalAddFileItem(DataObjectItem*); |
| 111 | 112 |
| 112 WillBeHeapVector<RefPtrWillBeMember<DataObjectItem>> m_itemList; | 113 HeapVector<Member<DataObjectItem>> m_itemList; |
| 113 | 114 |
| 114 // State of Shift/Ctrl/Alt/Meta keys and Left/Right/Middle mouse buttons | 115 // State of Shift/Ctrl/Alt/Meta keys and Left/Right/Middle mouse buttons |
| 115 int m_modifiers; | 116 int m_modifiers; |
| 116 String m_filesystemId; | 117 String m_filesystemId; |
| 117 }; | 118 }; |
| 118 | 119 |
| 119 } // namespace blink | 120 } // namespace blink |
| 120 | 121 |
| 121 #endif | 122 #endif |
| OLD | NEW |