blob: d4653984f0b1143b7a5a838ebe7f1494244a52b5 [file] [log] [blame]
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef REMOTING_HOST_SESSION_EVENT_EXECUTOR_WIN_H_
#define REMOTING_HOST_SESSION_EVENT_EXECUTOR_WIN_H_
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "ipc/ipc_channel.h"
#include "remoting/host/event_executor.h"
#include "remoting/host/scoped_thread_desktop_win.h"
#include "remoting/protocol/host_event_stub.h"
class MessageLoop;
namespace base {
class MessageLoopProxy;
} // namespace base
namespace IPC {
class ChannelProxy;
} // namespace IPC
namespace remoting {
class SessionEventExecutorWin : public protocol::HostEventStub,
public IPC::Channel::Listener {
public:
SessionEventExecutorWin(MessageLoop* message_loop,
base::MessageLoopProxy* io_message_loop,
scoped_ptr<protocol::HostEventStub> nested_executor);
~SessionEventExecutorWin();
// ClipboardStub interface.
virtual void InjectClipboardEvent(
const protocol::ClipboardEvent& event) OVERRIDE;
// protocol::InputStub implementation.
virtual void InjectKeyEvent(const protocol::KeyEvent& event) OVERRIDE;
virtual void InjectMouseEvent(const protocol::MouseEvent& event) OVERRIDE;
// IPC::Channel::Listener implementation.
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
private:
// Switches to the desktop receiving a user input if different from
// the current one.
void SwitchToInputDesktop();
// Pointer to the next event executor.
scoped_ptr<protocol::HostEventStub> nested_executor_;
MessageLoop* message_loop_;
ScopedThreadDesktopWin desktop_;
// The Chromoting IPC channel connecting the host with the service.
scoped_ptr<IPC::ChannelProxy> chromoting_channel_;
bool scroll_pressed_;
DISALLOW_COPY_AND_ASSIGN(SessionEventExecutorWin);
};
} // namespace remoting
#endif // REMOTING_HOST_SESSION_EVENT_EXECUTOR_WIN_H_