diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-25 23:15:41 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-25 23:15:41 +0000 |
commit | c566c610480e0d8e915193c058f415a7660d48b5 (patch) | |
tree | f36460711defe77bb82f060ab1aa005a24de5475 /base/keyboard_code_conversion_gtk.h | |
parent | e098ce874e942a11083116f848310d026e8c37c8 (diff) | |
download | chromium_src-c566c610480e0d8e915193c058f415a7660d48b5.zip chromium_src-c566c610480e0d8e915193c058f415a7660d48b5.tar.gz chromium_src-c566c610480e0d8e915193c058f415a7660d48b5.tar.bz2 |
[Relanding erg's change with fix for toolkit_views shortcuts and
interactive ui tests. Note that this was originally reviewed in
http://codereview.chromium.org/217022/show I originally Elliot
suggestion of replacing the usage of int for keycode with the
bae::Keycode type, but that led to the CL getting out of hands
(as this is used in many different places). So this is only the
patch set 1 of that CL, I'll replace the type in another CL]
Use windows keycodes under linux (and all non-windows platforms).
This fixes any place where we use a VKEY_* (RenderWidgetHost, for example)
under Linux, but breaks accelerators in TOOLKIT_VIEWS which relied on this
wrong behaviour.
Previously, keyboard_codes_linux defined all the VKEY_* constants as their
GDK_* counterparts, which is wrong since the VKEY_* are supposed to resolve
to windows key codes.
BUG=22551
TEST=Make sure accelerators still work as expected on Chrome Linux and
Chrome Linux with toolkit views. Test when the the accelerators with
the focus in the location bar and also with the focus on the page.
Review URL: http://codereview.chromium.org/235025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27284 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/keyboard_code_conversion_gtk.h')
-rwxr-xr-x | base/keyboard_code_conversion_gtk.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/base/keyboard_code_conversion_gtk.h b/base/keyboard_code_conversion_gtk.h new file mode 100755 index 0000000..9fd3b11 --- /dev/null +++ b/base/keyboard_code_conversion_gtk.h @@ -0,0 +1,49 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/* + * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. + * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com + * Copyright (C) 2007 Holger Hans Peter Freyther + * Copyright (C) 2008 Collabora, Ltd. All rights reserved. + * Copyright (C) 2008, 2009 Google Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +// WindowsKeyCodeForGdkKeyCode is copied from platform/gtk/KeyEventGtk.cpp + +#ifndef BASE_KEYBOARD_CODE_CONVERSION_GTK_H_ +#define BASE_KEYBOARD_CODE_CONVERSION_GTK_H_ + +#include "base/keyboard_codes_posix.h" + +namespace base { + +int WindowsKeyCodeForGdkKeyCode(int keycode); + +int GdkKeyCodeForWindowsKeyCode(int keycode); + +} // namespace + +#endif // BASE_KEYBOARD_CODE_CONVERSION_GTK_H_ |