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

Side by Side Diff: athena/input/accelerator_manager_impl.h

Issue 305873002: InputManager/AcceleratorManager for athena (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « athena/input/DEPS ('k') | athena/input/accelerator_manager_impl.cc » ('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 2014 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 ATHENA_INPUT_ACCELERATOR_MANAGER_H_
6 #define ATHENA_INPUT_ACCELERATOR_MANAGER_H_
7
8 #include "athena/input/public/accelerator_manager.h"
9
10 #include <map>
11
12 #include "base/macros.h"
13 #include "ui/base/accelerators/accelerator.h"
14 #include "ui/events/event_target_iterator.h"
15
16 namespace aura {
17 class Window;
18 }
19
20 namespace ui {
21 class AcceleratorManager;
22 }
23
24 namespace wm {
25 class AcceleratorFilter;
26 class NestedAcceleratorController;
27 }
28
29 namespace athena {
30
31 // AcceleratorManagerImpl provides a API to register accelerators
32 // for athena modules. It hides various details on accelerator handling
33 // such as how to handle accelerator in a nested loop, reserved accelerators
34 // and repeated accelerators.
35 class AcceleratorManagerImpl : public AcceleratorManager,
36 public ui::AcceleratorTarget {
37 public:
38 AcceleratorManagerImpl();
39 virtual ~AcceleratorManagerImpl();
40
41 void Init();
42
43 void OnRootWindowCreated(aura::Window* root_window);
44
45 bool IsReservedAccelerator(const ui::Accelerator& accelerator) const;
46 bool ProcessAccelerator(const ui::Accelerator& accelerator);
47
48 private:
49 // AcceleratorManager:
50 virtual void RegisterAccelerators(const AcceleratorData accelerators[],
51 size_t num_accelerators,
52 AcceleratorHandler* handler) OVERRIDE;
53 virtual void EnableDebugAccelerators() OVERRIDE;
54
55 // ui::AcceleratorTarget:
56 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
57 virtual bool CanHandleAccelerators() const OVERRIDE;
58
59 class InternalData;
60
61 void RegisterAccelerator(const AcceleratorData& accelerator,
62 AcceleratorHandler* handler);
63
64 bool debug_accelerators_enabled_;
65 std::map<ui::Accelerator, InternalData> accelerators_;
66 scoped_ptr<ui::AcceleratorManager> accelerator_manager_;
67
68 scoped_ptr<wm::AcceleratorFilter> accelerator_filter_;
69 scoped_ptr<wm::NestedAcceleratorController> nested_accelerator_controller_;
70
71 DISALLOW_COPY_AND_ASSIGN(AcceleratorManagerImpl);
72 };
73
74 } // namespace athena
75
76 #endif // ATHENA_INPUT_ACCELERATOR_MANAGER_H_
OLDNEW
« no previous file with comments | « athena/input/DEPS ('k') | athena/input/accelerator_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698