OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 if (!canReadData()) | 168 if (!canReadData()) |
169 return String(); | 169 return String(); |
170 | 170 |
171 bool convertToURL = false; | 171 bool convertToURL = false; |
172 String data = m_dataObject->getData(normalizeType(type, &convertToURL)); | 172 String data = m_dataObject->getData(normalizeType(type, &convertToURL)); |
173 if (!convertToURL) | 173 if (!convertToURL) |
174 return data; | 174 return data; |
175 return convertURIListToURL(data); | 175 return convertURIListToURL(data); |
176 } | 176 } |
177 | 177 |
178 bool Clipboard::setData(const String& type, const String& data) | 178 void Clipboard::setData(const String& type, const String& data) |
179 { | 179 { |
180 if (!canWriteData()) | 180 if (!canWriteData()) |
181 return false; | 181 return; |
182 | 182 |
183 return m_dataObject->setData(normalizeType(type), data); | 183 m_dataObject->setData(normalizeType(type), data); |
184 } | 184 } |
185 | 185 |
186 // extensions beyond IE's API | 186 // extensions beyond IE's API |
187 Vector<String> Clipboard::types() const | 187 Vector<String> Clipboard::types() const |
188 { | 188 { |
189 Vector<String> types; | 189 Vector<String> types; |
190 if (!canReadTypes()) | 190 if (!canReadTypes()) |
191 return types; | 191 return types; |
192 | 192 |
193 ListHashSet<String> typesSet = m_dataObject->types(); | 193 ListHashSet<String> typesSet = m_dataObject->types(); |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 } | 534 } |
535 } | 535 } |
536 | 536 |
537 void Clipboard::trace(Visitor* visitor) | 537 void Clipboard::trace(Visitor* visitor) |
538 { | 538 { |
539 visitor->trace(m_dataObject); | 539 visitor->trace(m_dataObject); |
540 visitor->trace(m_dragImageElement); | 540 visitor->trace(m_dragImageElement); |
541 } | 541 } |
542 | 542 |
543 } // namespace WebCore | 543 } // namespace WebCore |
OLD | NEW |