| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef REMOTING_HOST_SESSION_EVENT_EXECUTOR_WIN_H_ | 5 #ifndef REMOTING_HOST_SESSION_EVENT_EXECUTOR_WIN_H_ |
| 6 #define REMOTING_HOST_SESSION_EVENT_EXECUTOR_WIN_H_ | 6 #define REMOTING_HOST_SESSION_EVENT_EXECUTOR_WIN_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 class MessageLoopProxy; | 22 class MessageLoopProxy; |
| 23 } // namespace base | 23 } // namespace base |
| 24 | 24 |
| 25 namespace IPC { | 25 namespace IPC { |
| 26 class ChannelProxy; | 26 class ChannelProxy; |
| 27 } // namespace IPC | 27 } // namespace IPC |
| 28 | 28 |
| 29 namespace remoting { | 29 namespace remoting { |
| 30 | 30 |
| 31 class SessionEventExecutorWin : public EventExecutor, | 31 class SessionEventExecutorWin : public EventExecutor, |
| 32 public IPC::Channel::Listener { | 32 public IPC::Listener { |
| 33 public: | 33 public: |
| 34 SessionEventExecutorWin(MessageLoop* message_loop, | 34 SessionEventExecutorWin(MessageLoop* message_loop, |
| 35 base::MessageLoopProxy* io_message_loop, | 35 base::MessageLoopProxy* io_message_loop, |
| 36 scoped_ptr<EventExecutor> nested_executor); | 36 scoped_ptr<EventExecutor> nested_executor); |
| 37 ~SessionEventExecutorWin(); | 37 ~SessionEventExecutorWin(); |
| 38 | 38 |
| 39 // EventExecutor implementation. | 39 // EventExecutor implementation. |
| 40 virtual void OnSessionStarted( | 40 virtual void OnSessionStarted( |
| 41 scoped_ptr<protocol::ClipboardStub> client_clipboard) OVERRIDE; | 41 scoped_ptr<protocol::ClipboardStub> client_clipboard) OVERRIDE; |
| 42 virtual void OnSessionFinished() OVERRIDE; | 42 virtual void OnSessionFinished() OVERRIDE; |
| 43 | 43 |
| 44 // protocol::HostStub implementation. | 44 // protocol::HostStub implementation. |
| 45 virtual void InjectClipboardEvent( | 45 virtual void InjectClipboardEvent( |
| 46 const protocol::ClipboardEvent& event) OVERRIDE; | 46 const protocol::ClipboardEvent& event) OVERRIDE; |
| 47 virtual void InjectKeyEvent(const protocol::KeyEvent& event) OVERRIDE; | 47 virtual void InjectKeyEvent(const protocol::KeyEvent& event) OVERRIDE; |
| 48 virtual void InjectMouseEvent(const protocol::MouseEvent& event) OVERRIDE; | 48 virtual void InjectMouseEvent(const protocol::MouseEvent& event) OVERRIDE; |
| 49 | 49 |
| 50 // IPC::Channel::Listener implementation. | 50 // IPC::Listener implementation. |
| 51 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 51 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 // Switches to the desktop receiving a user input if different from | 54 // Switches to the desktop receiving a user input if different from |
| 55 // the current one. | 55 // the current one. |
| 56 void SwitchToInputDesktop(); | 56 void SwitchToInputDesktop(); |
| 57 | 57 |
| 58 // Pointer to the next event executor. | 58 // Pointer to the next event executor. |
| 59 scoped_ptr<EventExecutor> nested_executor_; | 59 scoped_ptr<EventExecutor> nested_executor_; |
| 60 | 60 |
| 61 MessageLoop* message_loop_; | 61 MessageLoop* message_loop_; |
| 62 | 62 |
| 63 ScopedThreadDesktopWin desktop_; | 63 ScopedThreadDesktopWin desktop_; |
| 64 | 64 |
| 65 // The Chromoting IPC channel connecting the host with the service. | 65 // The Chromoting IPC channel connecting the host with the service. |
| 66 scoped_ptr<IPC::ChannelProxy> chromoting_channel_; | 66 scoped_ptr<IPC::ChannelProxy> chromoting_channel_; |
| 67 | 67 |
| 68 // Keys currently pressed by the client, used to detect Ctrl-Alt-Del. | 68 // Keys currently pressed by the client, used to detect Ctrl-Alt-Del. |
| 69 std::set<uint32> pressed_keys_; | 69 std::set<uint32> pressed_keys_; |
| 70 | 70 |
| 71 base::WeakPtrFactory<SessionEventExecutorWin> weak_ptr_factory_; | 71 base::WeakPtrFactory<SessionEventExecutorWin> weak_ptr_factory_; |
| 72 base::WeakPtr<SessionEventExecutorWin> weak_ptr_; | 72 base::WeakPtr<SessionEventExecutorWin> weak_ptr_; |
| 73 | 73 |
| 74 DISALLOW_COPY_AND_ASSIGN(SessionEventExecutorWin); | 74 DISALLOW_COPY_AND_ASSIGN(SessionEventExecutorWin); |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 } // namespace remoting | 77 } // namespace remoting |
| 78 | 78 |
| 79 #endif // REMOTING_HOST_SESSION_EVENT_EXECUTOR_WIN_H_ | 79 #endif // REMOTING_HOST_SESSION_EVENT_EXECUTOR_WIN_H_ |
| OLD | NEW |