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

Side by Side Diff: Source/core/platform/Pasteboard.cpp

Issue 23453033: Have DOMPatchSupport and DocumentFragment deal with Document references (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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/platform/DragData.cpp ('k') | no next file » | 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) 2008, 2009, Google Inc. All rights reserved. 2 * Copyright (c) 2008, 2009, Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 { 166 {
167 chosePlainText = false; 167 chosePlainText = false;
168 WebKit::WebClipboard::Buffer buffer = m_selectionMode ? WebKit::WebClipboard ::BufferSelection : WebKit::WebClipboard::BufferStandard; 168 WebKit::WebClipboard::Buffer buffer = m_selectionMode ? WebKit::WebClipboard ::BufferSelection : WebKit::WebClipboard::BufferStandard;
169 169
170 if (WebKit::Platform::current()->clipboard()->isFormatAvailable(WebKit::WebC lipboard::FormatHTML, buffer)) { 170 if (WebKit::Platform::current()->clipboard()->isFormatAvailable(WebKit::WebC lipboard::FormatHTML, buffer)) {
171 unsigned fragmentStart = 0; 171 unsigned fragmentStart = 0;
172 unsigned fragmentEnd = 0; 172 unsigned fragmentEnd = 0;
173 WebKit::WebURL url; 173 WebKit::WebURL url;
174 WebKit::WebString markup = WebKit::Platform::current()->clipboard()->rea dHTML(buffer, &url, &fragmentStart, &fragmentEnd); 174 WebKit::WebString markup = WebKit::Platform::current()->clipboard()->rea dHTML(buffer, &url, &fragmentStart, &fragmentEnd);
175 if (!markup.isEmpty()) { 175 if (!markup.isEmpty()) {
176 if (RefPtr<DocumentFragment> fragment = createFragmentFromMarkupWith Context(frame->document(), markup, fragmentStart, fragmentEnd, KURL(url), Disall owScriptingAndPluginContent)) 176 ASSERT(frame->document());
177 if (RefPtr<DocumentFragment> fragment = createFragmentFromMarkupWith Context(*frame->document(), markup, fragmentStart, fragmentEnd, KURL(url), Disal lowScriptingAndPluginContent))
177 return fragment.release(); 178 return fragment.release();
178 } 179 }
179 } 180 }
180 181
181 if (allowPlainText) { 182 if (allowPlainText) {
182 String markup = WebKit::Platform::current()->clipboard()->readPlainText( buffer); 183 String markup = WebKit::Platform::current()->clipboard()->readPlainText( buffer);
183 if (!markup.isEmpty()) { 184 if (!markup.isEmpty()) {
184 chosePlainText = true; 185 chosePlainText = true;
185 if (RefPtr<DocumentFragment> fragment = createFragmentFromText(conte xt.get(), markup)) 186 if (RefPtr<DocumentFragment> fragment = createFragmentFromText(conte xt.get(), markup))
186 return fragment.release(); 187 return fragment.release();
187 } 188 }
188 } 189 }
189 190
190 return 0; 191 return 0;
191 } 192 }
192 193
193 } // namespace WebCore 194 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/platform/DragData.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698