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

Side by Side Diff: components/mus/ws/accelerator.cc

Issue 2119963002: Move mus to //services/ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 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
« no previous file with comments | « components/mus/ws/accelerator.h ('k') | components/mus/ws/access_policy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 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/mus/ws/accelerator.h"
6
7 namespace mus {
8 namespace ws {
9
10 Accelerator::Accelerator(uint32_t id, const mojom::EventMatcher& matcher)
11 : id_(id),
12 accelerator_phase_(matcher.accelerator_phase),
13 event_matcher_(matcher),
14 weak_factory_(this) {}
15
16 Accelerator::~Accelerator() {}
17
18 bool Accelerator::MatchesEvent(const ui::Event& event,
19 const ui::mojom::AcceleratorPhase phase) const {
20 if (accelerator_phase_ != phase)
21 return false;
22 if (!event_matcher_.MatchesEvent(event))
23 return false;
24 return true;
25 }
26
27 bool Accelerator::EqualEventMatcher(const Accelerator* other) const {
28 return accelerator_phase_ == other->accelerator_phase_ &&
29 event_matcher_.Equals(other->event_matcher_);
30 }
31
32 } // namespace ws
33 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/ws/accelerator.h ('k') | components/mus/ws/access_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698