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 1582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1593 g_signal_connect(window_, "button-press-event", | 1593 g_signal_connect(window_, "button-press-event", |
1594 G_CALLBACK(OnButtonPressEvent), this); | 1594 G_CALLBACK(OnButtonPressEvent), this); |
1595 g_signal_connect(window_, "focus-in-event", | 1595 g_signal_connect(window_, "focus-in-event", |
1596 G_CALLBACK(OnFocusIn), this); | 1596 G_CALLBACK(OnFocusIn), this); |
1597 g_signal_connect(window_, "focus-out-event", | 1597 g_signal_connect(window_, "focus-out-event", |
1598 G_CALLBACK(OnFocusOut), this); | 1598 G_CALLBACK(OnFocusOut), this); |
1599 } | 1599 } |
1600 | 1600 |
1601 void BrowserWindowGtk::InitWidgets() { | 1601 void BrowserWindowGtk::InitWidgets() { |
1602 ConnectHandlersToSignals(); | 1602 ConnectHandlersToSignals(); |
1603 bounds_ = GetInitialWindowBounds(window_); | 1603 bounds_ = restored_bounds_ = GetInitialWindowBounds(window_); |
1604 | 1604 |
1605 // This vbox encompasses all of the widgets within the browser. This is | 1605 // This vbox encompasses all of the widgets within the browser. This is |
1606 // everything except the custom frame border. | 1606 // everything except the custom frame border. |
1607 window_vbox_ = gtk_vbox_new(FALSE, 0); | 1607 window_vbox_ = gtk_vbox_new(FALSE, 0); |
1608 gtk_widget_show(window_vbox_); | 1608 gtk_widget_show(window_vbox_); |
1609 | 1609 |
1610 // The window container draws the custom browser frame. | 1610 // The window container draws the custom browser frame. |
1611 window_container_ = gtk_alignment_new(0.0, 0.0, 1.0, 1.0); | 1611 window_container_ = gtk_alignment_new(0.0, 0.0, 1.0, 1.0); |
1612 gtk_widget_set_name(window_container_, "chrome-custom-frame-border"); | 1612 gtk_widget_set_name(window_container_, "chrome-custom-frame-border"); |
1613 gtk_widget_set_app_paintable(window_container_, TRUE); | 1613 gtk_widget_set_app_paintable(window_container_, TRUE); |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1945 window_preferences->SetInteger(L"work_area_bottom", work_area.bottom()); | 1945 window_preferences->SetInteger(L"work_area_bottom", work_area.bottom()); |
1946 } | 1946 } |
1947 | 1947 |
1948 // static | 1948 // static |
1949 gboolean BrowserWindowGtk::OnGtkAccelerator(GtkAccelGroup* accel_group, | 1949 gboolean BrowserWindowGtk::OnGtkAccelerator(GtkAccelGroup* accel_group, |
1950 GObject* acceleratable, | 1950 GObject* acceleratable, |
1951 guint keyval, | 1951 guint keyval, |
1952 GdkModifierType modifier, | 1952 GdkModifierType modifier, |
1953 BrowserWindowGtk* browser_window) { | 1953 BrowserWindowGtk* browser_window) { |
1954 int command_id = ::GetCommandId(keyval, modifier); | 1954 int command_id = ::GetCommandId(keyval, modifier); |
1955 DCHECK(command_id != -1); | 1955 DCHECK_NE(command_id, -1); |
1956 browser_window->ExecuteBrowserCommand(command_id); | 1956 browser_window->ExecuteBrowserCommand(command_id); |
1957 | 1957 |
1958 return TRUE; | 1958 return TRUE; |
1959 } | 1959 } |
1960 | 1960 |
1961 // static | 1961 // static |
1962 gboolean BrowserWindowGtk::OnMouseMoveEvent(GtkWidget* widget, | 1962 gboolean BrowserWindowGtk::OnMouseMoveEvent(GtkWidget* widget, |
1963 GdkEventMotion* event, BrowserWindowGtk* browser) { | 1963 GdkEventMotion* event, BrowserWindowGtk* browser) { |
1964 // This method is used to update the mouse cursor when over the edge of the | 1964 // This method is used to update the mouse cursor when over the edge of the |
1965 // custom frame. If the custom frame is off or we're over some other widget, | 1965 // custom frame. If the custom frame is off or we're over some other widget, |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2315 // are taken from the WMs' source code. | 2315 // are taken from the WMs' source code. |
2316 return (wm_name == "Blackbox" || | 2316 return (wm_name == "Blackbox" || |
2317 wm_name == "compiz" || | 2317 wm_name == "compiz" || |
2318 wm_name == "e16" || // Enlightenment DR16 | 2318 wm_name == "e16" || // Enlightenment DR16 |
2319 wm_name == "KWin" || | 2319 wm_name == "KWin" || |
2320 wm_name == "Metacity" || | 2320 wm_name == "Metacity" || |
2321 wm_name == "Mutter" || | 2321 wm_name == "Mutter" || |
2322 wm_name == "Openbox" || | 2322 wm_name == "Openbox" || |
2323 wm_name == "Xfwm4"); | 2323 wm_name == "Xfwm4"); |
2324 } | 2324 } |
OLD | NEW |