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

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: 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
Index: remoting/protocol/input_filter.h
diff --git a/remoting/protocol/input_filter.h b/remoting/protocol/input_filter.h
index ba8b640e27c94fb49ba2b42015448e681998e3e0..71f765580a375331ec70554edae5b77c9dd31b85 100644
--- a/remoting/protocol/input_filter.h
+++ b/remoting/protocol/input_filter.h
@@ -13,26 +13,34 @@ namespace remoting {
namespace protocol {
// Forwards input events to |input_stub|, iif |input_stub| is not NULL.
simonmorris 2012/08/20 16:37:18 "iff" doesn't apply now. Is it feasible to requir
Wez 2012/08/20 19:58:21 Done.
+// Input forwarding may 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);
};

Powered by Google App Engine
This is Rietveld 408576698