| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 if (m_source == InternalSource) | 132 if (m_source == InternalSource) |
| 133 return m_data; | 133 return m_data; |
| 134 | 134 |
| 135 ASSERT(m_source == PasteboardSource); | 135 ASSERT(m_source == PasteboardSource); |
| 136 | 136 |
| 137 WebClipboard::Buffer buffer = Pasteboard::generalPasteboard()->buffer(); | 137 WebClipboard::Buffer buffer = Pasteboard::generalPasteboard()->buffer(); |
| 138 String data; | 138 String data; |
| 139 // This is ugly but there's no real alternative. | 139 // This is ugly but there's no real alternative. |
| 140 if (m_type == mimeTypeTextPlain) { | 140 if (m_type == mimeTypeTextPlain) { |
| 141 data = Platform::current()->clipboard()->readPlainText(buffer); | 141 data = Platform::current()->clipboard()->readPlainText(buffer); |
| 142 } else if (m_type == mimeTypeTextRTF) { |
| 143 data = Platform::current()->clipboard()->readRTF(buffer); |
| 142 } else if (m_type == mimeTypeTextHTML) { | 144 } else if (m_type == mimeTypeTextHTML) { |
| 143 WebURL ignoredSourceURL; | 145 WebURL ignoredSourceURL; |
| 144 unsigned ignored; | 146 unsigned ignored; |
| 145 data = Platform::current()->clipboard()->readHTML(buffer, &ignoredSource
URL, &ignored, &ignored); | 147 data = Platform::current()->clipboard()->readHTML(buffer, &ignoredSource
URL, &ignored, &ignored); |
| 146 } else { | 148 } else { |
| 147 data = Platform::current()->clipboard()->readCustomData(buffer, m_type); | 149 data = Platform::current()->clipboard()->readCustomData(buffer, m_type); |
| 148 } | 150 } |
| 149 | 151 |
| 150 return Platform::current()->clipboard()->sequenceNumber(buffer) == m_sequenc
eNumber ? data : String(); | 152 return Platform::current()->clipboard()->sequenceNumber(buffer) == m_sequenc
eNumber ? data : String(); |
| 151 } | 153 } |
| 152 | 154 |
| 153 bool DataObjectItem::isFilename() const | 155 bool DataObjectItem::isFilename() const |
| 154 { | 156 { |
| 155 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=81261: When we properly su
pport File dragout, | 157 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=81261: When we properly su
pport File dragout, |
| 156 // we'll need to make sure this works as expected for DragDataChromium. | 158 // we'll need to make sure this works as expected for DragDataChromium. |
| 157 return m_kind == FileKind && m_file; | 159 return m_kind == FileKind && m_file; |
| 158 } | 160 } |
| 159 | 161 |
| 160 DEFINE_TRACE(DataObjectItem) | 162 DEFINE_TRACE(DataObjectItem) |
| 161 { | 163 { |
| 162 visitor->trace(m_file); | 164 visitor->trace(m_file); |
| 163 } | 165 } |
| 164 | 166 |
| 165 } // namespace blink | 167 } // namespace blink |
| OLD | NEW |