OLD | NEW |
---|---|
(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 UI_BASE_ACCELERATORS_ACCELERATOR_HISTORY_H_ | |
6 #define UI_BASE_ACCELERATORS_ACCELERATOR_HISTORY_H_ | |
7 | |
8 #include "base/memory/singleton.h" | |
9 #include "ui/base/accelerators/accelerator.h" | |
10 #include "ui/base/ui_base_export.h" | |
11 #include "ui/events/event.h" | |
12 #include "ui/events/event_handler.h" | |
13 | |
14 namespace ui { | |
15 | |
16 // Keeps track of the system-wide current and the most recent previous | |
17 // key accelerators. | |
18 class UI_BASE_EXPORT AcceleratorHistory { | |
19 public: | |
20 AcceleratorHistory(); | |
21 ~AcceleratorHistory(); | |
22 | |
23 // Returns the most recent recorded accelerator. | |
24 const Accelerator& GetCurrentAccelerator() const; | |
25 | |
26 // Returns the most recent previously recorded accelerator that is different | |
27 // than the current. | |
28 const Accelerator& GetPreviousAccelerator() const; | |
sky
2014/11/18 22:11:48
inline these and name to match the fields, eg prev
afakhry
2014/11/18 23:08:40
Done.
| |
29 | |
30 // Stores the given |accelerator| only if it's different than the currently | |
31 // stored one. | |
32 void StoreCurrentAccelerator(const Accelerator& accelerator); | |
33 | |
34 private: | |
35 | |
sky
2014/11/18 22:11:48
nit: no newline here.
afakhry
2014/11/18 23:08:40
Done.
| |
36 Accelerator current_accelerator_; | |
37 Accelerator previous_accelerator_; | |
38 }; | |
sky
2014/11/18 22:11:48
DISALLOW...
afakhry
2014/11/18 23:08:40
Done.
| |
39 | |
40 }; // namespace ui | |
41 | |
42 #endif // UI_BASE_ACCELERATORS_ACCELERATOR_HISTORY_H_ | |
OLD | NEW |