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

Unified Diff: ui/base/accelerators/accelerator_manager.h

Issue 10381145: WIP: Always update ui::AcceleratorManager Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 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 side-by-side diff with in-line comments
Download patch
Index: ui/base/accelerators/accelerator_manager.h
diff --git a/ui/base/accelerators/accelerator_manager.h b/ui/base/accelerators/accelerator_manager.h
index 3310db711b26dcb2afcc58a5b68d994c24b200af..569478ff58685b71f5138e206f06edbeb5ec1b9c 100644
--- a/ui/base/accelerators/accelerator_manager.h
+++ b/ui/base/accelerators/accelerator_manager.h
@@ -70,10 +70,17 @@ class UI_EXPORT AcceleratorManager {
// Whether the given |accelerator| has a priority handler associated with it.
bool HasPriorityHandler(const Accelerator& accelerator) const;
+ // Updates last_event_ without calling Process(). The function should be
+ // called when the |event| is consumed by some other component before this
+ // manager processes it.
+ void set_last_event(const Accelerator& event) {
+ last_event_ = event;
+ }
+
+ private:
// Returns false when Process() should never handle the |accelerator|.
bool ShouldHandle(const Accelerator& accelerator) const;
- private:
// The accelerators and associated targets.
typedef std::list<AcceleratorTarget*> AcceleratorTargetList;
// This construct pairs together a |bool| (denoting whether the list contains
@@ -83,7 +90,7 @@ class UI_EXPORT AcceleratorManager {
AcceleratorMap accelerators_;
// An event passed to Process() last time.
- EventType last_event_type_;
+ Accelerator last_event_;
DISALLOW_COPY_AND_ASSIGN(AcceleratorManager);
};
« no previous file with comments | « chrome/browser/ui/views/unhandled_keyboard_event_handler_aurax11.cc ('k') | ui/base/accelerators/accelerator_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698