| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |