OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007 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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 if (!m_dataObject) | 324 if (!m_dataObject) |
325 return; | 325 return; |
326 m_dataObject->url = url; | 326 m_dataObject->url = url; |
327 m_dataObject->url_title = title; | 327 m_dataObject->url_title = title; |
328 | 328 |
329 // The URL can also be used as plain text. | 329 // The URL can also be used as plain text. |
330 m_dataObject->plain_text = url.string(); | 330 m_dataObject->plain_text = url.string(); |
331 | 331 |
332 // The URL can also be used as an HTML fragment. | 332 // The URL can also be used as an HTML fragment. |
333 m_dataObject->text_html = urlToMarkup(url, title); | 333 m_dataObject->text_html = urlToMarkup(url, title); |
| 334 m_dataObject->html_base_url = url; |
334 } | 335 } |
335 | 336 |
336 void ClipboardChromium::writeRange(Range* selectedRange, Frame* frame) | 337 void ClipboardChromium::writeRange(Range* selectedRange, Frame* frame) |
337 { | 338 { |
338 ASSERT(selectedRange); | 339 ASSERT(selectedRange); |
339 if (!m_dataObject) | 340 if (!m_dataObject) |
340 return; | 341 return; |
341 | 342 |
342 m_dataObject->text_html = createMarkup(selectedRange, 0, | 343 m_dataObject->text_html = createMarkup(selectedRange, 0, |
343 AnnotateForInterchange); | 344 AnnotateForInterchange); |
| 345 m_dataObject->html_base_url = frame->document()->url(); |
344 | 346 |
345 String str = frame->selectedText(); | 347 String str = frame->selectedText(); |
346 #if PLATFORM(WIN_OS) | 348 #if PLATFORM(WIN_OS) |
347 replaceNewlinesWithWindowsStyleNewlines(str); | 349 replaceNewlinesWithWindowsStyleNewlines(str); |
348 #endif | 350 #endif |
349 replaceNBSPWithSpace(str); | 351 replaceNBSPWithSpace(str); |
350 m_dataObject->plain_text = str; | 352 m_dataObject->plain_text = str; |
351 } | 353 } |
352 | 354 |
353 bool ClipboardChromium::hasData() | 355 bool ClipboardChromium::hasData() |
354 { | 356 { |
355 if (!m_dataObject) | 357 if (!m_dataObject) |
356 return false; | 358 return false; |
357 | 359 |
358 return m_dataObject->hasData(); | 360 return m_dataObject->hasData(); |
359 } | 361 } |
360 | 362 |
361 } // namespace WebCore | 363 } // namespace WebCore |
OLD | NEW |