| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/gtk/browser_window_gtk.h" | 5 #include "chrome/browser/gtk/browser_window_gtk.h" |
| 6 | 6 |
| 7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
| 8 #include <X11/XF86keysym.h> | 8 #include <X11/XF86keysym.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 // properly. For other windows, we set the geometry first to prevent resize | 589 // properly. For other windows, we set the geometry first to prevent resize |
| 590 // flicker. | 590 // flicker. |
| 591 if (browser_->type() & Browser::TYPE_POPUP) { | 591 if (browser_->type() & Browser::TYPE_POPUP) { |
| 592 InitWidgets(); | 592 InitWidgets(); |
| 593 SetGeometryHints(); | 593 SetGeometryHints(); |
| 594 } else { | 594 } else { |
| 595 SetGeometryHints(); | 595 SetGeometryHints(); |
| 596 InitWidgets(); | 596 InitWidgets(); |
| 597 } | 597 } |
| 598 | 598 |
| 599 ConnectHandlersToSignals(); | |
| 600 ConnectAccelerators(); | 599 ConnectAccelerators(); |
| 601 | 600 |
| 602 // Set the initial background color of widgets. | 601 // Set the initial background color of widgets. |
| 603 SetBackgroundColor(); | 602 SetBackgroundColor(); |
| 604 HideUnsupportedWindowFeatures(); | 603 HideUnsupportedWindowFeatures(); |
| 605 | 604 |
| 606 registrar_.Add(this, NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED, | 605 registrar_.Add(this, NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED, |
| 607 NotificationService::AllSources()); | 606 NotificationService::AllSources()); |
| 608 registrar_.Add(this, NotificationType::ACTIVE_WINDOW_CHANGED, | 607 registrar_.Add(this, NotificationType::ACTIVE_WINDOW_CHANGED, |
| 609 NotificationService::AllSources()); | 608 NotificationService::AllSources()); |
| (...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1518 G_CALLBACK(OnMouseMoveEvent), this); | 1517 G_CALLBACK(OnMouseMoveEvent), this); |
| 1519 g_signal_connect(window_, "button-press-event", | 1518 g_signal_connect(window_, "button-press-event", |
| 1520 G_CALLBACK(OnButtonPressEvent), this); | 1519 G_CALLBACK(OnButtonPressEvent), this); |
| 1521 g_signal_connect(window_, "focus-in-event", | 1520 g_signal_connect(window_, "focus-in-event", |
| 1522 G_CALLBACK(OnFocusIn), this); | 1521 G_CALLBACK(OnFocusIn), this); |
| 1523 g_signal_connect(window_, "focus-out-event", | 1522 g_signal_connect(window_, "focus-out-event", |
| 1524 G_CALLBACK(OnFocusOut), this); | 1523 G_CALLBACK(OnFocusOut), this); |
| 1525 } | 1524 } |
| 1526 | 1525 |
| 1527 void BrowserWindowGtk::InitWidgets() { | 1526 void BrowserWindowGtk::InitWidgets() { |
| 1527 ConnectHandlersToSignals(); |
| 1528 bounds_ = GetInitialWindowBounds(window_); | 1528 bounds_ = GetInitialWindowBounds(window_); |
| 1529 | 1529 |
| 1530 // This vbox encompasses all of the widgets within the browser, including the | 1530 // This vbox encompasses all of the widgets within the browser, including the |
| 1531 // tabstrip and the content vbox. The vbox is put in a floating container | 1531 // tabstrip and the content vbox. The vbox is put in a floating container |
| 1532 // (see gtk_floating_container.h) so we can position the | 1532 // (see gtk_floating_container.h) so we can position the |
| 1533 // minimize/maximize/close buttons. The floating container is then put in an | 1533 // minimize/maximize/close buttons. The floating container is then put in an |
| 1534 // alignment so we can do custom frame drawing if the user turns of window | 1534 // alignment so we can do custom frame drawing if the user turns of window |
| 1535 // manager decorations. | 1535 // manager decorations. |
| 1536 GtkWidget* window_vbox = gtk_vbox_new(FALSE, 0); | 1536 GtkWidget* window_vbox = gtk_vbox_new(FALSE, 0); |
| 1537 gtk_widget_show(window_vbox); | 1537 gtk_widget_show(window_vbox); |
| (...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2199 // special-case the ones where the custom frame should be used. These names | 2199 // special-case the ones where the custom frame should be used. These names |
| 2200 // are taken from the WMs' source code. | 2200 // are taken from the WMs' source code. |
| 2201 return (wm_name == "Blackbox" || | 2201 return (wm_name == "Blackbox" || |
| 2202 wm_name == "compiz" || | 2202 wm_name == "compiz" || |
| 2203 wm_name == "e16" || // Enlightenment DR16 | 2203 wm_name == "e16" || // Enlightenment DR16 |
| 2204 wm_name == "KWin" || | 2204 wm_name == "KWin" || |
| 2205 wm_name == "Metacity" || | 2205 wm_name == "Metacity" || |
| 2206 wm_name == "Openbox" || | 2206 wm_name == "Openbox" || |
| 2207 wm_name == "Xfwm4"); | 2207 wm_name == "Xfwm4"); |
| 2208 } | 2208 } |
| OLD | NEW |