Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(866)

Side by Side Diff: third_party/WebKit/Source/core/clipboard/DataObjectItem.cpp

Issue 2582463002: Fix webkitGetEntry for non-native files. (Closed)
Patch Set: . Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 item->m_data = data; 44 item->m_data = data;
45 return item; 45 return item;
46 } 46 }
47 47
48 DataObjectItem* DataObjectItem::createFromFile(File* file) { 48 DataObjectItem* DataObjectItem::createFromFile(File* file) {
49 DataObjectItem* item = new DataObjectItem(FileKind, file->type()); 49 DataObjectItem* item = new DataObjectItem(FileKind, file->type());
50 item->m_file = file; 50 item->m_file = file;
51 return item; 51 return item;
52 } 52 }
53 53
54 DataObjectItem* DataObjectItem::createFromFileWithFileSystemId(
55 File* file,
56 const String& fileSystemId) {
57 DataObjectItem* item = new DataObjectItem(FileKind, file->type());
58 item->m_file = file;
59 item->m_fileSystemId = fileSystemId;
60 return item;
61 }
62
54 DataObjectItem* DataObjectItem::createFromURL(const String& url, 63 DataObjectItem* DataObjectItem::createFromURL(const String& url,
55 const String& title) { 64 const String& title) {
56 DataObjectItem* item = new DataObjectItem(StringKind, mimeTypeTextURIList); 65 DataObjectItem* item = new DataObjectItem(StringKind, mimeTypeTextURIList);
57 item->m_data = url; 66 item->m_data = url;
58 item->m_title = title; 67 item->m_title = title;
59 return item; 68 return item;
60 } 69 }
61 70
62 DataObjectItem* DataObjectItem::createFromHTML(const String& html, 71 DataObjectItem* DataObjectItem::createFromHTML(const String& html,
63 const KURL& baseURL) { 72 const KURL& baseURL) {
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 : String(); 163 : String();
155 } 164 }
156 165
157 bool DataObjectItem::isFilename() const { 166 bool DataObjectItem::isFilename() const {
158 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=81261: When we properly 167 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=81261: When we properly
159 // support File dragout, we'll need to make sure this works as expected for 168 // support File dragout, we'll need to make sure this works as expected for
160 // DragDataChromium. 169 // DragDataChromium.
161 return m_kind == FileKind && m_file; 170 return m_kind == FileKind && m_file;
162 } 171 }
163 172
173 bool DataObjectItem::hasFileSystemId() const {
174 return m_kind == FileKind && !m_fileSystemId.isEmpty();
175 }
176
177 String DataObjectItem::fileSystemId() const {
178 return m_fileSystemId;
179 }
180
164 DEFINE_TRACE(DataObjectItem) { 181 DEFINE_TRACE(DataObjectItem) {
165 visitor->trace(m_file); 182 visitor->trace(m_file);
166 } 183 }
167 184
168 } // namespace blink 185 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/clipboard/DataObjectItem.h ('k') | third_party/WebKit/Source/core/clipboard/DataObjectTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698