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

Side by Side Diff: remoting/protocol/key_event_tracker.h

Issue 9465035: Move ClientSession's input logic into separate components. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef REMOTING_PROTOCOL_KEY_EVENT_TRACKER_H_
6 #define REMOTING_PROTOCOL_KEY_EVENT_TRACKER_H_
7
8 #include <set>
9
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "remoting/protocol/input_stub.h"
13
14 namespace remoting {
15 namespace protocol {
16
17 // Filtering InputStub which tracks key press and release events before passing
18 // them on to |input_stub|, and can dispatch release events to |input_stub| for
19 // all currently-pressed keys when necessary.
20 class KeyEventTracker : public InputStub {
21 public:
22 KeyEventTracker(protocol::InputStub* input_stub);
23 virtual ~KeyEventTracker();
24
25 // Dispatch release events for all currently-pressed keys to the InputStub.
26 void ReleaseAllKeys();
27
28 // InputStub interface.
29 virtual void InjectKeyEvent(const KeyEvent& event) OVERRIDE;
30 virtual void InjectMouseEvent(const MouseEvent& event) OVERRIDE;
31
32 private:
33 protocol::InputStub* input_stub_;
34
35 std::set<int> pressed_keys_;
36
37 DISALLOW_COPY_AND_ASSIGN(KeyEventTracker);
38 };
39
40 } // namespace protocol
41 } // namespace remoting
42
43 #endif // REMOTING_PROTOCOL_KEY_EVENT_TRACKER_H_
OLDNEW
« no previous file with comments | « remoting/protocol/input_event_tracker_unittest.cc ('k') | remoting/protocol/key_event_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698