OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "components/keyboard_lock/active_key_event_filter_tracker.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 |
| 9 namespace keyboard_lock { |
| 10 |
| 11 ActiveKeyEventFilterTracker::ActiveKeyEventFilterTracker() = default; |
| 12 ActiveKeyEventFilterTracker::~ActiveKeyEventFilterTracker() = default; |
| 13 |
| 14 void ActiveKeyEventFilterTracker::set(KeyEventFilter* filter) { |
| 15 DCHECK(thread_checker_.CalledOnValidThread()); |
| 16 filter_ = filter; |
| 17 } |
| 18 |
| 19 void ActiveKeyEventFilterTracker::erase(const KeyEventFilter* filter) { |
| 20 DCHECK(thread_checker_.CalledOnValidThread()); |
| 21 if (filter_ == filter) { |
| 22 filter_ = nullptr; |
| 23 } |
| 24 } |
| 25 |
| 26 KeyEventFilter* ActiveKeyEventFilterTracker::get() const { |
| 27 DCHECK(thread_checker_.CalledOnValidThread()); |
| 28 return filter_; |
| 29 } |
| 30 |
| 31 } // namespace keyboard_lock |
OLD | NEW |