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

Side by Side Diff: ash/common/accelerators/accelerator_router.h

Issue 2171983002: Move processing out of AcceleratorDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wire_up_controller
Patch Set: not relative 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
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 #ifndef ASH_ACCELERATORS_ACCELERATOR_ROUTER_H_
6 #define ASH_ACCELERATORS_ACCELERATOR_ROUTER_H_
7
8 #include "ash/ash_export.h"
9 #include "base/macros.h"
10
11 namespace ui {
12 class Accelerator;
13 class KeyEvent;
14 }
15
16 namespace ash {
17
18 class WmWindow;
19
20 // AcceleratorRouter does a minimal amount of processing before routing the
21 // accelerator to the AcceleratorController. AcceleratorRouter may also decide
22 // not to process certain accelerators.
23 class ASH_EXPORT AcceleratorRouter {
24 public:
25 AcceleratorRouter();
26 ~AcceleratorRouter();
27
28 // Returns true if event should be consumed. |target| is the target of the
29 // event.
30 bool ProcessAccelerator(WmWindow* target,
31 const ui::KeyEvent& event,
32 const ui::Accelerator& accelerator);
33
34 private:
35 // Returns true if the window should be allowed a chance to handle
36 // system keys.
37 bool CanConsumeSystemKeys(WmWindow* target, const ui::KeyEvent& event);
38
39 // Returns true if the |accelerator| should be processed now, inside Ash's env
40 // event filter.
James Cook 2016/07/22 16:48:02 Is it still true that ash has an env event filter?
sky 2016/07/22 17:05:06 Updated comment (removed portion after ',').
41 bool ShouldProcessAcceleratorNow(WmWindow* target,
42 const ui::KeyEvent& event,
43 const ui::Accelerator& accelerator);
44
45 DISALLOW_COPY_AND_ASSIGN(AcceleratorRouter);
46 };
47
48 } // namespace ash
49
50 #endif // ASH_ACCELERATORS_ACCELERATOR_ROUTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698