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

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: 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_echo_filter_unittest.cc ('k') | remoting/protocol/clipboard_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/clipboard_filter.h
diff --git a/remoting/protocol/clipboard_filter.h b/remoting/protocol/clipboard_filter.h
index 5fbcda5a15b7d2813be0e2d26786974747a600a3..0cae152f965ec82c92e1ff3209a329314f2e7c87 100644
--- a/remoting/protocol/clipboard_filter.h
+++ b/remoting/protocol/clipboard_filter.h
@@ -12,21 +12,28 @@
namespace remoting {
namespace protocol {
-// Forwards clipboard events to |clipboard_stub|, iff |clipboard_stub| is not
-// NULL.
+// Forwards clipboard events to |clipboard_stub|, if configured. Event
+// forwarding may also be disabled independently of the configured
+// |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);
};
« no previous file with comments | « remoting/protocol/clipboard_echo_filter_unittest.cc ('k') | remoting/protocol/clipboard_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698