summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host/render_view_host_delegate.h
diff options
context:
space:
mode:
authorsuzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-10 06:01:48 +0000
committersuzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-10 06:01:48 +0000
commit867125a08f77a22b770f197d90519a8672af83aa (patch)
tree3d2ba6406f0932155b333af29bb2d9bff3e2d276 /chrome/browser/renderer_host/render_view_host_delegate.h
parent44d64924960f793fd92f964d1e349216757c1856 (diff)
downloadchromium_src-867125a08f77a22b770f197d90519a8672af83aa.zip
chromium_src-867125a08f77a22b770f197d90519a8672af83aa.tar.gz
chromium_src-867125a08f77a22b770f197d90519a8672af83aa.tar.bz2
Refactor the keyboard events handling code related to RenderViewHostDelegate::View and TabContentsDelegate interfaces.
Significant changes made by this CL: 1. The keyboard event handling code has been moved from TabContentsView implementation classes into BrowserWindow implementation classes. Please refer to this discussion thread: http://groups.google.com/group/chromium-dev/browse_thread/thread/e6e0b5cc105659b7/9953c4308bb0000c This change makes the keyboard event flow comply with the relationship between TabContents/TabContentsView and TabContentsDelegate/BrowserWindow. Besides it, the code is also simplified a lot, for example, the keyboard event handling code in chrome/browser/views/tab_contents/tab_contents_view_{gtk,win}.cc are now merged into one copy and moved into chrome/browser/views/frame/browser_view.cc. 2. A pre-handle phrase has been added into the keyboard event handling flow. A keyboard event will be first sent to the browser for pre-handling before being sent to the renderer. Then if the event was not handled by the renderer, it'll be sent to the browser again for post-handling. 3. The keyboard accelerator handling code of Windows and Linux ports have been optimized to get rid off extra command lookup. 4. The keyboard event message flow between the browser and the renderer is changed back to full async mode, all complex logics introduced by revision 29857 are removed. BUG=24479, 26054, 26131, 28839 TEST=See bug reports. Review URL: http://codereview.chromium.org/400012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34234 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host/render_view_host_delegate.h')
-rw-r--r--chrome/browser/renderer_host/render_view_host_delegate.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/chrome/browser/renderer_host/render_view_host_delegate.h b/chrome/browser/renderer_host/render_view_host_delegate.h
index a3d75c6..972a75b 100644
--- a/chrome/browser/renderer_host/render_view_host_delegate.h
+++ b/chrome/browser/renderer_host/render_view_host_delegate.h
@@ -126,15 +126,18 @@ class RenderViewHostDelegate {
// true, it means the focus was retrieved by doing a Shift-Tab.
virtual void TakeFocus(bool reverse) = 0;
- // Returns whether the event is a reserved keyboard shortcut that should not
- // be sent to the renderer.
- virtual bool IsReservedAccelerator(const NativeWebKeyboardEvent& event) = 0;
+ // Callback to give the browser a chance to handle the specified keyboard
+ // event before sending it to the renderer.
+ // Returns true if the |event| was handled. Otherwise, if the |event| would
+ // be handled in HandleKeyboardEvent() method as a normal keyboard shortcut,
+ // |*is_keyboard_shortcut| should be set to true.
+ virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event,
+ bool* is_keyboard_shortcut) = 0;
// Callback to inform the browser that the renderer did not process the
// specified events. This gives an opportunity to the browser to process the
// event (used for keyboard shortcuts).
- // Returns true if the event was handled.
- virtual bool HandleKeyboardEvent(const NativeWebKeyboardEvent& event) = 0;
+ virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event) = 0;
// Notifications about mouse events in this view. This is useful for
// implementing global 'on hover' features external to the view.