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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/gtk/browser_window_gtk.h" 5 #include "chrome/browser/ui/gtk/browser_window_gtk.h"
6 6
7 #include <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "chrome/browser/ui/gtk/browser_titlebar.h" 44 #include "chrome/browser/ui/gtk/browser_titlebar.h"
45 #include "chrome/browser/ui/gtk/browser_toolbar_gtk.h" 45 #include "chrome/browser/ui/gtk/browser_toolbar_gtk.h"
46 #include "chrome/browser/ui/gtk/cairo_cached_surface.h" 46 #include "chrome/browser/ui/gtk/cairo_cached_surface.h"
47 #include "chrome/browser/ui/gtk/collected_cookies_gtk.h" 47 #include "chrome/browser/ui/gtk/collected_cookies_gtk.h"
48 #include "chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.h" 48 #include "chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.h"
49 #include "chrome/browser/ui/gtk/download_in_progress_dialog_gtk.h" 49 #include "chrome/browser/ui/gtk/download_in_progress_dialog_gtk.h"
50 #include "chrome/browser/ui/gtk/download_shelf_gtk.h" 50 #include "chrome/browser/ui/gtk/download_shelf_gtk.h"
51 #include "chrome/browser/ui/gtk/edit_search_engine_dialog.h" 51 #include "chrome/browser/ui/gtk/edit_search_engine_dialog.h"
52 #include "chrome/browser/ui/gtk/find_bar_gtk.h" 52 #include "chrome/browser/ui/gtk/find_bar_gtk.h"
53 #include "chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.h" 53 #include "chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.h"
54 #include "chrome/browser/ui/gtk/global_menu_bar.h"
54 #include "chrome/browser/ui/gtk/gtk_floating_container.h" 55 #include "chrome/browser/ui/gtk/gtk_floating_container.h"
55 #include "chrome/browser/ui/gtk/gtk_theme_service.h" 56 #include "chrome/browser/ui/gtk/gtk_theme_service.h"
56 #include "chrome/browser/ui/gtk/gtk_util.h" 57 #include "chrome/browser/ui/gtk/gtk_util.h"
57 #include "chrome/browser/ui/gtk/info_bubble_gtk.h" 58 #include "chrome/browser/ui/gtk/info_bubble_gtk.h"
58 #include "chrome/browser/ui/gtk/infobars/infobar_container_gtk.h" 59 #include "chrome/browser/ui/gtk/infobars/infobar_container_gtk.h"
59 #include "chrome/browser/ui/gtk/infobars/infobar_gtk.h" 60 #include "chrome/browser/ui/gtk/infobars/infobar_gtk.h"
60 #include "chrome/browser/ui/gtk/location_bar_view_gtk.h" 61 #include "chrome/browser/ui/gtk/location_bar_view_gtk.h"
61 #include "chrome/browser/ui/gtk/nine_box.h" 62 #include "chrome/browser/ui/gtk/nine_box.h"
62 #include "chrome/browser/ui/gtk/reload_button_gtk.h" 63 #include "chrome/browser/ui/gtk/reload_button_gtk.h"
63 #include "chrome/browser/ui/gtk/repost_form_warning_gtk.h" 64 #include "chrome/browser/ui/gtk/repost_form_warning_gtk.h"
(...skipping 1472 matching lines...) Expand 10 before | Expand all | Expand 10 after
1536 1537
1537 void BrowserWindowGtk::InitWidgets() { 1538 void BrowserWindowGtk::InitWidgets() {
1538 ConnectHandlersToSignals(); 1539 ConnectHandlersToSignals();
1539 bounds_ = restored_bounds_ = GetInitialWindowBounds(window_); 1540 bounds_ = restored_bounds_ = GetInitialWindowBounds(window_);
1540 1541
1541 // This vbox encompasses all of the widgets within the browser. This is 1542 // This vbox encompasses all of the widgets within the browser. This is
1542 // everything except the custom frame border. 1543 // everything except the custom frame border.
1543 window_vbox_ = gtk_vbox_new(FALSE, 0); 1544 window_vbox_ = gtk_vbox_new(FALSE, 0);
1544 gtk_widget_show(window_vbox_); 1545 gtk_widget_show(window_vbox_);
1545 1546
1547 // We hold an always hiddent GtkMenuBar inside our browser window simply to
Evan Stade 2011/04/11 19:01:35 hidden
1548 // fool the Unity desktop, which will mirror the contents of the first
1549 // GtkMenuBar it sees into the global menu bar. (It doesn't seem to check the
1550 // visibility of the GtkMenuBar, so we can just permanently hide it.)
1551 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
1552 gtk_container_add(GTK_CONTAINER(window_vbox_), global_menu_bar_->widget());
1553
1546 // The window container draws the custom browser frame. 1554 // The window container draws the custom browser frame.
1547 window_container_ = gtk_alignment_new(0.0, 0.0, 1.0, 1.0); 1555 window_container_ = gtk_alignment_new(0.0, 0.0, 1.0, 1.0);
1548 gtk_widget_set_name(window_container_, "chrome-custom-frame-border"); 1556 gtk_widget_set_name(window_container_, "chrome-custom-frame-border");
1549 gtk_widget_set_app_paintable(window_container_, TRUE); 1557 gtk_widget_set_app_paintable(window_container_, TRUE);
1550 gtk_widget_set_double_buffered(window_container_, FALSE); 1558 gtk_widget_set_double_buffered(window_container_, FALSE);
1551 gtk_widget_set_redraw_on_allocate(window_container_, TRUE); 1559 gtk_widget_set_redraw_on_allocate(window_container_, TRUE);
1552 g_signal_connect(window_container_, "expose-event", 1560 g_signal_connect(window_container_, "expose-event",
1553 G_CALLBACK(OnCustomFrameExposeThunk), this); 1561 G_CALLBACK(OnCustomFrameExposeThunk), this);
1554 gtk_container_add(GTK_CONTAINER(window_container_), window_vbox_); 1562 gtk_container_add(GTK_CONTAINER(window_container_), window_vbox_);
1555 1563
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
2292 // special-case the ones where the custom frame should be used. These names 2300 // special-case the ones where the custom frame should be used. These names
2293 // are taken from the WMs' source code. 2301 // are taken from the WMs' source code.
2294 return (wm_name == "Blackbox" || 2302 return (wm_name == "Blackbox" ||
2295 wm_name == "compiz" || 2303 wm_name == "compiz" ||
2296 wm_name == "e16" || // Enlightenment DR16 2304 wm_name == "e16" || // Enlightenment DR16
2297 wm_name == "Metacity" || 2305 wm_name == "Metacity" ||
2298 wm_name == "Mutter" || 2306 wm_name == "Mutter" ||
2299 wm_name == "Openbox" || 2307 wm_name == "Openbox" ||
2300 wm_name == "Xfwm4"); 2308 wm_name == "Xfwm4");
2301 } 2309 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698