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 "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), enabled_(true) { | 11 ClipboardFilter::ClipboardFilter() : clipboard_stub_(nullptr), enabled_(true) { |
12 } | 12 } |
13 | 13 |
14 ClipboardFilter::ClipboardFilter(ClipboardStub* clipboard_stub) | 14 ClipboardFilter::ClipboardFilter(ClipboardStub* clipboard_stub) |
15 : clipboard_stub_(clipboard_stub), enabled_(true) { | 15 : clipboard_stub_(clipboard_stub), enabled_(true) { |
16 } | 16 } |
17 | 17 |
18 ClipboardFilter::~ClipboardFilter() { | 18 ClipboardFilter::~ClipboardFilter() { |
19 } | 19 } |
20 | 20 |
21 void ClipboardFilter::set_clipboard_stub(ClipboardStub* clipboard_stub) { | 21 void ClipboardFilter::set_clipboard_stub(ClipboardStub* clipboard_stub) { |
22 clipboard_stub_ = clipboard_stub; | 22 clipboard_stub_ = clipboard_stub; |
23 } | 23 } |
24 | 24 |
25 void ClipboardFilter::InjectClipboardEvent(const ClipboardEvent& event) { | 25 void ClipboardFilter::InjectClipboardEvent(const ClipboardEvent& event) { |
26 if (enabled_ && clipboard_stub_ != NULL) | 26 if (enabled_ && clipboard_stub_ != nullptr) |
27 clipboard_stub_->InjectClipboardEvent(event); | 27 clipboard_stub_->InjectClipboardEvent(event); |
28 } | 28 } |
29 | 29 |
30 } // namespace protocol | 30 } // namespace protocol |
31 } // namespace remoting | 31 } // namespace remoting |
OLD | NEW |