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

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

Issue 863033002: Delete athena/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « 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/base/accelerators/accelerator_history.h"
15 #include "ui/events/event_target_iterator.h"
16
17 namespace aura {
18 class Window;
19 }
20
21 namespace wm {
22 class AcceleratorFilter;
23 class NestedAcceleratorController;
24 }
25
26 namespace athena {
27
28 // AcceleratorManagerImpl provides a API to register accelerators
29 // for athena modules. It hides various details on accelerator handling
30 // such as how to handle accelerator in a nested loop, reserved accelerators
31 // and repeated accelerators.
32 class AcceleratorManagerImpl : public AcceleratorManager,
33 public ui::AcceleratorTarget {
34 public:
35 class AcceleratorWrapper;
36
37 // Creates an AcceleratorManager for global accelerators.
38 // This is the one returned by AcceleratorManager::Get()
39 static AcceleratorManagerImpl* CreateGlobalAcceleratorManager();
40
41 // Creates an AcceleratorManager for focus manager.
42 static scoped_ptr<AcceleratorManager> CreateForFocusManager(
43 views::FocusManager* focus_manager);
44
45 ~AcceleratorManagerImpl() override;
46
47 void Init();
48
49 void OnRootWindowCreated(aura::Window* root_window);
50
51 bool Process(const ui::Accelerator& accelerator);
52
53 // AcceleratorManager:
54 // This is made public so that implementation classes can use this.
55 virtual bool IsRegistered(const ui::Accelerator& accelerator,
56 int flags) const override;
57
58 private:
59 class InternalData;
60
61 AcceleratorManagerImpl(AcceleratorWrapper* wrapper, bool global);
62
63 // AcceleratorManager:
64 virtual void RegisterAccelerators(const AcceleratorData accelerators[],
65 size_t num_accelerators,
66 AcceleratorHandler* handler) override;
67 virtual void RegisterAccelerator(const AcceleratorData& accelerator_data,
68 AcceleratorHandler* handler) override;
69 virtual void UnregisterAccelerator(const AcceleratorData& accelerator_data,
70 AcceleratorHandler* handler) override;
71 virtual void SetDebugAcceleratorsEnabled(bool enabled) override;
72
73 // ui::AcceleratorTarget:
74 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
75 virtual bool CanHandleAccelerators() const override;
76
77 std::map<ui::Accelerator, InternalData> accelerators_;
78 scoped_ptr<AcceleratorWrapper> accelerator_wrapper_;
79 scoped_ptr<ui::AcceleratorHistory> accelerator_history_;
80 scoped_ptr<wm::AcceleratorFilter> accelerator_filter_;
81 scoped_ptr<wm::NestedAcceleratorController> nested_accelerator_controller_;
82 bool debug_accelerators_enabled_;
83 bool global_;
84
85 DISALLOW_COPY_AND_ASSIGN(AcceleratorManagerImpl);
86 };
87
88 } // namespace athena
89
90 #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