| Index: ui/base/accelerators/accelerator_manager.cc
|
| diff --git a/ui/base/accelerators/accelerator_manager.cc b/ui/base/accelerators/accelerator_manager.cc
|
| index 0dc4bfc11729f26264483af9038cdd1a76b01119..5694d9a28396ffad6d9caa8ac865c85f8b6158fa 100644
|
| --- a/ui/base/accelerators/accelerator_manager.cc
|
| +++ b/ui/base/accelerators/accelerator_manager.cc
|
| @@ -75,7 +75,22 @@ void AcceleratorManager::UnregisterAll(AcceleratorTarget* target) {
|
| }
|
| }
|
|
|
| -bool AcceleratorManager::Process(const Accelerator& accelerator) {
|
| +bool AcceleratorManager::HasPriorityHandler(
|
| + const Accelerator& accelerator) const {
|
| + AcceleratorMap::const_iterator map_iter = accelerators_.find(accelerator);
|
| + if (map_iter == accelerators_.end() || map_iter->second.second.empty())
|
| + return false;
|
| +
|
| + // Check if we have a priority handler. If not, there's no more work needed.
|
| + if (!map_iter->second.first)
|
| + return false;
|
| +
|
| + // If the priority handler says it cannot handle the accelerator, we must not
|
| + // count it as one.
|
| + return map_iter->second.second.front()->CanHandleAccelerators();
|
| +}
|
| +
|
| +bool AcceleratorManager::ProcessAccelerator(const Accelerator& accelerator) {
|
| bool result = false;
|
| AcceleratorMap::iterator map_iter = accelerators_.find(accelerator);
|
| if (map_iter != accelerators_.end()) {
|
| @@ -94,7 +109,7 @@ bool AcceleratorManager::Process(const Accelerator& accelerator) {
|
| return result;
|
| }
|
|
|
| -AcceleratorTarget* AcceleratorManager::GetCurrentTarget(
|
| +AcceleratorTarget* AcceleratorManager::GetTargetForAccelerator(
|
| const Accelerator& accelerator) const {
|
| AcceleratorMap::const_iterator map_iter = accelerators_.find(accelerator);
|
| if (map_iter == accelerators_.end() || map_iter->second.second.empty())
|
| @@ -102,19 +117,4 @@ AcceleratorTarget* AcceleratorManager::GetCurrentTarget(
|
| return map_iter->second.second.front();
|
| }
|
|
|
| -bool AcceleratorManager::HasPriorityHandler(
|
| - const Accelerator& accelerator) const {
|
| - AcceleratorMap::const_iterator map_iter = accelerators_.find(accelerator);
|
| - if (map_iter == accelerators_.end() || map_iter->second.second.empty())
|
| - return false;
|
| -
|
| - // Check if we have a priority handler. If not, there's no more work needed.
|
| - if (!map_iter->second.first)
|
| - return false;
|
| -
|
| - // If the priority handler says it cannot handle the accelerator, we must not
|
| - // count it as one.
|
| - return map_iter->second.second.front()->CanHandleAccelerators();
|
| -}
|
| -
|
| } // namespace ui
|
|
|