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

Unified Diff: remoting/host/clipboard_win.cc

Issue 10441131: [Chromoting] Handle CR-LF correctly when transferring text items to and from the clipboard on a Win… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add a static_cast to a unit test. Created 8 years, 7 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 | « remoting/base/util_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/clipboard_win.cc
diff --git a/remoting/host/clipboard_win.cc b/remoting/host/clipboard_win.cc
index cc504bad231edeeaa64545135275b7f6ed1ef3da..8d0938f32eb791d311fe16f3b2eeab7666f6b824 100644
--- a/remoting/host/clipboard_win.cc
+++ b/remoting/host/clipboard_win.cc
@@ -17,6 +17,7 @@
#include "base/win/windows_version.h"
#include "base/win/wrapped_window_proc.h"
#include "remoting/base/constants.h"
+#include "remoting/base/util.h"
#include "remoting/proto/event.pb.h"
#include "remoting/protocol/clipboard_stub.h"
@@ -202,7 +203,7 @@ void ClipboardWin::InjectClipboardEvent(
if (event.mime_type().compare(kMimeTypeTextUtf8)) {
return;
}
- string16 text = UTF8ToUTF16(event.data());
+ string16 text = UTF8ToUTF16(ReplaceLfByCrLf(event.data()));
ScopedClipboard clipboard;
if (!clipboard.Init(hwnd_)) {
@@ -259,7 +260,7 @@ void ClipboardWin::OnClipboardUpdate() {
protocol::ClipboardEvent event;
event.set_mime_type(kMimeTypeTextUtf8);
- event.set_data(UTF16ToUTF8(text));
+ event.set_data(ReplaceCrLfByLf(UTF16ToUTF8(text)));
if (client_clipboard_.get()) {
client_clipboard_->InjectClipboardEvent(event);
« no previous file with comments | « remoting/base/util_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698