| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 21 matching lines...) Expand all Loading... |
| 32 #include "core/clipboard/DataTransferItem.h" | 32 #include "core/clipboard/DataTransferItem.h" |
| 33 | 33 |
| 34 #include "bindings/core/v8/V8Binding.h" | 34 #include "bindings/core/v8/V8Binding.h" |
| 35 #include "core/clipboard/DataObjectItem.h" | 35 #include "core/clipboard/DataObjectItem.h" |
| 36 #include "core/clipboard/DataTransfer.h" | 36 #include "core/clipboard/DataTransfer.h" |
| 37 #include "core/dom/StringCallback.h" | 37 #include "core/dom/StringCallback.h" |
| 38 #include "wtf/StdLibExtras.h" | 38 #include "wtf/StdLibExtras.h" |
| 39 | 39 |
| 40 namespace WebCore { | 40 namespace WebCore { |
| 41 | 41 |
| 42 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(DataTransferItem); |
| 43 |
| 42 PassRefPtrWillBeRawPtr<DataTransferItem> DataTransferItem::create(PassRefPtrWill
BeRawPtr<DataTransfer> dataTransfer, PassRefPtrWillBeRawPtr<DataObjectItem> item
) | 44 PassRefPtrWillBeRawPtr<DataTransferItem> DataTransferItem::create(PassRefPtrWill
BeRawPtr<DataTransfer> dataTransfer, PassRefPtrWillBeRawPtr<DataObjectItem> item
) |
| 43 { | 45 { |
| 44 return adoptRefWillBeNoop(new DataTransferItem(dataTransfer, item)); | 46 return adoptRefWillBeNoop(new DataTransferItem(dataTransfer, item)); |
| 45 } | 47 } |
| 46 | 48 |
| 47 DataTransferItem::~DataTransferItem() | |
| 48 { | |
| 49 } | |
| 50 | |
| 51 String DataTransferItem::kind() const | 49 String DataTransferItem::kind() const |
| 52 { | 50 { |
| 53 DEFINE_STATIC_LOCAL(const String, kindString, ("string")); | 51 DEFINE_STATIC_LOCAL(const String, kindString, ("string")); |
| 54 DEFINE_STATIC_LOCAL(const String, kindFile, ("file")); | 52 DEFINE_STATIC_LOCAL(const String, kindFile, ("file")); |
| 55 if (!m_dataTransfer->canReadTypes()) | 53 if (!m_dataTransfer->canReadTypes()) |
| 56 return String(); | 54 return String(); |
| 57 switch (m_item->kind()) { | 55 switch (m_item->kind()) { |
| 58 case DataObjectItem::StringKind: | 56 case DataObjectItem::StringKind: |
| 59 return kindString; | 57 return kindString; |
| 60 case DataObjectItem::FileKind: | 58 case DataObjectItem::FileKind: |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 } | 95 } |
| 98 | 96 |
| 99 void DataTransferItem::trace(Visitor* visitor) | 97 void DataTransferItem::trace(Visitor* visitor) |
| 100 { | 98 { |
| 101 visitor->trace(m_dataTransfer); | 99 visitor->trace(m_dataTransfer); |
| 102 visitor->trace(m_item); | 100 visitor->trace(m_item); |
| 103 } | 101 } |
| 104 | 102 |
| 105 } // namespace WebCore | 103 } // namespace WebCore |
| 106 | 104 |
| OLD | NEW |