void NativeWindowViews::Show() {
window_->native_widget_private()->ShowWithWindowState(GetRestoredState());
+
+#if defined(USE_X11)
+ if (global_menu_bar_)
+ global_menu_bar_->OnWindowMapped();
+#endif
}
void NativeWindowViews::ShowInactive() {
window_->ShowInactive();
+
+#if defined(USE_X11)
+ if (global_menu_bar_)
+ global_menu_bar_->OnWindowMapped();
+#endif
}
void NativeWindowViews::Hide() {
window_->Hide();
+
+#if defined(USE_X11)
+ if (global_menu_bar_)
+ global_menu_bar_->OnWindowUnmapped();
+#endif
}
bool NativeWindowViews::IsVisible() {
server_ = server_new(path.c_str());
}
+void GlobalMenuBarX11::OnWindowMapped() {
+ GlobalMenuBarRegistrarX11::GetInstance()->OnWindowMapped(xid_);
+}
+
+void GlobalMenuBarX11::OnWindowUnmapped() {
+ GlobalMenuBarRegistrarX11::GetInstance()->OnWindowUnmapped(xid_);
+}
+
void GlobalMenuBarX11::BuildMenuFromModel(ui::MenuModel* model,
DbusmenuMenuitem* parent) {
for (int i = 0; i < model->GetItemCount(); ++i) {
void SetMenu(ui::MenuModel* menu_model);
bool IsServerStarted() const;
+ // Called by NativeWindow when it show/hides.
+ void OnWindowMapped();
+ void OnWindowUnmapped();
+
private:
// Creates a DbusmenuServer.
void InitServer(gfx::AcceleratedWidget xid);