Allow removing menu bar

This commit is contained in:
Cheng Zhao 2015-06-04 16:10:19 +08:00
parent 47e9deeb9a
commit 5d23b7468e

View file

@ -541,6 +541,19 @@ bool NativeWindowViews::IsKiosk() {
}
void NativeWindowViews::SetMenu(ui::MenuModel* menu_model) {
if (menu_model == nullptr) {
// Remove accelerators
accelerator_table_.clear();
GetFocusManager()->UnregisterAccelerators(this);
// and menu bar.
#if defined(USE_X11)
global_menu_bar_.reset();
#endif
SetMenuBarVisibility(false);
menu_bar_.reset();
return;
}
RegisterAccelerators(menu_model);
#if defined(USE_X11)