OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2013 Google Inc. | 3 * Copyright (C) 2013 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 !platform_drag_data_->Types().Contains(kMimeTypeTextURIList); | 106 !platform_drag_data_->Types().Contains(kMimeTypeTextURIList); |
107 } | 107 } |
108 | 108 |
109 bool DragData::ContainsCompatibleContent() const { | 109 bool DragData::ContainsCompatibleContent() const { |
110 return ContainsPlainText() || ContainsURL() || ContainsHTML() || | 110 return ContainsPlainText() || ContainsURL() || ContainsHTML() || |
111 ContainsFiles(); | 111 ContainsFiles(); |
112 } | 112 } |
113 | 113 |
114 DocumentFragment* DragData::AsFragment(LocalFrame* frame) const { | 114 DocumentFragment* DragData::AsFragment(LocalFrame* frame) const { |
115 /* | 115 /* |
116 * Order is richest format first. On OSX this is: | 116 * Order is richest format first. On OSX this is: |
117 * * Web Archive | 117 * * Web Archive |
118 * * Filenames | 118 * * Filenames |
119 * * HTML | 119 * * HTML |
120 * * RTF | 120 * * RTF |
121 * * TIFF | 121 * * TIFF |
122 * * PICT | 122 * * PICT |
123 */ | 123 */ |
124 | 124 |
125 if (ContainsFiles()) { | 125 if (ContainsFiles()) { |
126 // FIXME: Implement this. Should be pretty simple to make some HTML | 126 // FIXME: Implement this. Should be pretty simple to make some HTML |
127 // and call createFragmentFromMarkup. | 127 // and call createFragmentFromMarkup. |
128 } | 128 } |
129 | 129 |
130 if (ContainsHTML()) { | 130 if (ContainsHTML()) { |
131 String html; | 131 String html; |
132 KURL base_url; | 132 KURL base_url; |
133 platform_drag_data_->HtmlAndBaseURL(html, base_url); | 133 platform_drag_data_->HtmlAndBaseURL(html, base_url); |
134 DCHECK(frame->GetDocument()); | 134 DCHECK(frame->GetDocument()); |
135 if (DocumentFragment* fragment = | 135 if (DocumentFragment* fragment = |
136 CreateFragmentFromMarkup(*frame->GetDocument(), html, base_url, | 136 CreateFragmentFromMarkup(*frame->GetDocument(), html, base_url, |
137 kDisallowScriptingAndPluginContent)) | 137 kDisallowScriptingAndPluginContent)) |
138 return fragment; | 138 return fragment; |
139 } | 139 } |
140 | 140 |
141 return nullptr; | 141 return nullptr; |
142 } | 142 } |
143 | 143 |
144 String DragData::DroppedFileSystemId() const { | 144 String DragData::DroppedFileSystemId() const { |
145 return platform_drag_data_->FilesystemId(); | 145 return platform_drag_data_->FilesystemId(); |
146 } | 146 } |
147 | 147 |
148 } // namespace blink | 148 } // namespace blink |
OLD | NEW |