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

Side by Side Diff: components/keyboard_lock/active_key_event_filter.cc

Issue 2879033002: Keyboard Lock Host implementation
Patch Set: Remove useless files Created 3 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
OLDNEW
(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.h"
6
7 #include "base/logging.h"
8 #include "components/keyboard_lock/active_key_event_filter_tracker.h"
9
10 namespace keyboard_lock {
11
12 ActiveKeyEventFilter::ActiveKeyEventFilter(
13 const ActiveKeyEventFilterTracker* tracker)
14 : tracker_(tracker) {
15 DCHECK(tracker_);
16 }
17
18 ActiveKeyEventFilter::~ActiveKeyEventFilter() = default;
19
20 bool ActiveKeyEventFilter::OnKeyDown(ui::KeyboardCode code, int flags) {
21 KeyEventFilter* filter = tracker_->get();
22 if (!filter) {
23 return false;
24 }
25
26 return filter->OnKeyDown(code, flags);
27 }
28
29 bool ActiveKeyEventFilter::OnKeyUp(ui::KeyboardCode code, int flags) {
30 KeyEventFilter* filter = tracker_->get();
31 if (!filter) {
32 return false;
33 }
34
35 return filter->OnKeyUp(code, flags);
36 }
37
38 } // namespace keyboard_lock
OLDNEW
« no previous file with comments | « components/keyboard_lock/active_key_event_filter.h ('k') | components/keyboard_lock/active_key_event_filter_registrar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698