Merge pull request #7962 from liusy182/disable-accelerator

disable accelerator when menu item is disabled
This commit is contained in:
Kevin Sawicki 2016-11-15 11:05:36 -08:00 committed by GitHub
commit 301b8ec39a

View file

@ -90,11 +90,12 @@ bool TriggerAcceleratorTableCommand(AcceleratorTable* table,
const ui::Accelerator& accelerator) {
if (ContainsKey(*table, accelerator)) {
const accelerator_util::MenuItem& item = (*table)[accelerator];
item.model->ActivatedAt(item.position);
return true;
} else {
return false;
if (item.model->IsEnabledAt(item.position)) {
item.model->ActivatedAt(item.position);
return true;
}
}
return false;
}
} // namespace accelerator_util