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

Unified Diff: remoting/protocol/clipboard_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/clipboard_filter.h
diff --git a/remoting/protocol/clipboard_filter.h b/remoting/protocol/clipboard_filter.h
index 5fbcda5a15b7d2813be0e2d26786974747a600a3..d29776c3d9a622daf3598e558a52588079648718 100644
--- a/remoting/protocol/clipboard_filter.h
+++ b/remoting/protocol/clipboard_filter.h
@@ -13,20 +13,27 @@ namespace remoting {
namespace protocol {
// Forwards clipboard events to |clipboard_stub|, iff |clipboard_stub| is not
-// NULL.
+// NULL. Event forwarding may be disabled independently of the configured
simonmorris 2012/08/20 16:37:18 "iff" doesn't apply now. Is it feasible to requir
Wez 2012/08/20 19:58:21 We could certainly [D]CHECK() that the stub is non
+// |clipboard_stub|. ClipboardFilters initially have event forwarding enabled.
class ClipboardFilter : public ClipboardStub {
public:
ClipboardFilter();
+ explicit ClipboardFilter(ClipboardStub* clipboard_stub);
virtual ~ClipboardFilter();
// Set the ClipboardStub that events will be forwarded to.
void set_clipboard_stub(ClipboardStub* clipboard_stub);
+ // Enable/disable forwarding of clipboard events to the ClipboardStub.
+ void set_enabled(bool enabled) { enabled_ = enabled; }
+ bool enabled() const { return enabled_; }
+
// ClipboardStub interface.
virtual void InjectClipboardEvent(const ClipboardEvent& event) OVERRIDE;
private:
ClipboardStub* clipboard_stub_;
+ bool enabled_;
DISALLOW_COPY_AND_ASSIGN(ClipboardFilter);
};

Powered by Google App Engine
This is Rietveld 408576698