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

Side by Side Diff: platform/chromium/ClipboardChromium.cpp

Issue 149414: Mark HTML as UTF-8.... (Closed) Base URL: http://svn.webkit.org/repository/webkit/trunk/WebCore/
Patch Set: '' Created 11 years, 5 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
« no previous file with comments | « no previous file | platform/chromium/PasteboardChromium.cpp » ('j') | 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) 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
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
OLDNEW
« no previous file with comments | « no previous file | platform/chromium/PasteboardChromium.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698