OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2013 Google Inc. | 3 * Copyright (C) 2013 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 int DragData::modifiers() const | 77 int DragData::modifiers() const |
78 { | 78 { |
79 return m_platformDragData->modifiers(); | 79 return m_platformDragData->modifiers(); |
80 } | 80 } |
81 | 81 |
82 void DragData::asFilePaths(Vector<String>& result) const | 82 void DragData::asFilePaths(Vector<String>& result) const |
83 { | 83 { |
84 const Vector<String>& filenames = m_platformDragData->filenames(); | 84 const Vector<String>& filenames = m_platformDragData->filenames(); |
85 for (size_t i = 0; i < filenames.size(); ++i) { | 85 for (size_t i = 0; i < filenames.size(); ++i) { |
86 if (!filenames[i].isEmpty()) | 86 // When the content cannot be read, the filenames will all be empty. |
| 87 if (!m_platformDragData->canReadContent() || !filenames[i].isEmpty()) |
87 result.append(filenames[i]); | 88 result.append(filenames[i]); |
88 } | 89 } |
89 } | 90 } |
90 | 91 |
91 bool DragData::containsPlainText() const | 92 bool DragData::containsPlainText() const |
92 { | 93 { |
93 return m_platformDragData->types().contains(mimeTypeTextPlain); | 94 return m_platformDragData->types().contains(mimeTypeTextPlain); |
94 } | 95 } |
95 | 96 |
96 String DragData::asPlainText() const | 97 String DragData::asPlainText() const |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 145 |
145 return nullptr; | 146 return nullptr; |
146 } | 147 } |
147 | 148 |
148 String DragData::droppedFileSystemId() const | 149 String DragData::droppedFileSystemId() const |
149 { | 150 { |
150 return m_platformDragData->filesystemId(); | 151 return m_platformDragData->filesystemId(); |
151 } | 152 } |
152 | 153 |
153 } // namespace blink | 154 } // namespace blink |
OLD | NEW |