Chromium Code Reviews| 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 // ---------------------------------------------------------------------- | |
| 17 // Keeps track of the system-wide current and the most recent previous | |
| 18 // key accelerators. | |
| 19 // ---------------------------------------------------------------------- | |
|
Jun Mukai
2014/11/18 17:33:44
Usually comment for class description doesn't have
afakhry
2014/11/18 19:23:51
Done.
| |
| 20 class UI_BASE_EXPORT AcceleratorHistory : public EventHandler { | |
| 21 public: | |
| 22 AcceleratorHistory(); | |
| 23 ~AcceleratorHistory(); | |
| 24 | |
| 25 // Returns the most recent recorded accelerator. | |
| 26 const Accelerator& GetCurrentAccelerator() const; | |
| 27 | |
| 28 // Returns the most recent previously recorded accelerator that is different | |
| 29 // than the current. | |
| 30 const Accelerator& GetPreviousAccelerator() const; | |
| 31 | |
| 32 // Stores the given |accelerator| only if it's different than the currently | |
| 33 // stored one. | |
| 34 void StoreCurrentAccelerator(const Accelerator& accelerator); | |
| 35 | |
| 36 private: | |
| 37 | |
| 38 Accelerator current_accelerator_; | |
| 39 Accelerator previous_accelerator_; | |
| 40 }; | |
| 41 | |
| 42 }; // namespace ui | |
| 43 | |
| 44 #endif // UI_BASE_ACCELERATORS_ACCELERATOR_HISTORY_H_ | |
| OLD | NEW |