gtk: Enable creating menu bar.

This commit is contained in:
Cheng Zhao 2014-03-14 21:13:28 +08:00
parent 6939e325df
commit 4e4e0f5d4d
2 changed files with 6 additions and 3 deletions

View file

@ -178,11 +178,12 @@ GtkWidget* MenuGtk::Delegate::GetImageForCommandId(int command_id) const {
}
MenuGtk::MenuGtk(MenuGtk::Delegate* delegate,
ui::MenuModel* model)
ui::MenuModel* model,
bool is_menubar)
: delegate_(delegate),
model_(model),
dummy_accel_group_(gtk_accel_group_new()),
menu_(gtk_custom_menu_new()),
menu_(is_menubar ? gtk_menu_bar_new() : gtk_custom_menu_new()),
weak_factory_(this) {
DCHECK(model);
g_object_ref_sink(menu_);

View file

@ -56,7 +56,9 @@ class MenuGtk {
static GtkWidget* GetDefaultImageForLabel(const std::string& label);
};
MenuGtk(MenuGtk::Delegate* delegate, ui::MenuModel* model);
MenuGtk(MenuGtk::Delegate* delegate,
ui::MenuModel* model,
bool is_menubar = false);
virtual ~MenuGtk();
// Initialize GTK signal handlers.