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

Side by Side Diff: Source/core/clipboard/Clipboard.cpp

Issue 193623002: Use new is*Element() helper functions more in core/ code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/loader/FormSubmission.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) 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 void Clipboard::setDragImage(Element* image, int x, int y, ExceptionState& excep tionState) 214 void Clipboard::setDragImage(Element* image, int x, int y, ExceptionState& excep tionState)
215 { 215 {
216 if (!isForDragAndDrop()) 216 if (!isForDragAndDrop())
217 return; 217 return;
218 218
219 if (!image) { 219 if (!image) {
220 exceptionState.throwTypeError("setDragImage: Invalid first argument"); 220 exceptionState.throwTypeError("setDragImage: Invalid first argument");
221 return; 221 return;
222 } 222 }
223 IntPoint location(x, y); 223 IntPoint location(x, y);
224 if (image->hasTagName(HTMLNames::imgTag) && !image->inDocument()) 224 if (isHTMLImageElement(*image) && !image->inDocument())
225 setDragImageResource(toHTMLImageElement(image)->cachedImage(), location) ; 225 setDragImageResource(toHTMLImageElement(*image).cachedImage(), location) ;
226 else 226 else
227 setDragImageElement(image, location); 227 setDragImageElement(image, location);
228 } 228 }
229 229
230 void Clipboard::setDragImageResource(ImageResource* img, const IntPoint& loc) 230 void Clipboard::setDragImageResource(ImageResource* img, const IntPoint& loc)
231 { 231 {
232 setDragImage(img, 0, loc); 232 setDragImage(img, 0, loc);
233 } 233 }
234 234
235 void Clipboard::setDragImageElement(Node* node, const IntPoint& loc) 235 void Clipboard::setDragImageElement(Node* node, const IntPoint& loc)
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 return String("copy"); 521 return String("copy");
522 } 522 }
523 } 523 }
524 524
525 void Clipboard::trace(Visitor* visitor) 525 void Clipboard::trace(Visitor* visitor)
526 { 526 {
527 visitor->trace(m_dataObject); 527 visitor->trace(m_dataObject);
528 } 528 }
529 529
530 } // namespace WebCore 530 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/loader/FormSubmission.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698