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

Unified Diff: remoting/host/clipboard_win.cc

Issue 10413060: [Chromoting] Let the Windows IT2Me host send clipboard events to the client. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Correct fix. 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/host/clipboard_mac.mm ('k') | remoting/host/desktop_environment.h » ('j') | 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 0021e1f32da0d20e2bfc7b54204fdc178e2719f2..cc504bad231edeeaa64545135275b7f6ed1ef3da 100644
--- a/remoting/host/clipboard_win.cc
+++ b/remoting/host/clipboard_win.cc
@@ -18,6 +18,7 @@
#include "base/win/wrapped_window_proc.h"
#include "remoting/base/constants.h"
#include "remoting/proto/event.pb.h"
+#include "remoting/protocol/clipboard_stub.h"
namespace {
@@ -104,7 +105,8 @@ class ClipboardWin : public Clipboard {
public:
ClipboardWin();
- virtual void Start() OVERRIDE;
+ virtual void Start(
+ scoped_ptr<protocol::ClipboardStub> client_clipboard) OVERRIDE;
virtual void InjectClipboardEvent(
const protocol::ClipboardEvent& event) OVERRIDE;
virtual void Stop() OVERRIDE;
@@ -117,6 +119,7 @@ class ClipboardWin : public Clipboard {
static LRESULT CALLBACK WndProc(HWND hwmd, UINT msg, WPARAM wParam,
LPARAM lParam);
+ scoped_ptr<protocol::ClipboardStub> client_clipboard_;
HWND hwnd_;
AddClipboardFormatListenerFn* add_clipboard_format_listener_;
RemoveClipboardFormatListenerFn* remove_clipboard_format_listener_;
@@ -132,7 +135,10 @@ ClipboardWin::ClipboardWin()
load_functions_tried_(false) {
}
-void ClipboardWin::Start() {
+void ClipboardWin::Start(
+ scoped_ptr<protocol::ClipboardStub> client_clipboard) {
+ client_clipboard_.swap(client_clipboard);
+
if (!load_functions_tried_) {
load_functions_tried_ = true;
HMODULE user32_module = ::GetModuleHandle(L"user32.dll");
@@ -176,6 +182,8 @@ void ClipboardWin::Start() {
}
void ClipboardWin::Stop() {
+ client_clipboard_.reset();
+
if (hwnd_) {
if (HaveClipboardListenerApi()) {
(*remove_clipboard_format_listener_)(hwnd_);
@@ -253,7 +261,9 @@ void ClipboardWin::OnClipboardUpdate() {
event.set_mime_type(kMimeTypeTextUtf8);
event.set_data(UTF16ToUTF8(text));
- // TODO(simonmorris): Send the event to the client.
+ if (client_clipboard_.get()) {
+ client_clipboard_->InjectClipboardEvent(event);
+ }
}
}
« no previous file with comments | « remoting/host/clipboard_mac.mm ('k') | remoting/host/desktop_environment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698