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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 #include "wtf/text/WTFString.h" | 43 #include "wtf/text/WTFString.h" |
| 44 | 44 |
| 45 namespace WebCore { | 45 namespace WebCore { |
| 46 | 46 |
| 47 class KURL; | 47 class KURL; |
| 48 class SharedBuffer; | 48 class SharedBuffer; |
| 49 | 49 |
| 50 // A data object for holding data that would be in a clipboard or moved | 50 // A data object for holding data that would be in a clipboard or moved |
| 51 // during a drag-n-drop operation. This is the data that WebCore is aware | 51 // during a drag-n-drop operation. This is the data that WebCore is aware |
| 52 // of and is not specific to a platform. | 52 // of and is not specific to a platform. |
| 53 class DataObject : public RefCountedWillBeGarbageCollectedFinalized<DataObject>, public Supplementable<DataObject> { | 53 class DataObject : public RefCountedWillBeGarbageCollectedFinalized<DataObject>, public WillBeHeapSupplementable<DataObject> { |
| 54 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DataObject); | |
| 54 public: | 55 public: |
| 55 static PassRefPtrWillBeRawPtr<DataObject> createFromPasteboard(PasteMode); | 56 static PassRefPtrWillBeRawPtr<DataObject> createFromPasteboard(PasteMode); |
| 56 static PassRefPtrWillBeRawPtr<DataObject> create(); | 57 static PassRefPtrWillBeRawPtr<DataObject> create(); |
| 57 | 58 |
| 58 PassRefPtrWillBeRawPtr<DataObject> copy() const; | 59 PassRefPtrWillBeRawPtr<DataObject> copy() const; |
| 59 | 60 |
| 60 // DataTransferItemList support. | 61 // DataTransferItemList support. |
| 61 size_t length() const; | 62 size_t length() const; |
| 62 PassRefPtrWillBeRawPtr<DataObjectItem> item(unsigned long index); | 63 PassRefPtrWillBeRawPtr<DataObjectItem> item(unsigned long index); |
| 63 // FIXME: Implement V8DataTransferItemList::indexedPropertyDeleter to get th is called. | 64 // FIXME: Implement V8DataTransferItemList::indexedPropertyDeleter to get th is called. |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 89 void addSharedBuffer(const String& name, PassRefPtr<SharedBuffer>); | 90 void addSharedBuffer(const String& name, PassRefPtr<SharedBuffer>); |
| 90 | 91 |
| 91 int modifierKeyState() const { return m_modifierKeyState; } | 92 int modifierKeyState() const { return m_modifierKeyState; } |
| 92 void setModifierKeyState(int modifierKeyState) { m_modifierKeyState = modifi erKeyState; } | 93 void setModifierKeyState(int modifierKeyState) { m_modifierKeyState = modifi erKeyState; } |
| 93 | 94 |
| 94 // The accessor should only ever be called by DragData. | 95 // The accessor should only ever be called by DragData. |
| 95 const String& filenameForNavigation() const { return m_filenameForNavigation ; } | 96 const String& filenameForNavigation() const { return m_filenameForNavigation ; } |
| 96 void setFilenameForNavigation(const String& filename) { m_filenameForNavigat ion = filename; } | 97 void setFilenameForNavigation(const String& filename) { m_filenameForNavigat ion = filename; } |
| 97 | 98 |
| 98 // FIXME: oilpan: This trace() has to trace Supplementable. | 99 // FIXME: oilpan: This trace() has to trace Supplementable. |
| 99 void trace(Visitor*); | 100 void trace(Visitor*); |
|
haraken
2014/03/21 10:35:13
Ditto. Also you can remove the FIXME.
sof
2014/03/21 10:42:20
Done.
| |
| 100 | 101 |
| 101 private: | 102 private: |
| 102 DataObject(); | 103 DataObject(); |
| 103 explicit DataObject(const DataObject&); | 104 explicit DataObject(const DataObject&); |
| 104 | 105 |
| 105 PassRefPtrWillBeRawPtr<DataObjectItem> findStringItem(const String& type) co nst; | 106 PassRefPtrWillBeRawPtr<DataObjectItem> findStringItem(const String& type) co nst; |
| 106 bool internalAddStringItem(PassRefPtrWillBeRawPtr<DataObjectItem>); | 107 bool internalAddStringItem(PassRefPtrWillBeRawPtr<DataObjectItem>); |
| 107 void internalAddFileItem(PassRefPtrWillBeRawPtr<DataObjectItem>); | 108 void internalAddFileItem(PassRefPtrWillBeRawPtr<DataObjectItem>); |
| 108 | 109 |
| 109 WillBeHeapVector<RefPtrWillBeMember<DataObjectItem> > m_itemList; | 110 WillBeHeapVector<RefPtrWillBeMember<DataObjectItem> > m_itemList; |
| 110 | 111 |
| 111 String m_filenameForNavigation; | 112 String m_filenameForNavigation; |
| 112 | 113 |
| 113 // State of Shift/Ctrl/Alt/Meta keys. | 114 // State of Shift/Ctrl/Alt/Meta keys. |
| 114 int m_modifierKeyState; | 115 int m_modifierKeyState; |
| 115 }; | 116 }; |
| 116 | 117 |
| 117 } // namespace WebCore | 118 } // namespace WebCore |
| 118 | 119 |
| 119 #endif | 120 #endif |
| OLD | NEW |