| OLD | NEW |
| 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 <dlfcn.h> | 9 #include <dlfcn.h> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1600 | 1600 |
| 1601 // This vbox encompasses all of the widgets within the browser. This is | 1601 // This vbox encompasses all of the widgets within the browser. This is |
| 1602 // everything except the custom frame border. | 1602 // everything except the custom frame border. |
| 1603 window_vbox_ = gtk_vbox_new(FALSE, 0); | 1603 window_vbox_ = gtk_vbox_new(FALSE, 0); |
| 1604 gtk_widget_show(window_vbox_); | 1604 gtk_widget_show(window_vbox_); |
| 1605 | 1605 |
| 1606 // We hold an always hidden GtkMenuBar inside our browser window simply to | 1606 // We hold an always hidden GtkMenuBar inside our browser window simply to |
| 1607 // fool the Unity desktop, which will mirror the contents of the first | 1607 // fool the Unity desktop, which will mirror the contents of the first |
| 1608 // GtkMenuBar it sees into the global menu bar. (It doesn't seem to check the | 1608 // GtkMenuBar it sees into the global menu bar. (It doesn't seem to check the |
| 1609 // visibility of the GtkMenuBar, so we can just permanently hide it.) | 1609 // visibility of the GtkMenuBar, so we can just permanently hide it.) |
| 1610 global_menu_bar_.reset(new GlobalMenuBar(browser_.get())); | 1610 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGlobalGnomeMenu)) { |
| 1611 gtk_container_add(GTK_CONTAINER(window_vbox_), global_menu_bar_->widget()); | 1611 global_menu_bar_.reset(new GlobalMenuBar(browser_.get())); |
| 1612 gtk_container_add(GTK_CONTAINER(window_vbox_), global_menu_bar_->widget()); |
| 1613 } |
| 1612 | 1614 |
| 1613 // The window container draws the custom browser frame. | 1615 // The window container draws the custom browser frame. |
| 1614 window_container_ = gtk_alignment_new(0.0, 0.0, 1.0, 1.0); | 1616 window_container_ = gtk_alignment_new(0.0, 0.0, 1.0, 1.0); |
| 1615 gtk_widget_set_name(window_container_, "chrome-custom-frame-border"); | 1617 gtk_widget_set_name(window_container_, "chrome-custom-frame-border"); |
| 1616 gtk_widget_set_app_paintable(window_container_, TRUE); | 1618 gtk_widget_set_app_paintable(window_container_, TRUE); |
| 1617 gtk_widget_set_double_buffered(window_container_, FALSE); | 1619 gtk_widget_set_double_buffered(window_container_, FALSE); |
| 1618 gtk_widget_set_redraw_on_allocate(window_container_, TRUE); | 1620 gtk_widget_set_redraw_on_allocate(window_container_, TRUE); |
| 1619 g_signal_connect(window_container_, "expose-event", | 1621 g_signal_connect(window_container_, "expose-event", |
| 1620 G_CALLBACK(OnCustomFrameExposeThunk), this); | 1622 G_CALLBACK(OnCustomFrameExposeThunk), this); |
| 1621 gtk_container_add(GTK_CONTAINER(window_container_), window_vbox_); | 1623 gtk_container_add(GTK_CONTAINER(window_container_), window_vbox_); |
| (...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2367 // are taken from the WMs' source code. | 2369 // are taken from the WMs' source code. |
| 2368 return (wm_name == "Blackbox" || | 2370 return (wm_name == "Blackbox" || |
| 2369 wm_name == "compiz" || | 2371 wm_name == "compiz" || |
| 2370 wm_name == "Compiz" || | 2372 wm_name == "Compiz" || |
| 2371 wm_name == "e16" || // Enlightenment DR16 | 2373 wm_name == "e16" || // Enlightenment DR16 |
| 2372 wm_name == "Metacity" || | 2374 wm_name == "Metacity" || |
| 2373 wm_name == "Mutter" || | 2375 wm_name == "Mutter" || |
| 2374 wm_name == "Openbox" || | 2376 wm_name == "Openbox" || |
| 2375 wm_name == "Xfwm4"); | 2377 wm_name == "Xfwm4"); |
| 2376 } | 2378 } |
| OLD | NEW |