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

Side by Side Diff: Source/WebCore/platform/chromium/ChromiumDataObject.cpp

Issue 10821032: Merge 123495 - Files from drag and file <input> should use getMIMETypeForExtension to determine con… (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1180/
Patch Set: Created 8 years, 5 months 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
« no previous file with comments | « Source/WebCore/html/FileInputType.cpp ('k') | Source/WebCore/platform/gtk/ClipboardGtk.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2008, 2009, 2012 Google Inc. All rights reserved. 2 * Copyright (c) 2008, 2009, 2012 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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 { 202 {
203 Vector<String> results; 203 Vector<String> results;
204 for (size_t i = 0; i < m_itemList.size(); ++i) 204 for (size_t i = 0; i < m_itemList.size(); ++i)
205 if (m_itemList[i]->isFilename()) 205 if (m_itemList[i]->isFilename())
206 results.append(static_cast<File*>(m_itemList[i]->getAsFile().get())- >path()); 206 results.append(static_cast<File*>(m_itemList[i]->getAsFile().get())- >path());
207 return results; 207 return results;
208 } 208 }
209 209
210 void ChromiumDataObject::addFilename(const String& filename, const String& displ ayName) 210 void ChromiumDataObject::addFilename(const String& filename, const String& displ ayName)
211 { 211 {
212 internalAddFileItem(ChromiumDataObjectItem::createFromFile(File::createWithN ame(filename, displayName))); 212 internalAddFileItem(ChromiumDataObjectItem::createFromFile(File::createWithN ame(filename, displayName, File::AllContentTypes)));
213 } 213 }
214 214
215 void ChromiumDataObject::addSharedBuffer(const String& name, PassRefPtr<SharedBu ffer> buffer) 215 void ChromiumDataObject::addSharedBuffer(const String& name, PassRefPtr<SharedBu ffer> buffer)
216 { 216 {
217 internalAddFileItem(ChromiumDataObjectItem::createFromSharedBuffer(name, buf fer)); 217 internalAddFileItem(ChromiumDataObjectItem::createFromSharedBuffer(name, buf fer));
218 } 218 }
219 219
220 ChromiumDataObject::ChromiumDataObject() 220 ChromiumDataObject::ChromiumDataObject()
221 : m_modifierKeyState(0) 221 : m_modifierKeyState(0)
222 { 222 {
(...skipping 26 matching lines...) Expand all
249 return true; 249 return true;
250 } 250 }
251 251
252 void ChromiumDataObject::internalAddFileItem(PassRefPtr<ChromiumDataObjectItem> item) 252 void ChromiumDataObject::internalAddFileItem(PassRefPtr<ChromiumDataObjectItem> item)
253 { 253 {
254 ASSERT(item->kind() == DataTransferItem::kindFile); 254 ASSERT(item->kind() == DataTransferItem::kindFile);
255 m_itemList.append(item); 255 m_itemList.append(item);
256 } 256 }
257 257
258 } // namespace WebCore 258 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebCore/html/FileInputType.cpp ('k') | Source/WebCore/platform/gtk/ClipboardGtk.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698