diff options
author | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-01 17:32:34 +0000 |
---|---|---|
committer | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-01 17:32:34 +0000 |
commit | 1e2172ff39484f471335a27aab380ab8e6a24016 (patch) | |
tree | 42537429251e253312efe8b20a1fa4c5120e2470 /chrome/browser/ui/browser_command_controller.cc | |
parent | f34c91a9caea22faa15f2af5832aaeb3a84ec218 (diff) | |
download | chromium_src-1e2172ff39484f471335a27aab380ab8e6a24016.zip chromium_src-1e2172ff39484f471335a27aab380ab8e6a24016.tar.gz chromium_src-1e2172ff39484f471335a27aab380ab8e6a24016.tar.bz2 |
linux_aura: Port GtkKeybindingsHandler to Aura.
This is a quick hack to move the current GtkKeybindingsHandler code into
aura builds. This is necessary so that Linux users who have set custom
keybindings can use them in edit fields. This only works in the content
area; further patches are needed for this to work in views.
This redoes the interface so that instead of being hard coded into
content, we have a general interface set in ui/wm/. This should allow
views to also use this code in ui/views/, as well as its current usage
in content/.
BUG=319437, 358297
R=piman@chromium.org, sadrul@chromium.org, sky@chromium.org
Review URL: https://codereview.chromium.org/213283004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260900 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/browser_command_controller.cc')
-rw-r--r-- | chrome/browser/ui/browser_command_controller.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc index 71a5265..510221b 100644 --- a/chrome/browser/ui/browser_command_controller.cc +++ b/chrome/browser/ui/browser_command_controller.cc @@ -68,6 +68,10 @@ #include "chrome/browser/ui/browser_commands_chromeos.h" #endif +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) +#include "ui/events/x/text_edit_key_bindings_delegate_x11.h" +#endif + using content::NavigationEntry; using content::NavigationController; using content::WebContents; @@ -282,6 +286,16 @@ bool BrowserCommandController::IsReservedCommandOrKey( if (window()->IsFullscreen() && command_id == IDC_FULLSCREEN) return true; + +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(TOOLKIT_GTK) + // If this key was registered by the user as a content editing hotkey, then + // it is not reserved. + ui::TextEditKeyBindingsDelegateX11* delegate = + ui::GetTextEditKeyBindingsDelegate(); + if (delegate && delegate->MatchEvent(*event.os_event, NULL)) + return false; +#endif + return command_id == IDC_CLOSE_TAB || command_id == IDC_CLOSE_WINDOW || command_id == IDC_NEW_INCOGNITO_WINDOW || |