add toolTip property for MenuItem (#19099)

This commit is contained in:
Micha Hanselmann 2019-07-11 01:56:22 -07:00 committed by Cheng Zhao
parent 692df804cf
commit 06d48514c6
8 changed files with 41 additions and 3 deletions

View file

@ -53,6 +53,8 @@ class AtomMenuModel : public ui::SimpleMenuModel {
void AddObserver(Observer* obs) { observers_.AddObserver(obs); }
void RemoveObserver(Observer* obs) { observers_.RemoveObserver(obs); }
void SetToolTip(int index, const base::string16& toolTip);
base::string16 GetToolTipAt(int index);
void SetRole(int index, const base::string16& role);
base::string16 GetRoleAt(int index);
bool GetAcceleratorAtWithParams(int index,
@ -71,7 +73,8 @@ class AtomMenuModel : public ui::SimpleMenuModel {
private:
Delegate* delegate_; // weak ref.
std::map<int, base::string16> roles_; // command id -> role
std::map<int, base::string16> toolTips_; // command id -> tooltip
std::map<int, base::string16> roles_; // command id -> role
base::ObserverList<Observer> observers_;
DISALLOW_COPY_AND_ASSIGN(AtomMenuModel);