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

Unified Diff: webkit/glue/webclipboard_impl.cc

Issue 27370: Update clipboard classes to use string16 and FilePath instead of wstring.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/glue/simple_clipboard_impl.cc ('k') | webkit/glue/webkit_glue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webclipboard_impl.cc
===================================================================
--- webkit/glue/webclipboard_impl.cc (revision 10811)
+++ webkit/glue/webclipboard_impl.cc (working copy)
@@ -11,6 +11,7 @@
#include "base/clipboard.h"
#include "base/logging.h"
#include "base/string_util.h"
+#include "base/string16.h"
#include "googleurl/src/gurl.h"
#include "net/base/escape.h"
#include "webkit/glue/scoped_clipboard_writer_glue.h"
@@ -72,36 +73,36 @@
WebString WebClipboardImpl::readPlainText() {
if (ClipboardIsFormatAvailable(Clipboard::GetPlainTextWFormatType())) {
- std::wstring text;
+ string16 text;
ClipboardReadText(&text);
if (!text.empty())
- return WideToUTF16Hack(text);
+ return text;
}
if (ClipboardIsFormatAvailable(Clipboard::GetPlainTextFormatType())) {
std::string text;
ClipboardReadAsciiText(&text);
if (!text.empty())
- return UTF8ToUTF16(text);
+ return ASCIIToUTF16(text);
}
return WebString();
}
WebString WebClipboardImpl::readHTML(WebURL* source_url) {
- std::wstring html_stdstr;
+ string16 html_stdstr;
GURL gurl;
ClipboardReadHTML(&html_stdstr, &gurl);
*source_url = gurl;
- return WideToUTF16Hack(html_stdstr);
+ return html_stdstr;
}
void WebClipboardImpl::writeHTML(
const WebString& html_text, const WebURL& source_url,
const WebString& plain_text, bool write_smart_paste) {
ScopedClipboardWriterGlue scw(ClipboardGetClipboard());
- scw.WriteHTML(UTF16ToWideHack(html_text), source_url.spec());
- scw.WriteText(UTF16ToWideHack(plain_text));
+ scw.WriteHTML(html_text, source_url.spec());
+ scw.WriteText(plain_text);
if (write_smart_paste)
scw.WriteWebSmartPaste();
@@ -110,9 +111,9 @@
void WebClipboardImpl::writeURL(const WebURL& url, const WebString& title) {
ScopedClipboardWriterGlue scw(ClipboardGetClipboard());
- scw.WriteBookmark(UTF16ToWideHack(title), url.spec());
- scw.WriteHTML(UTF8ToWide(URLToMarkup(url, title)), "");
- scw.WriteText(UTF8ToWide(url.spec()));
+ scw.WriteBookmark(title, url.spec());
+ scw.WriteHTML(UTF8ToUTF16(URLToMarkup(url, title)), "");
+ scw.WriteText(UTF8ToUTF16(url.spec()));
}
void WebClipboardImpl::writeImage(
@@ -125,9 +126,9 @@
#endif
if (!url.isEmpty()) {
- scw.WriteBookmark(UTF16ToWideHack(title), url.spec());
- scw.WriteHTML(UTF8ToWide(URLToImageMarkup(url, title)), "");
- scw.WriteText(UTF8ToWide(url.spec()));
+ scw.WriteBookmark(title, url.spec());
+ scw.WriteHTML(UTF8ToUTF16(URLToImageMarkup(url, title)), "");
+ scw.WriteText(UTF8ToUTF16(url.spec()));
}
}
« no previous file with comments | « webkit/glue/simple_clipboard_impl.cc ('k') | webkit/glue/webkit_glue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698