diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-12 20:38:49 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-12 20:38:49 +0000 |
commit | 3f70c1e17d42cccd53e1b827d239c86d1ed701da (patch) | |
tree | d1af746656d76471d38ae178375debdcb0a686ae /chrome/browser/views/unhandled_keyboard_event_handler.h | |
parent | ab8089b5a8442d10b85fd12b40b8771c86c81b8d (diff) | |
download | chromium_src-3f70c1e17d42cccd53e1b827d239c86d1ed701da.zip chromium_src-3f70c1e17d42cccd53e1b827d239c86d1ed701da.tar.gz chromium_src-3f70c1e17d42cccd53e1b827d239c86d1ed701da.tar.bz2 |
Unhandled keyboard messages coming back from the host browser running ChromeFrame need to process
accelerators. Currently accelerators are processed by the focus manager. We already have code in browser_view
to process unhandled keyboard messages coming back from the renderer. Moved this code to a new class
UnhandledKeyboardEventHandler which maintains state about whether the next character event has to be ignored, etc.
This class is now used by BrowserView and the ExternalTabContainer to process unhandled keyboard messages.
To support accelerators in ChromeFrame, the ExternalTabContainer needs to implement an Accelerator target. I also
added a minimal accelerator table for Chromeframe in the chrome_dll.rc and chrome_dll_resource.h files.
This fixes bug http://code.google.com/p/chromium/issues/detail?id=31672
Bug=31672
Review URL: http://codereview.chromium.org/536023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36037 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/unhandled_keyboard_event_handler.h')
-rw-r--r-- | chrome/browser/views/unhandled_keyboard_event_handler.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/chrome/browser/views/unhandled_keyboard_event_handler.h b/chrome/browser/views/unhandled_keyboard_event_handler.h new file mode 100644 index 0000000..4873bcd --- /dev/null +++ b/chrome/browser/views/unhandled_keyboard_event_handler.h @@ -0,0 +1,39 @@ +// Copyright (c) 2006-2010 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. + +#ifndef CHROME_BROWSER_VIEWS_UNHANDLED_KEYBOARD_EVENT_HANDLER_H_ +#define CHROME_BROWSER_VIEWS_UNHANDLED_KEYBOARD_EVENT_HANDLER_H_ + +#include "views/view.h" +#include "chrome/common/native_web_keyboard_event.h" + +namespace views { +class FocusManager; +} // namespace views + +// This class handles unhandled keyboard messages coming back from the renderer +// process. +class UnhandledKeyboardEventHandler { + public: + UnhandledKeyboardEventHandler(); + ~UnhandledKeyboardEventHandler(); + + void HandleKeyboardEvent(const NativeWebKeyboardEvent& event, + views::FocusManager* focus_manager); + + private: +#if defined(OS_WIN) + // Whether to ignore the next Char keyboard event. + // If a RawKeyDown event was handled as a shortcut key, then we're done + // handling it and should eat any Char event that the translate phase may + // have produced from it. (Handling this event may cause undesirable effects, + // such as a beep if DefWindowProc() has no default handling for the given + // Char.) + bool ignore_next_char_event_; +#endif + + DISALLOW_COPY_AND_ASSIGN(UnhandledKeyboardEventHandler); +}; + +#endif // CHROME_BROWSER_VIEWS_UNHANDLED_KEYBOARD_EVENT_HANDLER_H_ |