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 * Copyright (C) 2008, 2009 Google Inc. | 3 * Copyright (C) 2008, 2009 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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 } | 327 } |
328 | 328 |
329 void ClipboardChromium::writeRange(Range* selectedRange, Frame* frame) | 329 void ClipboardChromium::writeRange(Range* selectedRange, Frame* frame) |
330 { | 330 { |
331 ASSERT(selectedRange); | 331 ASSERT(selectedRange); |
332 if (!m_dataObject) | 332 if (!m_dataObject) |
333 return; | 333 return; |
334 | 334 |
335 m_dataObject->textHtml = createMarkup(selectedRange, 0, | 335 m_dataObject->textHtml = createMarkup(selectedRange, 0, |
336 AnnotateForInterchange); | 336 AnnotateForInterchange); |
| 337 m_dataObject->textHtml = String("<meta charset='utf-8'>") + m_dataObject->te
xtHtml; |
337 m_dataObject->htmlBaseUrl = frame->document()->url(); | 338 m_dataObject->htmlBaseUrl = frame->document()->url(); |
338 | 339 |
339 String str = frame->selectedText(); | 340 String str = frame->selectedText(); |
340 #if PLATFORM(WIN_OS) | 341 #if PLATFORM(WIN_OS) |
341 replaceNewlinesWithWindowsStyleNewlines(str); | 342 replaceNewlinesWithWindowsStyleNewlines(str); |
342 #endif | 343 #endif |
343 replaceNBSPWithSpace(str); | 344 replaceNBSPWithSpace(str); |
344 m_dataObject->plainText = str; | 345 m_dataObject->plainText = str; |
345 } | 346 } |
346 | 347 |
347 bool ClipboardChromium::hasData() | 348 bool ClipboardChromium::hasData() |
348 { | 349 { |
349 if (!m_dataObject) | 350 if (!m_dataObject) |
350 return false; | 351 return false; |
351 | 352 |
352 return m_dataObject->hasData(); | 353 return m_dataObject->hasData(); |
353 } | 354 } |
354 | 355 |
355 } // namespace WebCore | 356 } // namespace WebCore |
OLD | NEW |