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

Unified Diff: remoting/protocol/input_filter.h

Issue 10860033: Allow input & clipboard filters to be disabled without NULLing target stub. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments and fix clipboard pipeline initialization. Created 8 years, 4 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/protocol/clipboard_filter_unittest.cc ('k') | remoting/protocol/input_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/input_filter.h
diff --git a/remoting/protocol/input_filter.h b/remoting/protocol/input_filter.h
index ba8b640e27c94fb49ba2b42015448e681998e3e0..1255637546897fd84e23c02232350e5a0a788020 100644
--- a/remoting/protocol/input_filter.h
+++ b/remoting/protocol/input_filter.h
@@ -12,27 +12,35 @@
namespace remoting {
namespace protocol {
-// Forwards input events to |input_stub|, iif |input_stub| is not NULL.
+// Forwards input events to |input_stub|, if configured. Input forwarding may
+// also be disabled independently of the |input_stub| being set. InputFilters
+// initially have input forwarding enabled.
class InputFilter : public InputStub {
public:
InputFilter();
explicit InputFilter(InputStub* input_stub);
virtual ~InputFilter();
- // Return the InputStub that events will be forwarded to.
- InputStub* input_stub() { return input_stub_; }
-
// Set the InputStub that events will be forwarded to.
void set_input_stub(InputStub* input_stub) {
input_stub_ = input_stub;
}
+ // Enable/disable routing of events to the InputStub.
+ void set_enabled(bool enabled) {
+ enabled_ = enabled;
+ }
+ bool enabled() const {
+ return enabled_;
+ }
+
// InputStub interface.
virtual void InjectKeyEvent(const KeyEvent& event) OVERRIDE;
virtual void InjectMouseEvent(const MouseEvent& event) OVERRIDE;
private:
InputStub* input_stub_;
+ bool enabled_;
DISALLOW_COPY_AND_ASSIGN(InputFilter);
};
« no previous file with comments | « remoting/protocol/clipboard_filter_unittest.cc ('k') | remoting/protocol/input_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698