summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-10 22:01:36 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-10 22:01:36 +0000
commit407d01b42f853c6c0880e44da72f68d90ba54bf5 (patch)
tree4ca00030f260fb71b8cfc135577b0a9c76d26e6c /chrome
parentc033cbe94c504d2346c5e99c1ac12fda41f3f46a (diff)
downloadchromium_src-407d01b42f853c6c0880e44da72f68d90ba54bf5.zip
chromium_src-407d01b42f853c6c0880e44da72f68d90ba54bf5.tar.gz
chromium_src-407d01b42f853c6c0880e44da72f68d90ba54bf5.tar.bz2
Pass unhandled events to Cocoa; thanks to Dmitri for the event fix.
Review URL: http://codereview.chromium.org/42039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11384 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/tab_contents/web_contents_view_mac.mm15
1 files changed, 12 insertions, 3 deletions
diff --git a/chrome/browser/tab_contents/web_contents_view_mac.mm b/chrome/browser/tab_contents/web_contents_view_mac.mm
index 56f9d4e..19c2d64 100644
--- a/chrome/browser/tab_contents/web_contents_view_mac.mm
+++ b/chrome/browser/tab_contents/web_contents_view_mac.mm
@@ -12,6 +12,10 @@
#include "chrome/common/temp_scaffolding_stubs.h"
+@interface WebContentsViewCocoa (Private)
+- (void)processKeyboardEvent:(NSEvent*)event;
+@end
+
// static
WebContentsView* WebContentsView::Create(WebContents* web_contents) {
return new WebContentsViewMac(web_contents);
@@ -157,9 +161,7 @@ void WebContentsViewMac::TakeFocus(bool reverse) {
void WebContentsViewMac::HandleKeyboardEvent(
const NativeWebKeyboardEvent& event) {
- // The renderer returned a keyboard event it did not process. TODO(avi):
- // Grab the NSEvent off |event| and feed it to the view.
- NOTIMPLEMENTED();
+ [cocoa_view_.get() processKeyboardEvent:event.os_event];
}
void WebContentsViewMac::OnFindReply(int request_id,
@@ -243,6 +245,13 @@ void WebContentsViewMac::Observe(NotificationType type,
@implementation WebContentsViewCocoa
+- (void)processKeyboardEvent:(NSEvent*)event {
+ if ([event type] == NSKeyDown)
+ [super keyDown:event];
+ else if ([event type] == NSKeyUp)
+ [super keyUp:event];
+}
+
// Tons of stuff goes here, where we grab events going on in Cocoaland and send
// them into the C++ system. TODO(avi): all that jazz