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

Side by Side Diff: remoting/protocol/clipboard_filter.cc

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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/protocol/clipboard_filter.h ('k') | remoting/protocol/clipboard_filter_unittest.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 #include "base/logging.h" 5 #include "base/logging.h"
6 #include "remoting/protocol/clipboard_filter.h" 6 #include "remoting/protocol/clipboard_filter.h"
7 7
8 namespace remoting { 8 namespace remoting {
9 namespace protocol { 9 namespace protocol {
10 10
11 ClipboardFilter::ClipboardFilter() : clipboard_stub_(NULL) { 11 ClipboardFilter::ClipboardFilter() : clipboard_stub_(NULL), enabled_(true) {
12 }
13
14 ClipboardFilter::ClipboardFilter(ClipboardStub* clipboard_stub)
15 : clipboard_stub_(clipboard_stub), enabled_(true) {
12 } 16 }
13 17
14 ClipboardFilter::~ClipboardFilter() { 18 ClipboardFilter::~ClipboardFilter() {
15 } 19 }
16 20
17 void ClipboardFilter::set_clipboard_stub(ClipboardStub* clipboard_stub) { 21 void ClipboardFilter::set_clipboard_stub(ClipboardStub* clipboard_stub) {
18 clipboard_stub_ = clipboard_stub; 22 clipboard_stub_ = clipboard_stub;
19 } 23 }
20 24
21 void ClipboardFilter::InjectClipboardEvent(const ClipboardEvent& event) { 25 void ClipboardFilter::InjectClipboardEvent(const ClipboardEvent& event) {
22 if (clipboard_stub_ != NULL) 26 if (enabled_ && clipboard_stub_ != NULL)
23 clipboard_stub_->InjectClipboardEvent(event); 27 clipboard_stub_->InjectClipboardEvent(event);
24 } 28 }
25 29
26 } // namespace protocol 30 } // namespace protocol
27 } // namespace remoting 31 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/clipboard_filter.h ('k') | remoting/protocol/clipboard_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698