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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
148 | 148 |
149 if (canWriteData()) | 149 if (canWriteData()) |
150 m_effectAllowed = effect; | 150 m_effectAllowed = effect; |
151 } | 151 } |
152 | 152 |
153 void Clipboard::clearData(const String& type) | 153 void Clipboard::clearData(const String& type) |
154 { | 154 { |
155 if (!canWriteData()) | 155 if (!canWriteData()) |
156 return; | 156 return; |
157 | 157 |
158 m_dataObject->clearData(normalizeType(type)); | 158 if (type.isNull()) |
haraken
2013/10/04 22:41:22
To keep the current behavior, the if(type.isNull()
do-not-use
2013/10/08 14:24:42
Hmm, maybe I am misreading but I don't think so. T
| |
159 } | 159 m_dataObject->clearAll(); |
160 | 160 else |
161 void Clipboard::clearAllData() | 161 m_dataObject->clearData(normalizeType(type)); |
162 { | |
163 if (!canWriteData()) | |
164 return; | |
165 | |
166 m_dataObject->clearAll(); | |
167 } | 162 } |
168 | 163 |
169 String Clipboard::getData(const String& type) const | 164 String Clipboard::getData(const String& type) const |
170 { | 165 { |
171 if (!canReadData()) | 166 if (!canReadData()) |
172 return String(); | 167 return String(); |
173 | 168 |
174 bool convertToURL = false; | 169 bool convertToURL = false; |
175 String data = m_dataObject->getData(normalizeType(type, &convertToURL)); | 170 String data = m_dataObject->getData(normalizeType(type, &convertToURL)); |
176 if (!convertToURL) | 171 if (!convertToURL) |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
504 case DragOperationMove: | 499 case DragOperationMove: |
505 return String("move"); | 500 return String("move"); |
506 case DragOperationLink: | 501 case DragOperationLink: |
507 return String("link"); | 502 return String("link"); |
508 default: | 503 default: |
509 return String("copy"); | 504 return String("copy"); |
510 } | 505 } |
511 } | 506 } |
512 | 507 |
513 } // namespace WebCore | 508 } // namespace WebCore |
OLD | NEW |