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

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

Issue 1481983002: Drop [LegacyInterfaceTypeChecking] where trivial in core/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more tests Created 5 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) 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 if (m_dataObject->item(i)->kind() == DataObjectItem::FileKind) { 205 if (m_dataObject->item(i)->kind() == DataObjectItem::FileKind) {
206 Blob* blob = m_dataObject->item(i)->getAsFile(); 206 Blob* blob = m_dataObject->item(i)->getAsFile();
207 if (blob && blob->isFile()) 207 if (blob && blob->isFile())
208 files->append(toFile(blob)); 208 files->append(toFile(blob));
209 } 209 }
210 } 210 }
211 211
212 return files; 212 return files;
213 } 213 }
214 214
215 void DataTransfer::setDragImage(Element* image, int x, int y, ExceptionState& ex ceptionState) 215 void DataTransfer::setDragImage(Element* image, int x, int y)
216 { 216 {
217 ASSERT(image);
218
217 if (!isForDragAndDrop()) 219 if (!isForDragAndDrop())
218 return; 220 return;
219 221
220 if (!image) {
221 exceptionState.throwTypeError("setDragImage: Invalid first argument");
222 return;
223 }
224 IntPoint location(x, y); 222 IntPoint location(x, y);
225 if (isHTMLImageElement(*image) && !image->inDocument()) 223 if (isHTMLImageElement(*image) && !image->inDocument())
226 setDragImageResource(toHTMLImageElement(*image).cachedImage(), location) ; 224 setDragImageResource(toHTMLImageElement(*image).cachedImage(), location) ;
227 else 225 else
228 setDragImageElement(image, location); 226 setDragImageElement(image, location);
229 } 227 }
230 228
231 void DataTransfer::clearDragImage() 229 void DataTransfer::clearDragImage()
232 { 230 {
233 if (!canSetDragImage()) 231 if (!canSetDragImage())
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 513
516 DEFINE_TRACE(DataTransfer) 514 DEFINE_TRACE(DataTransfer)
517 { 515 {
518 visitor->trace(m_dataObject); 516 visitor->trace(m_dataObject);
519 #if ENABLE(OILPAN) 517 #if ENABLE(OILPAN)
520 visitor->trace(m_dragImageElement); 518 visitor->trace(m_dragImageElement);
521 #endif 519 #endif
522 } 520 }
523 521
524 } // namespace blink 522 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/clipboard/DataTransfer.h ('k') | third_party/WebKit/Source/core/clipboard/DataTransfer.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698