| 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 1576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1587 // This vbox encompasses all of the widgets within the browser. This is | 1587 // This vbox encompasses all of the widgets within the browser. This is |
| 1588 // everything except the custom frame border. | 1588 // everything except the custom frame border. |
| 1589 window_vbox_ = gtk_vbox_new(FALSE, 0); | 1589 window_vbox_ = gtk_vbox_new(FALSE, 0); |
| 1590 gtk_widget_show(window_vbox_); | 1590 gtk_widget_show(window_vbox_); |
| 1591 | 1591 |
| 1592 // We hold an always hidden GtkMenuBar inside our browser window simply to | 1592 // We hold an always hidden GtkMenuBar inside our browser window simply to |
| 1593 // fool the Unity desktop, which will mirror the contents of the first | 1593 // fool the Unity desktop, which will mirror the contents of the first |
| 1594 // GtkMenuBar it sees into the global menu bar. (It doesn't seem to check the | 1594 // GtkMenuBar it sees into the global menu bar. (It doesn't seem to check the |
| 1595 // visibility of the GtkMenuBar, so we can just permanently hide it.) | 1595 // visibility of the GtkMenuBar, so we can just permanently hide it.) |
| 1596 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGlobalGnomeMenu)) { | 1596 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGlobalGnomeMenu)) { |
| 1597 global_menu_bar_.reset(new GlobalMenuBar(browser_.get(), this)); | 1597 global_menu_bar_.reset(new GlobalMenuBar(browser_.get())); |
| 1598 gtk_container_add(GTK_CONTAINER(window_vbox_), global_menu_bar_->widget()); | 1598 gtk_container_add(GTK_CONTAINER(window_vbox_), global_menu_bar_->widget()); |
| 1599 } | 1599 } |
| 1600 | 1600 |
| 1601 // The window container draws the custom browser frame. | 1601 // The window container draws the custom browser frame. |
| 1602 window_container_ = gtk_alignment_new(0.0, 0.0, 1.0, 1.0); | 1602 window_container_ = gtk_alignment_new(0.0, 0.0, 1.0, 1.0); |
| 1603 gtk_widget_set_name(window_container_, "chrome-custom-frame-border"); | 1603 gtk_widget_set_name(window_container_, "chrome-custom-frame-border"); |
| 1604 gtk_widget_set_app_paintable(window_container_, TRUE); | 1604 gtk_widget_set_app_paintable(window_container_, TRUE); |
| 1605 gtk_widget_set_double_buffered(window_container_, FALSE); | 1605 gtk_widget_set_double_buffered(window_container_, FALSE); |
| 1606 gtk_widget_set_redraw_on_allocate(window_container_, TRUE); | 1606 gtk_widget_set_redraw_on_allocate(window_container_, TRUE); |
| 1607 g_signal_connect(window_container_, "expose-event", | 1607 g_signal_connect(window_container_, "expose-event", |
| (...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2347 // special-case the ones where the custom frame should be used. These names | 2347 // special-case the ones where the custom frame should be used. These names |
| 2348 // are taken from the WMs' source code. | 2348 // are taken from the WMs' source code. |
| 2349 return (wm_name == "Blackbox" || | 2349 return (wm_name == "Blackbox" || |
| 2350 wm_name == "compiz" || | 2350 wm_name == "compiz" || |
| 2351 wm_name == "e16" || // Enlightenment DR16 | 2351 wm_name == "e16" || // Enlightenment DR16 |
| 2352 wm_name == "Metacity" || | 2352 wm_name == "Metacity" || |
| 2353 wm_name == "Mutter" || | 2353 wm_name == "Mutter" || |
| 2354 wm_name == "Openbox" || | 2354 wm_name == "Openbox" || |
| 2355 wm_name == "Xfwm4"); | 2355 wm_name == "Xfwm4"); |
| 2356 } | 2356 } |
| OLD | NEW |