Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5019)

Unified Diff: chrome/browser/ui/gtk/browser_window_gtk.cc

Issue 6812037: GTK: A first *very* rough cut at a global menu. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comment Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/gtk/browser_window_gtk.cc
diff --git a/chrome/browser/ui/gtk/browser_window_gtk.cc b/chrome/browser/ui/gtk/browser_window_gtk.cc
index 17af4fd1da1856a6c84315836aa6cf6d8dcde697..8365b0fcc58d93ee8b02363ff6e982107d4a3381 100644
--- a/chrome/browser/ui/gtk/browser_window_gtk.cc
+++ b/chrome/browser/ui/gtk/browser_window_gtk.cc
@@ -51,6 +51,7 @@
#include "chrome/browser/ui/gtk/edit_search_engine_dialog.h"
#include "chrome/browser/ui/gtk/find_bar_gtk.h"
#include "chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.h"
+#include "chrome/browser/ui/gtk/global_menu_bar.h"
#include "chrome/browser/ui/gtk/gtk_floating_container.h"
#include "chrome/browser/ui/gtk/gtk_theme_service.h"
#include "chrome/browser/ui/gtk/gtk_util.h"
@@ -1543,6 +1544,13 @@ void BrowserWindowGtk::InitWidgets() {
window_vbox_ = gtk_vbox_new(FALSE, 0);
gtk_widget_show(window_vbox_);
+ // We hold an always hiddent GtkMenuBar inside our browser window simply to
Evan Stade 2011/04/11 19:01:35 hidden
+ // fool the Unity desktop, which will mirror the contents of the first
+ // GtkMenuBar it sees into the global menu bar. (It doesn't seem to check the
+ // visibility of the GtkMenuBar, so we can just permanently hide it.)
+ global_menu_bar_.reset(new GlobalMenuBar(browser_.get(), this));
Evan Stade 2011/04/11 19:01:35 should this be disabled for some browser windows,
Elliot Glaysher 2011/04/11 23:18:52 Those windows would then lack menubars.
Evan Stade 2011/04/11 23:41:34 well, we don't show the wrench menu for popup wind
+ gtk_container_add(GTK_CONTAINER(window_vbox_), global_menu_bar_->widget());
+
// The window container draws the custom browser frame.
window_container_ = gtk_alignment_new(0.0, 0.0, 1.0, 1.0);
gtk_widget_set_name(window_container_, "chrome-custom-frame-border");

Powered by Google App Engine
This is Rietveld 408576698