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

Side by Side Diff: Source/core/page/DragController.cpp

Issue 23886003: Have HTMLElements / SVGElements constructors take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Another Android build fix Created 7 years, 3 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 | « Source/core/html/track/TextTrackCueGeneric.cpp ('k') | Source/core/page/ImageBitmapTest.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) 2007, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2009, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Google Inc. 3 * Copyright (C) 2008 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 Document* document = context->ownerDocument(); 152 Document* document = context->ownerDocument();
153 ASSERT(document); 153 ASSERT(document);
154 if (document && dragData->containsCompatibleContent()) { 154 if (document && dragData->containsCompatibleContent()) {
155 if (PassRefPtr<DocumentFragment> fragment = dragData->asFragment(frame, context, allowPlainText, chosePlainText)) 155 if (PassRefPtr<DocumentFragment> fragment = dragData->asFragment(frame, context, allowPlainText, chosePlainText))
156 return fragment; 156 return fragment;
157 157
158 if (dragData->containsURL(frame, DragData::DoNotConvertFilenames)) { 158 if (dragData->containsURL(frame, DragData::DoNotConvertFilenames)) {
159 String title; 159 String title;
160 String url = dragData->asURL(frame, DragData::DoNotConvertFilenames, &title); 160 String url = dragData->asURL(frame, DragData::DoNotConvertFilenames, &title);
161 if (!url.isEmpty()) { 161 if (!url.isEmpty()) {
162 RefPtr<HTMLAnchorElement> anchor = HTMLAnchorElement::create(doc ument); 162 RefPtr<HTMLAnchorElement> anchor = HTMLAnchorElement::create(*do cument);
163 anchor->setHref(url); 163 anchor->setHref(url);
164 if (title.isEmpty()) { 164 if (title.isEmpty()) {
165 // Try the plain text first because the url might be normali zed or escaped. 165 // Try the plain text first because the url might be normali zed or escaped.
166 if (dragData->containsPlainText()) 166 if (dragData->containsPlainText())
167 title = dragData->asPlainText(frame); 167 title = dragData->asPlainText(frame);
168 if (title.isEmpty()) 168 if (title.isEmpty())
169 title = url; 169 title = url;
170 } 170 }
171 RefPtr<Node> anchorText = document->createTextNode(title); 171 RefPtr<Node> anchorText = document->createTextNode(title);
172 anchor->appendChild(anchorText); 172 anchor->appendChild(anchorText);
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
923 return false; 923 return false;
924 #endif 924 #endif
925 } 925 }
926 926
927 void DragController::cleanupAfterSystemDrag() 927 void DragController::cleanupAfterSystemDrag()
928 { 928 {
929 } 929 }
930 930
931 } // namespace WebCore 931 } // namespace WebCore
932 932
OLDNEW
« no previous file with comments | « Source/core/html/track/TextTrackCueGeneric.cpp ('k') | Source/core/page/ImageBitmapTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698