OLD | NEW |
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), enabled_(true) { | 10 InputFilter::InputFilter() : input_stub_(nullptr), enabled_(true) { |
11 } | 11 } |
12 | 12 |
13 InputFilter::InputFilter(InputStub* input_stub) | 13 InputFilter::InputFilter(InputStub* input_stub) |
14 : input_stub_(input_stub), enabled_(true) { | 14 : input_stub_(input_stub), enabled_(true) { |
15 } | 15 } |
16 | 16 |
17 InputFilter::~InputFilter() { | 17 InputFilter::~InputFilter() { |
18 } | 18 } |
19 | 19 |
20 void InputFilter::InjectKeyEvent(const KeyEvent& event) { | 20 void InputFilter::InjectKeyEvent(const KeyEvent& event) { |
21 if (enabled_ && input_stub_ != NULL) | 21 if (enabled_ && input_stub_ != nullptr) |
22 input_stub_->InjectKeyEvent(event); | 22 input_stub_->InjectKeyEvent(event); |
23 } | 23 } |
24 | 24 |
25 void InputFilter::InjectTextEvent(const TextEvent& event) { | 25 void InputFilter::InjectTextEvent(const TextEvent& event) { |
26 if (enabled_ && input_stub_ != NULL) | 26 if (enabled_ && input_stub_ != nullptr) |
27 input_stub_->InjectTextEvent(event); | 27 input_stub_->InjectTextEvent(event); |
28 } | 28 } |
29 | 29 |
30 void InputFilter::InjectMouseEvent(const MouseEvent& event) { | 30 void InputFilter::InjectMouseEvent(const MouseEvent& event) { |
31 if (enabled_ && input_stub_ != NULL) | 31 if (enabled_ && input_stub_ != nullptr) |
32 input_stub_->InjectMouseEvent(event); | 32 input_stub_->InjectMouseEvent(event); |
33 } | 33 } |
34 | 34 |
35 } // namespace protocol | 35 } // namespace protocol |
36 } // namespace remoting | 36 } // namespace remoting |
OLD | NEW |