Map roles by command id
This commit is contained in:
parent
59ff3dc2f3
commit
583cc925ac
1 changed files with 5 additions and 3 deletions
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue