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

Side by Side Diff: ui/base/accelerators/accelerator_manager.h

Issue 1622433002: views: Remove unused GetCurrentTargetForAccelerator from FocusManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tot-merge Created 4 years, 8 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 | « chrome/chrome_tests.gypi ('k') | ui/base/accelerators/accelerator_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_BASE_ACCELERATORS_ACCELERATOR_MANAGER_H_ 5 #ifndef UI_BASE_ACCELERATORS_ACCELERATOR_MANAGER_H_
6 #define UI_BASE_ACCELERATORS_ACCELERATOR_MANAGER_H_ 6 #define UI_BASE_ACCELERATORS_ACCELERATOR_MANAGER_H_
7 7
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 #include <utility> 10 #include <utility>
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 void Register(const Accelerator& accelerator, 47 void Register(const Accelerator& accelerator,
48 HandlerPriority priority, 48 HandlerPriority priority,
49 AcceleratorTarget* target); 49 AcceleratorTarget* target);
50 50
51 // Unregister the specified keyboard accelerator for the specified target. 51 // Unregister the specified keyboard accelerator for the specified target.
52 void Unregister(const Accelerator& accelerator, AcceleratorTarget* target); 52 void Unregister(const Accelerator& accelerator, AcceleratorTarget* target);
53 53
54 // Unregister all keyboard accelerator for the specified target. 54 // Unregister all keyboard accelerator for the specified target.
55 void UnregisterAll(AcceleratorTarget* target); 55 void UnregisterAll(AcceleratorTarget* target);
56 56
57 // Returns whether |accelerator| is already registered.
58 bool IsRegistered(const Accelerator& accelerator) const;
59
57 // Activate the target associated with the specified accelerator. 60 // Activate the target associated with the specified accelerator.
58 // First, AcceleratorPressed handler of the most recently registered target 61 // First, AcceleratorPressed handler of the most recently registered target
59 // is called, and if that handler processes the event (i.e. returns true), 62 // is called, and if that handler processes the event (i.e. returns true),
60 // this method immediately returns. If not, we do the same thing on the next 63 // this method immediately returns. If not, we do the same thing on the next
61 // target, and so on. 64 // target, and so on.
62 // Returns true if an accelerator was activated. 65 // Returns true if an accelerator was activated.
63 bool Process(const Accelerator& accelerator); 66 bool Process(const Accelerator& accelerator);
64 67
65 // Returns the AcceleratorTarget that should be activated for the specified
66 // keyboard accelerator, or NULL if no view is registered for that keyboard
67 // accelerator.
68 AcceleratorTarget* GetCurrentTarget(const Accelerator& accelerator) const;
69
70 // Whether the given |accelerator| has a priority handler associated with it. 68 // Whether the given |accelerator| has a priority handler associated with it.
71 bool HasPriorityHandler(const Accelerator& accelerator) const; 69 bool HasPriorityHandler(const Accelerator& accelerator) const;
72 70
73 private: 71 private:
74 // The accelerators and associated targets. 72 // The accelerators and associated targets.
75 typedef std::list<AcceleratorTarget*> AcceleratorTargetList; 73 typedef std::list<AcceleratorTarget*> AcceleratorTargetList;
76 // This construct pairs together a |bool| (denoting whether the list contains 74 // This construct pairs together a |bool| (denoting whether the list contains
77 // a priority_handler at the front) with the list of AcceleratorTargets. 75 // a priority_handler at the front) with the list of AcceleratorTargets.
78 typedef std::pair<bool, AcceleratorTargetList> AcceleratorTargets; 76 typedef std::pair<bool, AcceleratorTargetList> AcceleratorTargets;
79 typedef std::map<Accelerator, AcceleratorTargets> AcceleratorMap; 77 typedef std::map<Accelerator, AcceleratorTargets> AcceleratorMap;
80 AcceleratorMap accelerators_; 78 AcceleratorMap accelerators_;
81 79
82 DISALLOW_COPY_AND_ASSIGN(AcceleratorManager); 80 DISALLOW_COPY_AND_ASSIGN(AcceleratorManager);
83 }; 81 };
84 82
85 } // namespace ui 83 } // namespace ui
86 84
87 #endif // UI_BASE_ACCELERATORS_ACCELERATOR_MANAGER_H_ 85 #endif // UI_BASE_ACCELERATORS_ACCELERATOR_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | ui/base/accelerators/accelerator_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698