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

Side by Side Diff: remoting/protocol/input_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/input_filter.h ('k') | remoting/protocol/input_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 "remoting/protocol/input_filter.h" 5 #include "remoting/protocol/input_filter.h"
6 6
7 namespace remoting { 7 namespace remoting {
8 namespace protocol { 8 namespace protocol {
9 9
10 InputFilter::InputFilter() : input_stub_(NULL) { 10 InputFilter::InputFilter() : input_stub_(NULL), enabled_(true) {
11 } 11 }
12 12
13 InputFilter::InputFilter(InputStub* input_stub) : input_stub_(input_stub) { 13 InputFilter::InputFilter(InputStub* input_stub)
14 : input_stub_(input_stub), enabled_(true) {
14 } 15 }
15 16
16 InputFilter::~InputFilter() { 17 InputFilter::~InputFilter() {
17 } 18 }
18 19
19 void InputFilter::InjectKeyEvent(const KeyEvent& event) { 20 void InputFilter::InjectKeyEvent(const KeyEvent& event) {
20 if (input_stub_ != NULL) 21 if (enabled_ && input_stub_ != NULL)
21 input_stub_->InjectKeyEvent(event); 22 input_stub_->InjectKeyEvent(event);
22 } 23 }
23 24
24 void InputFilter::InjectMouseEvent(const MouseEvent& event) { 25 void InputFilter::InjectMouseEvent(const MouseEvent& event) {
25 if (input_stub_ != NULL) 26 if (enabled_ && input_stub_ != NULL)
26 input_stub_->InjectMouseEvent(event); 27 input_stub_->InjectMouseEvent(event);
27 } 28 }
28 29
29 } // namespace protocol 30 } // namespace protocol
30 } // namespace remoting 31 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/input_filter.h ('k') | remoting/protocol/input_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698