| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 } | 95 } |
| 96 | 96 |
| 97 ChromiumDataObjectItem::ChromiumDataObjectItem(const String& kind, const String&
type, uint64_t sequenceNumber) | 97 ChromiumDataObjectItem::ChromiumDataObjectItem(const String& kind, const String&
type, uint64_t sequenceNumber) |
| 98 : m_source(PasteboardSource) | 98 : m_source(PasteboardSource) |
| 99 , m_kind(kind) | 99 , m_kind(kind) |
| 100 , m_type(type) | 100 , m_type(type) |
| 101 , m_sequenceNumber(sequenceNumber) | 101 , m_sequenceNumber(sequenceNumber) |
| 102 { | 102 { |
| 103 } | 103 } |
| 104 | 104 |
| 105 void ChromiumDataObjectItem::getAsString(PassRefPtr<StringCallback> callback, Ex
ecutionContext* context) const | 105 void ChromiumDataObjectItem::getAsString(PassOwnPtr<StringCallback> callback, Ex
ecutionContext* context) const |
| 106 { | 106 { |
| 107 if (!callback || kind() != DataTransferItem::kindString) | 107 if (!callback || kind() != DataTransferItem::kindString) |
| 108 return; | 108 return; |
| 109 | 109 |
| 110 callback->scheduleCallback(context, internalGetAsString()); | 110 StringCallback::scheduleCallback(callback, context, internalGetAsString()); |
| 111 } | 111 } |
| 112 | 112 |
| 113 PassRefPtr<Blob> ChromiumDataObjectItem::getAsFile() const | 113 PassRefPtr<Blob> ChromiumDataObjectItem::getAsFile() const |
| 114 { | 114 { |
| 115 if (kind() != DataTransferItem::kindFile) | 115 if (kind() != DataTransferItem::kindFile) |
| 116 return 0; | 116 return 0; |
| 117 | 117 |
| 118 if (m_source == InternalSource) { | 118 if (m_source == InternalSource) { |
| 119 if (m_file) | 119 if (m_file) |
| 120 return m_file; | 120 return m_file; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 174 |
| 175 bool ChromiumDataObjectItem::isFilename() const | 175 bool ChromiumDataObjectItem::isFilename() const |
| 176 { | 176 { |
| 177 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=81261: When we properly su
pport File dragout, | 177 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=81261: When we properly su
pport File dragout, |
| 178 // we'll need to make sure this works as expected for DragDataChromium. | 178 // we'll need to make sure this works as expected for DragDataChromium. |
| 179 return m_kind == DataTransferItem::kindFile && m_file; | 179 return m_kind == DataTransferItem::kindFile && m_file; |
| 180 } | 180 } |
| 181 | 181 |
| 182 } // namespace WebCore | 182 } // namespace WebCore |
| 183 | 183 |
| OLD | NEW |