diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-04 03:36:36 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-04 03:36:36 +0000 |
commit | 3a2a5d201631f31800a889164cb84b3c6784b8c2 (patch) | |
tree | 52f45c58258845ad6b0a9a9591e15b3cc225337c /webkit/glue/webclipboard_impl.cc | |
parent | 0bb1a6204af17f50ad0577f811a2c044b2bf62ff (diff) | |
download | chromium_src-3a2a5d201631f31800a889164cb84b3c6784b8c2.zip chromium_src-3a2a5d201631f31800a889164cb84b3c6784b8c2.tar.gz chromium_src-3a2a5d201631f31800a889164cb84b3c6784b8c2.tar.bz2 |
Update clipboard classes to use string16 and FilePath instead of wstring.
Update callers as well.
This patch builds on a patch by mark.a.lindner@gmail.com which can be found at http://codereview.chromium.org/28294
Review URL: http://codereview.chromium.org/27370
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10860 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webclipboard_impl.cc')
-rw-r--r-- | webkit/glue/webclipboard_impl.cc | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/webkit/glue/webclipboard_impl.cc b/webkit/glue/webclipboard_impl.cc index 029643f..04b0ef6 100644 --- a/webkit/glue/webclipboard_impl.cc +++ b/webkit/glue/webclipboard_impl.cc @@ -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 @@ bool WebClipboardImpl::isFormatAvailable(Format format) { 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::writeHTML( 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 @@ void WebClipboardImpl::writeImage( #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())); } } |