win: Update states when setting checked property.

This commit is contained in:
Cheng Zhao 2014-05-26 11:34:36 +08:00
parent 6ee437e9bf
commit dfa1ae1c20
8 changed files with 50 additions and 9 deletions

View file

@ -44,7 +44,9 @@ v8::Handle<v8::Value> CallDelegate(v8::Handle<v8::Value> default_value,
} // namespace
Menu::Menu() : model_(new ui::SimpleMenuModel(this)) {
Menu::Menu()
: model_(new ui::SimpleMenuModel(this)),
parent_(NULL) {
}
Menu::~Menu() {
@ -167,6 +169,7 @@ void Menu::InsertSubMenuAt(int index,
int command_id,
const base::string16& label,
Menu* menu) {
menu->parent_ = this;
model_->InsertSubMenuAt(index, command_id, label, menu->model_.get());
}
@ -231,6 +234,9 @@ void Menu::BuildPrototype(v8::Isolate* isolate,
.SetMethod("isVisibleAt", &Menu::IsVisibleAt)
#if defined(OS_WIN) || defined(TOOLKIT_GTK)
.SetMethod("_attachToWindow", &Menu::AttachToWindow)
#endif
#if defined(OS_WIN)
.SetMethod("_updateStates", &Menu::UpdateStates)
#endif
.SetMethod("_popup", &Menu::Popup);
}