Radio menu items should have at least one item checked.

This is to force all platforms to match the same behavior in GTK+.
This commit is contained in:
Cheng Zhao 2014-05-25 15:25:36 +08:00
parent 3921895dd5
commit 6a48568911
5 changed files with 28 additions and 5 deletions

View file

@ -135,6 +135,12 @@ void Menu::ExecuteCommand(int command_id, int event_flags) {
command_id);
}
void Menu::MenuWillShow(ui::SimpleMenuModel* source) {
v8::Locker locker(node_isolate);
v8::HandleScope handle_scope(node_isolate);
CallDelegate(v8::False(), GetWrapper(node_isolate), "menuWillShow", -1);
}
void Menu::InsertItemAt(
int index, int command_id, const base::string16& label) {
model_->InsertItemAt(index, command_id, label);
@ -226,7 +232,7 @@ void Menu::BuildPrototype(v8::Isolate* isolate,
#if defined(OS_WIN) || defined(TOOLKIT_GTK)
.SetMethod("attachToWindow", &Menu::AttachToWindow)
#endif
.SetMethod("popup", &Menu::Popup);
.SetMethod("_popup", &Menu::Popup);
}
} // namespace api