diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-06 20:50:52 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-06 20:50:52 +0000 |
commit | d74cec8902c565f0045d2747a7091f4d2931f57b (patch) | |
tree | 0b62b664e5720e52b7680ac4411813d11b7f45aa /chrome/browser/tab_contents | |
parent | 1040cb10711a7a19051576eb96f33fc3632088f3 (diff) | |
download | chromium_src-d74cec8902c565f0045d2747a7091f4d2931f57b.zip chromium_src-d74cec8902c565f0045d2747a7091f4d2931f57b.tar.gz chromium_src-d74cec8902c565f0045d2747a7091f4d2931f57b.tar.bz2 |
RenderWidgetHost now only accepts a new NativeWebKeyboardEvent which owns a copy of the native os event.
Only the WebKeyboardEvent is sent over the IPC barrier, but the full structure passed to the unhandled key event handler.
BUG=4772
Review URL: http://codereview.chromium.org/40065
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11152 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
7 files changed, 15 insertions, 13 deletions
diff --git a/chrome/browser/tab_contents/interstitial_page.cc b/chrome/browser/tab_contents/interstitial_page.cc index a56618b..33754fe 100644 --- a/chrome/browser/tab_contents/interstitial_page.cc +++ b/chrome/browser/tab_contents/interstitial_page.cc @@ -86,7 +86,7 @@ class InterstitialPage::InterstitialPageRVHViewDelegate virtual void StartDragging(const WebDropData& drop_data); virtual void UpdateDragCursor(bool is_drop_target); virtual void TakeFocus(bool reverse); - virtual void HandleKeyboardEvent(const WebKeyboardEvent& event); + virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event); virtual void ForwardMessageToDevToolsClient(const IPC::Message& message); virtual void OnFindReply(int request_id, int number_of_matches, @@ -499,7 +499,7 @@ void InterstitialPage::InterstitialPageRVHViewDelegate::TakeFocus( } void InterstitialPage::InterstitialPageRVHViewDelegate::HandleKeyboardEvent( - const WebKeyboardEvent& event) { + const NativeWebKeyboardEvent& event) { if (interstitial_page_->tab() && interstitial_page_->tab()->GetViewDelegate()) interstitial_page_->tab()->GetViewDelegate()->HandleKeyboardEvent(event); } diff --git a/chrome/browser/tab_contents/web_contents_view_gtk.cc b/chrome/browser/tab_contents/web_contents_view_gtk.cc index 5b14c08..35ca7b1 100644 --- a/chrome/browser/tab_contents/web_contents_view_gtk.cc +++ b/chrome/browser/tab_contents/web_contents_view_gtk.cc @@ -146,7 +146,7 @@ void WebContentsViewGtk::TakeFocus(bool reverse) { web_contents_->delegate()->SetFocusToLocationBar(); } -void WebContentsViewGtk::HandleKeyboardEvent(const WebKeyboardEvent& event) { +void WebContentsViewGtk::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { // The renderer returned a keyboard event it did not process. This may be // a keyboard shortcut that we have to process. // The windows code forwards this event onwards to accelerator handling, diff --git a/chrome/browser/tab_contents/web_contents_view_gtk.h b/chrome/browser/tab_contents/web_contents_view_gtk.h index ea5e38c..8975ce6 100644 --- a/chrome/browser/tab_contents/web_contents_view_gtk.h +++ b/chrome/browser/tab_contents/web_contents_view_gtk.h @@ -54,7 +54,7 @@ class WebContentsViewGtk : public WebContentsView { virtual void StartDragging(const WebDropData& drop_data); virtual void UpdateDragCursor(bool is_drop_target); virtual void TakeFocus(bool reverse); - virtual void HandleKeyboardEvent(const WebKeyboardEvent& event); + virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event); virtual void OnFindReply(int request_id, int number_of_matches, const gfx::Rect& selection_rect, diff --git a/chrome/browser/tab_contents/web_contents_view_mac.h b/chrome/browser/tab_contents/web_contents_view_mac.h index 44772a5..497725c 100644 --- a/chrome/browser/tab_contents/web_contents_view_mac.h +++ b/chrome/browser/tab_contents/web_contents_view_mac.h @@ -69,7 +69,7 @@ class WebContentsViewMac : public WebContentsView, virtual void StartDragging(const WebDropData& drop_data); virtual void UpdateDragCursor(bool is_drop_target); virtual void TakeFocus(bool reverse); - virtual void HandleKeyboardEvent(const WebKeyboardEvent& event); + virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event); virtual void OnFindReply(int request_id, int number_of_matches, const gfx::Rect& selection_rect, diff --git a/chrome/browser/tab_contents/web_contents_view_mac.mm b/chrome/browser/tab_contents/web_contents_view_mac.mm index acdf717..56f9d4e 100644 --- a/chrome/browser/tab_contents/web_contents_view_mac.mm +++ b/chrome/browser/tab_contents/web_contents_view_mac.mm @@ -155,9 +155,10 @@ void WebContentsViewMac::TakeFocus(bool reverse) { [cocoa_view_.get() becomeFirstResponder]; } -void WebContentsViewMac::HandleKeyboardEvent(const WebKeyboardEvent& event) { +void WebContentsViewMac::HandleKeyboardEvent( + const NativeWebKeyboardEvent& event) { // The renderer returned a keyboard event it did not process. TODO(avi): - // reconstruct an NSEvent and feed it to the view. + // Grab the NSEvent off |event| and feed it to the view. NOTIMPLEMENTED(); } diff --git a/chrome/browser/tab_contents/web_contents_view_win.cc b/chrome/browser/tab_contents/web_contents_view_win.cc index c66d339..c0e1aab 100644 --- a/chrome/browser/tab_contents/web_contents_view_win.cc +++ b/chrome/browser/tab_contents/web_contents_view_win.cc @@ -247,7 +247,8 @@ void WebContentsViewWin::TakeFocus(bool reverse) { focus_manager->AdvanceFocus(reverse); } -void WebContentsViewWin::HandleKeyboardEvent(const WebKeyboardEvent& event) { +void WebContentsViewWin::HandleKeyboardEvent( + const NativeWebKeyboardEvent& event) { // Previous calls to TranslateMessage can generate CHAR events as well as // RAW_KEY_DOWN events, even if the latter triggered an accelerator. In these // cases, we discard the CHAR events. @@ -291,10 +292,10 @@ void WebContentsViewWin::HandleKeyboardEvent(const WebKeyboardEvent& event) { // Any unhandled keyboard/character messages should be defproced. // This allows stuff like Alt+F4, etc to work correctly. - DefWindowProc(event.actual_message.hwnd, - event.actual_message.message, - event.actual_message.wParam, - event.actual_message.lParam); + DefWindowProc(event.os_event.hwnd, + event.os_event.message, + event.os_event.wParam, + event.os_event.lParam); } void WebContentsViewWin::ShowContextMenu(const ContextMenuParams& params) { diff --git a/chrome/browser/tab_contents/web_contents_view_win.h b/chrome/browser/tab_contents/web_contents_view_win.h index afa2c3a..15fd3f5 100644 --- a/chrome/browser/tab_contents/web_contents_view_win.h +++ b/chrome/browser/tab_contents/web_contents_view_win.h @@ -59,7 +59,7 @@ class WebContentsViewWin : public WebContentsView, virtual void StartDragging(const WebDropData& drop_data); virtual void UpdateDragCursor(bool is_drop_target); virtual void TakeFocus(bool reverse); - virtual void HandleKeyboardEvent(const WebKeyboardEvent& event); + virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event); private: // Windows events ------------------------------------------------------------ |