OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "app/gtk_util.h" | 11 #include "app/gtk_util.h" |
12 #include "app/keyboard_codes.h" | |
13 #include "app/l10n_util.h" | 12 #include "app/l10n_util.h" |
14 #include "base/base_paths.h" | 13 #include "base/base_paths.h" |
15 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "base/keyboard_codes.h" |
16 #include "base/logging.h" | 16 #include "base/logging.h" |
17 #include "base/message_loop.h" | 17 #include "base/message_loop.h" |
18 #include "base/path_service.h" | 18 #include "base/path_service.h" |
19 #include "base/scoped_ptr.h" | 19 #include "base/scoped_ptr.h" |
20 #include "base/singleton.h" | 20 #include "base/singleton.h" |
21 #include "base/string_util.h" | 21 #include "base/string_util.h" |
22 #include "base/time.h" | 22 #include "base/time.h" |
23 #include "base/utf_string_conversions.h" | 23 #include "base/utf_string_conversions.h" |
24 #include "chrome/app/chrome_dll_resource.h" | 24 #include "chrome/app/chrome_dll_resource.h" |
25 #include "chrome/browser/app_modal_dialog_queue.h" | 25 #include "chrome/browser/app_modal_dialog_queue.h" |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 bool ShouldExecuteReservedCommandImmediately( | 292 bool ShouldExecuteReservedCommandImmediately( |
293 const NativeWebKeyboardEvent& event, int command_id) { | 293 const NativeWebKeyboardEvent& event, int command_id) { |
294 // IDC_EXIT is now only bound to Ctrl+Shift+q, so we should always execute it | 294 // IDC_EXIT is now only bound to Ctrl+Shift+q, so we should always execute it |
295 // immediately. | 295 // immediately. |
296 if (command_id == IDC_EXIT) | 296 if (command_id == IDC_EXIT) |
297 return true; | 297 return true; |
298 | 298 |
299 // Keys like Ctrl+w, Ctrl+n, etc. should always be sent to the renderer first, | 299 // Keys like Ctrl+w, Ctrl+n, etc. should always be sent to the renderer first, |
300 // otherwise some web apps or the Emacs key bindings may not work correctly. | 300 // otherwise some web apps or the Emacs key bindings may not work correctly. |
301 int vkey = event.windowsKeyCode; | 301 int vkey = event.windowsKeyCode; |
302 if ((vkey >= app::VKEY_0 && vkey <= app::VKEY_9) || | 302 if ((vkey >= base::VKEY_0 && vkey <= base::VKEY_9) || |
303 (vkey >= app::VKEY_A && vkey <= app::VKEY_Z)) | 303 (vkey >= base::VKEY_A && vkey <= base::VKEY_Z)) |
304 return false; | 304 return false; |
305 | 305 |
306 // All other reserved accelerators should be processed immediately. | 306 // All other reserved accelerators should be processed immediately. |
307 return true; | 307 return true; |
308 } | 308 } |
309 | 309 |
310 // Performs Cut/Copy/Paste operation on the |window|. | 310 // Performs Cut/Copy/Paste operation on the |window|. |
311 // If the current render view is focused, then just call the specified |method| | 311 // If the current render view is focused, then just call the specified |method| |
312 // against the current render view host, otherwise emit the specified |signal| | 312 // against the current render view host, otherwise emit the specified |signal| |
313 // against the focused widget. | 313 // against the focused widget. |
(...skipping 1855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2169 // special-case the ones where the custom frame should be used. These names | 2169 // special-case the ones where the custom frame should be used. These names |
2170 // are taken from the WMs' source code. | 2170 // are taken from the WMs' source code. |
2171 return (wm_name == "Blackbox" || | 2171 return (wm_name == "Blackbox" || |
2172 wm_name == "compiz" || | 2172 wm_name == "compiz" || |
2173 wm_name == "e16" || // Enlightenment DR16 | 2173 wm_name == "e16" || // Enlightenment DR16 |
2174 wm_name == "Metacity" || | 2174 wm_name == "Metacity" || |
2175 wm_name == "Mutter" || | 2175 wm_name == "Mutter" || |
2176 wm_name == "Openbox" || | 2176 wm_name == "Openbox" || |
2177 wm_name == "Xfwm4"); | 2177 wm_name == "Xfwm4"); |
2178 } | 2178 } |
OLD | NEW |