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

Unified Diff: mojo/services/html_viewer/blink_basic_type_converters.cc

Issue 562483002: mojo: Create a basic clipboard. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes to the gn files. Created 6 years, 3 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
Index: mojo/services/html_viewer/blink_basic_type_converters.cc
diff --git a/mojo/services/html_viewer/blink_basic_type_converters.cc b/mojo/services/html_viewer/blink_basic_type_converters.cc
index 23b9e5f2ddddcb432b433424467749bb545d5b97..eb526526a848a64e52ccf170af7338af1adbd0ec 100644
--- a/mojo/services/html_viewer/blink_basic_type_converters.cc
+++ b/mojo/services/html_viewer/blink_basic_type_converters.cc
@@ -21,4 +21,14 @@ WebString TypeConverter<WebString, String>::Convert(const String& str) {
return WebString::fromUTF8(str.get());
}
+// static
+Array<uint8_t> TypeConverter<Array<uint8_t>, blink::WebString>::Convert(
+ const blink::WebString& input) {
+ std::string utf8 = input.utf8();
+ Array<uint8_t> result(utf8.size());
+ for (size_t i = 0; i < utf8.size(); ++i)
+ result[i] = utf8[i];
+ return result.Pass();
+}
+
} // namespace mojo
« no previous file with comments | « mojo/services/html_viewer/blink_basic_type_converters.h ('k') | mojo/services/html_viewer/blink_platform_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698