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

Side by Side Diff: remoting/host/remote_input_filter.h

Issue 667123002: Standardize usage of virtual/override/final in remoting/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « remoting/host/register_support_host_request.h ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_REMOTE_INPUT_FILTER_H_ 5 #ifndef REMOTING_HOST_REMOTE_INPUT_FILTER_H_
6 #define REMOTING_HOST_REMOTE_INPUT_FILTER_H_ 6 #define REMOTING_HOST_REMOTE_INPUT_FILTER_H_
7 7
8 #include <list> 8 #include <list>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 #include "remoting/protocol/input_event_tracker.h" 13 #include "remoting/protocol/input_event_tracker.h"
14 #include "remoting/protocol/input_stub.h" 14 #include "remoting/protocol/input_stub.h"
15 15
16 namespace remoting { 16 namespace remoting {
17 17
18 // Filtering InputStub that filters remotely-injected input if it has been 18 // Filtering InputStub that filters remotely-injected input if it has been
19 // notified of local input recently. 19 // notified of local input recently.
20 class RemoteInputFilter : public protocol::InputStub { 20 class RemoteInputFilter : public protocol::InputStub {
21 public: 21 public:
22 // Creates a filter forwarding events to the specified InputEventTracker. 22 // Creates a filter forwarding events to the specified InputEventTracker.
23 // The filter needs a tracker to release buttons & keys when blocking input. 23 // The filter needs a tracker to release buttons & keys when blocking input.
24 explicit RemoteInputFilter(protocol::InputEventTracker* event_tracker); 24 explicit RemoteInputFilter(protocol::InputEventTracker* event_tracker);
25 virtual ~RemoteInputFilter(); 25 ~RemoteInputFilter() override;
26 26
27 // Informs the filter that local mouse activity has been detected. If the 27 // Informs the filter that local mouse activity has been detected. If the
28 // activity does not match events we injected then we assume that it is local, 28 // activity does not match events we injected then we assume that it is local,
29 // and block remote input for a short while. 29 // and block remote input for a short while.
30 void LocalMouseMoved(const webrtc::DesktopVector& mouse_pos); 30 void LocalMouseMoved(const webrtc::DesktopVector& mouse_pos);
31 31
32 // Informs the filter that injecting input causes an echo. 32 // Informs the filter that injecting input causes an echo.
33 void SetExpectLocalEcho(bool expect_local_echo); 33 void SetExpectLocalEcho(bool expect_local_echo);
34 34
35 // InputStub overrides. 35 // InputStub overrides.
36 virtual void InjectKeyEvent(const protocol::KeyEvent& event) override; 36 void InjectKeyEvent(const protocol::KeyEvent& event) override;
37 virtual void InjectTextEvent(const protocol::TextEvent& event) override; 37 void InjectTextEvent(const protocol::TextEvent& event) override;
38 virtual void InjectMouseEvent(const protocol::MouseEvent& event) override; 38 void InjectMouseEvent(const protocol::MouseEvent& event) override;
39 39
40 private: 40 private:
41 bool ShouldIgnoreInput() const; 41 bool ShouldIgnoreInput() const;
42 42
43 protocol::InputEventTracker* event_tracker_; 43 protocol::InputEventTracker* event_tracker_;
44 44
45 // Queue of recently-injected mouse positions used to distinguish echoes of 45 // Queue of recently-injected mouse positions used to distinguish echoes of
46 // injected events from movements from a local input device. 46 // injected events from movements from a local input device.
47 std::list<webrtc::DesktopVector> injected_mouse_positions_; 47 std::list<webrtc::DesktopVector> injected_mouse_positions_;
48 48
49 // Time at which local input events were most recently observed. 49 // Time at which local input events were most recently observed.
50 base::TimeTicks latest_local_input_time_; 50 base::TimeTicks latest_local_input_time_;
51 51
52 // If |true| than the filter assumes that injecting input causes an echo. 52 // If |true| than the filter assumes that injecting input causes an echo.
53 bool expect_local_echo_; 53 bool expect_local_echo_;
54 54
55 DISALLOW_COPY_AND_ASSIGN(RemoteInputFilter); 55 DISALLOW_COPY_AND_ASSIGN(RemoteInputFilter);
56 }; 56 };
57 57
58 } // namespace remoting 58 } // namespace remoting
59 59
60 #endif // REMOTING_HOST_REMOTE_INPUT_FILTER_H_ 60 #endif // REMOTING_HOST_REMOTE_INPUT_FILTER_H_
OLDNEW
« no previous file with comments | « remoting/host/register_support_host_request.h ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698