| 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 "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 // Using gtk_window_get_position/size creates a race condition, so only use | 143 // Using gtk_window_get_position/size creates a race condition, so only use |
| 144 // this to get the initial bounds. After window creation, we pick up the | 144 // this to get the initial bounds. After window creation, we pick up the |
| 145 // normal bounds by connecting to the configure-event signal. | 145 // normal bounds by connecting to the configure-event signal. |
| 146 gfx::Rect GetInitialWindowBounds(GtkWindow* window) { | 146 gfx::Rect GetInitialWindowBounds(GtkWindow* window) { |
| 147 gint x, y, width, height; | 147 gint x, y, width, height; |
| 148 gtk_window_get_position(window, &x, &y); | 148 gtk_window_get_position(window, &x, &y); |
| 149 gtk_window_get_size(window, &width, &height); | 149 gtk_window_get_size(window, &width, &height); |
| 150 return gfx::Rect(x, y, width, height); | 150 return gfx::Rect(x, y, width, height); |
| 151 } | 151 } |
| 152 | 152 |
| 153 // Keep this in sync with various context menus which display the accelerators. |
| 153 const struct AcceleratorMapping { | 154 const struct AcceleratorMapping { |
| 154 guint keyval; | 155 guint keyval; |
| 155 int command_id; | 156 int command_id; |
| 156 GdkModifierType modifier_type; | 157 GdkModifierType modifier_type; |
| 157 } kAcceleratorMap[] = { | 158 } kAcceleratorMap[] = { |
| 158 // Focus. | 159 // Focus. |
| 159 { GDK_k, IDC_FOCUS_SEARCH, GDK_CONTROL_MASK }, | 160 { GDK_k, IDC_FOCUS_SEARCH, GDK_CONTROL_MASK }, |
| 160 { GDK_e, IDC_FOCUS_SEARCH, GDK_CONTROL_MASK }, | 161 { GDK_e, IDC_FOCUS_SEARCH, GDK_CONTROL_MASK }, |
| 161 { XF86XK_Search, IDC_FOCUS_SEARCH, GdkModifierType(0) }, | 162 { XF86XK_Search, IDC_FOCUS_SEARCH, GdkModifierType(0) }, |
| 162 { GDK_l, IDC_FOCUS_LOCATION, GDK_CONTROL_MASK }, | 163 { GDK_l, IDC_FOCUS_LOCATION, GDK_CONTROL_MASK }, |
| (...skipping 1550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1713 *edge = GDK_WINDOW_EDGE_NORTH_EAST; | 1714 *edge = GDK_WINDOW_EDGE_NORTH_EAST; |
| 1714 } else if (y < bounds_.height() - kResizeAreaCornerSize) { | 1715 } else if (y < bounds_.height() - kResizeAreaCornerSize) { |
| 1715 *edge = GDK_WINDOW_EDGE_EAST; | 1716 *edge = GDK_WINDOW_EDGE_EAST; |
| 1716 } else { | 1717 } else { |
| 1717 *edge = GDK_WINDOW_EDGE_SOUTH_EAST; | 1718 *edge = GDK_WINDOW_EDGE_SOUTH_EAST; |
| 1718 } | 1719 } |
| 1719 return true; | 1720 return true; |
| 1720 } | 1721 } |
| 1721 NOTREACHED(); | 1722 NOTREACHED(); |
| 1722 } | 1723 } |
| OLD | NEW |