Map roles by command id

This commit is contained in:
Kevin Sawicki 2016-06-21 15:25:14 -07:00
parent 59ff3dc2f3
commit 583cc925ac

View file

@ -17,12 +17,14 @@ AtomMenuModel::~AtomMenuModel() {
} }
void AtomMenuModel::SetRole(int index, const base::string16& role) { void AtomMenuModel::SetRole(int index, const base::string16& role) {
roles_[index] = role; int command_id = GetCommandIdAt(index);
roles_[command_id] = role;
} }
base::string16 AtomMenuModel::GetRoleAt(int index) { base::string16 AtomMenuModel::GetRoleAt(int index) {
if (ContainsKey(roles_, index)) int command_id = GetCommandIdAt(index);
return roles_[index]; if (ContainsKey(roles_, command_id))
return roles_[command_id];
else else
return base::string16(); return base::string16();
} }